-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Vulkan: Remove texture allocation check #96832
Conversation
During DEBUG_ENABLED, the default for the Godot editor, a texture allocation check in `texture_create_shared()` causes foreign textures (without `tex_info->allocation`) created by `texture_create_from_extension()` to fail, because those textures naturally lack the required allocation information.
I've requested a review from @RandomShaper as he added that check when doing a massive refactor of the RenderingDevice in #83452 |
For context, this was also discussed July 10 in
|
The check has the purpose of validating if the id corresponds to an actual texture owning the data, which is what Rather than removing the check, I'd suggest enrichening it so it also accounts for the cases of externally backed textures (i.e., created from extension):
As a final note, |
…xture_create_from_extension()`), as such textures lack ownership information. More info: godotengine#96832
that indeed sounds like a better idea @RandomShaper |
…xture_create_from_extension()`), as such textures lack ownership information. More info: godotengine#96832
…xture_create_from_extension()`), as such textures lack ownership information. More info: godotengine#96832
…xture_create_from_extension()`), as such textures lack ownership information. More info: godotengine#96832
During
DEBUG_ENABLED
(the default for Godot editor as distributed by Godot) a texture allocation check intexture_create_shared()
causes foreign textures (those withouttex_info->allocation
) created bytexture_create_from_extension()
to fail, because such textures from external sources naturally lack the required allocation information.godot/drivers/vulkan/rendering_device_driver_vulkan.cpp
Lines 1781 to 1783 in 61be39a
For example, a
VkImage
may be passed totexture_create_from_extension()
, which is a function to handle incoming textures from external sources:godot/servers/rendering/rendering_device.cpp
Lines 941 to 943 in 61be39a
But when the result is applied as albedo on a StandardMaterial3D, it will lead to the following error.
This PR removes the check, because for foreign textures (like
VkImage
) you only need a view, whichtexture_create_from_extension
creates, and then just display the view, regardless of allocation information. In simple terms, this PR is necessary for external renderers to supply Godot with external textures.