英文:
Read from texture in compute shader
问题
"Read-write and read-only storage textures are not allowed by webgpu, they require the native only feature TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES."
"Reading from a texture in a compute shader is extremely useful, surely there must a way to accomplish this in some other way."
"Edit:
I am writing a raytracer eerily similar to this one.
https://github.com/jgrazian/wgpu-raytracer.
And this used to be possible in the past."
英文:
I am trying to read (and write) to a texture in my compute shader. And getting the following message:
Read-write and read-only storage textures are not allowed by webgpu, they require the native only feature TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES
Reading from a texture in a compute shader is extremely useful, surely there must a way to accomplish this in some other way.
Edit:
I am writing a raytracer eerily similar to this one.
https://github.com/jgrazian/wgpu-raytracer.
And this used to be possible in the past
答案1
得分: 2
在计算着色器中绑定纹理为普通Texture
,然后使用textureLoad
进行纹理读取是可能的:https://github.com/gfx-rs/wgpu/issues/2735
英文:
Reading from a texture in a compute shader is possible when binding the texture as a normal Texture
(not as a StorageTexture
) and then usingtextureLoad
on it: https://github.com/gfx-rs/wgpu/issues/2735
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论