从计算着色器中读取纹理。

huangapple go评论53阅读模式
英文:

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

huangapple
  • 本文由 发表于 2023年5月14日 20:31:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/76247496.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定