Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is this redundant looking call required? #98

Open
Robadob opened this issue Aug 17, 2022 · 4 comments
Open

Why is this redundant looking call required? #98

Robadob opened this issue Aug 17, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@Robadob
Copy link
Member

Robadob commented Aug 17, 2022

When adding support for keyframe animated models, I removed the below line of code thinking it was a mistake. However, this lead to the keyframe model's vertex attribute buffers appearing empty (unless the Shaders object was reloaded). When I added this line back it started working again.

As far as I could tell at a glance, this line is doing nothing that would benefit from it being called twice (the second call to addGenericAttributeDetail() passes update=true, only a single call should be required to update both).

Doesn't seem hugely important to understand the odd behaviour, but could be useful to clearly document (or fix) to save the line being inadvertently removed in future.

@Robadob Robadob added the bug Something isn't working label Aug 17, 2022
@MILeach
Copy link

MILeach commented Aug 17, 2022

I haven't tried to reproduce this but it sounds like very weird behaviour. I can't see any object state being mutated within this function. The only thing that really makes sense to me here is that some of the preceding code is leaving OpenGL in an invalid state causing something to fail on the first run through. The invalid state is restored to a valid one by the buffer binds etc. taking place within the function so then it succeeds second time round.

@Robadob
Copy link
Member Author

Robadob commented Aug 17, 2022

the preceding code is leaving OpenGL in an invalid state causing something to fail on the first run through. The invalid state is restored to a valid one by the buffer binds etc. taking place within the function so then it succeeds second time round.

Mm, will need to dig out that OpenGL calls debugger to try and catch that.

@MILeach
Copy link

MILeach commented Aug 17, 2022

Could also have a try with Renderdoc if you haven't done that already, very good for debugging graphics stuff

@Robadob
Copy link
Member Author

Robadob commented Aug 17, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants