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

Fix wrong default texture for global uniforms of type sampler2DArray #101941

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

Conversation

dsnopek
Copy link
Contributor

@dsnopek dsnopek commented Jan 22, 2025

Fixes #101938

There were two problem in this code:

  1. It always added a texture, even if it wasn't set on either value or override
  2. It assumed an unset value would be Variant::NIL, however, it looks like it's Variant::RID but if it's not set it'll be an empty RID (ie RID()).

With this PR, if you open the MRP from #101938, it will no longer spam the error every frame

@dsnopek dsnopek added this to the 4.4 milestone Jan 22, 2025
@dsnopek dsnopek requested a review from a team as a code owner January 22, 2025 23:15
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

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

Is the same issue present when using the mobile or Forward+ renderer? the same code is present there as well

@dsnopek
Copy link
Contributor Author

dsnopek commented Jan 23, 2025

Is the same issue present when using the mobile or Forward+ renderer? the same code is present there as well

Ah, yeah, looking at the code, it certainly looks like it has the same problem.

When I test it with the Mobile or Forward+ renderer, I don't get any errors (I really only noticed the problem under OpenGL because of the error spam). I tried enabling the Vulkan validation layers, and, unfortunately, I get endless error spam from them even with the global uniform removed - so most of the messages are unrelated to this issue. But that makes it hard to tell if there is or isn't an error message about this in there. Just scrolling through it, I don't see an error message that seems to be related to this issue?

Adding some print statements to the relevant code, seems to show that value is Variant::RID even when empty - whereas override is actually Variant::NIL. While that's a little different than what I was seeing for OpenGL, it does look like the same issue basically applies, and can be solved with the same code.

So, I'll update my PR to address this for Mobile and Forward+ as well!

@dsnopek dsnopek force-pushed the opengl-global-uniform-sampler2darray branch from 5a0d6d1 to 7e94c06 Compare January 23, 2025 16:00
@dsnopek dsnopek changed the title OpenGL: Fix wrong default texture for global uniforms of type sampler2DArray Fix wrong default texture for global uniforms of type sampler2DArray Jan 23, 2025
@dsnopek dsnopek requested a review from clayjohn January 23, 2025 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error spam "target doesn't match" with OpenGL and global uniform of type sampler2DArray with no value
2 participants