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

Handle auto enablement of texture LOD extension for GLSL 120 #684

Merged
merged 3 commits into from
Oct 29, 2024

Conversation

Cleptomania
Copy link
Member

Fixes a problem where Iris needs to inject the line for enabling the GL_ARB_shader_texture_lod extension when a shader calls the texture2DLod or texture3DLod extensions and is using GLSL 120.

@Dream-Master Dream-Master requested a review from a team October 29, 2024 15:09
@ah-OOG-ah
Copy link
Member

What's a shader that would normally trigger this?

@Cleptomania
Copy link
Member Author

Enabling advanced materials in BSL will trigger it. Can test without this PR to verify that.

@Cleptomania
Copy link
Member Author

Technically this may add the extension to shaders that have already specified it, but I haven't seen a problem with ones that explicitly defined it themselves, it doesn't seem to do anything bad if you have the extension declared twice, but we'll have to see if that changes between drivers or something.

If we need to later, I can add in a regex to check for the extension already being declared, but I don't think it's needed.

@Cleptomania
Copy link
Member Author

It is not technically valid GLSL 120 to write a shader that doesn't explicitly include this extension and use the functions from it, but Iris has had this patch since very early on, so there are almost certainly a good number of shaders doing it. The extension was made core in GLSL 130

Copy link
Member

@ah-OOG-ah ah-OOG-ah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm, fixes shader compilation for BSL w/advanced materials on Intel/Mesa.

@mitchej123 mitchej123 merged commit e11985a into master Oct 29, 2024
1 check passed
@mitchej123 mitchej123 deleted the texture-lod-extension branch October 29, 2024 23:22
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.

3 participants