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

Allow GLava to work without GL_NV_texture_barrier extension #143

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

quantum5
Copy link

Without this extension, GLava tries to call into a null pointer and segfaults.

Fix: don't call glTextureBarrierNV if the extension doesn't exist.

This is potentially unsafe, but appears to work fine in practice.

@jarcode-foss
Copy link
Owner

Are you on a driver that doesn't support this extension? Removing this call is sure to give rise to strange bugs that would be otherwise difficult to narrow down.

If your driver does not support this function (all major vendors should, despite the NV portion of the function name), then it would be preferred to replace it with a workaround that guarantees a shader texture write/read barrier on your hardware. The best way to do this is to use GL 4.x glMemoryBarrier, but the portion of GLava in question is trying to maintain 3.x compatibility for older hardware.

@quantum5
Copy link
Author

Yes, I was running GLava on mesa. Not the best combination, but it also shouldn't just outright crash with a segmentation fault.

I will give glMemoryBarrier a try, but we still have to gracefully handle the case when it is not supported. Perhaps a warning on startup and try to chug along despite the neither function existing?

@jarcode-foss
Copy link
Owner

@quantum5 Attempting to use glMemoryBarrier instead, and if that doesn't exist, force-disabling #request setaccelfft would be the best solution to avoid any output actually breaking.

Removing the glTextureBarrierNV on amdgpu completely breaks output so there is more than just a theoretical reason for needing this call.

Yes, I was running GLava on mesa.

I am assuming on older Intel integrated graphics, because most mesa drivers support glTextureBarrierNV.

Also, I would hold off on trying to fix the patch since there is a huge slew of changes pending on my local branch that contains the remainder of the GPU-accelerated FFT stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants