Ability to bind ImageTexture
as uniform in global RenderingDevice
compute shader.
#7956
adamlesinski
started this conversation in
Engine Core
Replies: 1 comment 2 replies
-
This appears to be already tracked in #6964, if I'm understanding right. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to run a compute shader on the global
RenderingDevice
to generate a texture that is then used by a fragment shader, without copying the texture between CPU and GPU memory.Here is the code that would do this in Godot 4.1:
I had to make one change to the engine to get this to work: Add the
RD::TEXTURE_USAGE_STORAGE_BIT
flag to the texture that is created inTextureStorage::texture_2d_initialize
.Could this flag always be present? Is there a downside to including this flag at all times?
For more flexibility, there could be an API that would allow users to create an ImageTexture from the RID of a texture created from
RenderingDevice
.Or better yet, just have
ShaderMaterial::set_shader_parameter
accept someRDTexture
that represents the RID returned fromRenderingDevice::texture_create
.Beta Was this translation helpful? Give feedback.
All reactions