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

texture_create_from_native_handle() should return RID for texture from RenderingServer, not RenderingDevice #103296

Conversation

dsnopek
Copy link
Contributor

@dsnopek dsnopek commented Feb 25, 2025

Right now, when using a rendering device renderer, RenderingServer.texture_create_from_native_handle() is returning an RID for an "RD texture" (aka a texture from RenderingDevice) rather than a texture from RenderingServer, like it's supposed to.

This was my mistake!

This function was introduced by my PR #96928, and I missed a step. Sorry about that!

This PR fixes the issue by wrapping the "RD texture" in a normal texture from RenderingServer.

I also attempted to clarify the note in the docs which explains that if you're targeting only the rendering device renderer, then you can get more control by using RenderingDevice.texture_create_from_extension() and RenderServer.texture_rd_create().

… from `RenderingServer`, not `RenderingDevice`
@dsnopek dsnopek added bug topic:rendering topic:xr cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release labels Feb 25, 2025
@dsnopek dsnopek added this to the 4.5 milestone Feb 25, 2025
@dsnopek dsnopek requested review from a team as code owners February 25, 2025 20:31
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.

Makes sense!

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

This is a new feature in 4.4 so I'd be fine merging this for 4.4.rc2 still. If the new feature is broken, it can't really get more broken with a late fix ;)

@dsnopek
Copy link
Contributor Author

dsnopek commented Feb 25, 2025

This is a new feature in 4.4 so I'd be fine merging this for 4.4.rc2 still.

Ok, thanks, I'll adjust the milestone and merge queue!

@dsnopek dsnopek modified the milestones: 4.5, 4.4 Feb 25, 2025
@dsnopek dsnopek removed the cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release label Feb 25, 2025
@akien-mga akien-mga merged commit e7ac8e4 into godotengine:master Feb 25, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

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.

3 participants