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

RenderingDevice: Fix getting cubemap layer data #94656

Merged

Conversation

BlueCube3310
Copy link
Contributor

I've noticed this while working on #94600.

The code for retrieving cubemap layer data would multiply the layer count by 6, even though each cube face was already considered a separate layer. Due to this, the DEV_ASSERT below would get triggered due to mismatched data sizes.

@akien-mga akien-mga merged commit e4f7b69 into godotengine:master Jul 23, 2024
18 checks passed
@akien-mga
Copy link
Member

Thanks!

@BlueCube3310 BlueCube3310 deleted the cubemap-layers-retrieve-fix branch July 23, 2024 14:28
@clayjohn
Copy link
Member

This might need more careful testing, the same code is in texture_update and texture_copy. In all cases they are reading from the tex->layers property which is set at creation time

@BlueCube3310
Copy link
Contributor Author

After looking at the code, the layer_count variable appears to only be used for ensuring the provided index doesn't reach outside of the layers array.

@clayjohn
Copy link
Member

After looking at the code, the layer_count variable appears to only be used for ensuring the provided index doesn't reach outside of the layers array.

Very interesting. So it should be easy to validate then. I imagine the fix you did here would apply in those places too.

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.

4 participants