You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use WGSL textureLoad to read from a texture_2d<u32> bound to a Stencil8 texture view using the DX12 backend, the expected stencil value is in the GREEN channel. I expect it in the RED channel because of the WebGPU spec:
Reading or sampling the depth or stencil aspect of a texture behaves as if the texture contains the values (V, X, X, X), where V is the actual depth or stencil value, and each X is an implementation-defined unspecified value.
When I use the Vulkan backend instead, the value is in the RED channel as expected.
I assume this is because the actual SRV format the DX12 backend uses is DXGI_FORMAT_X24_TYPELESS_G8_UINT. I think you could use D3D12_SHADER_RESOURCE_VIEW_DESC::Shader4ComponentMapping to swizzle it into the RED channel.
The text was updated successfully, but these errors were encountered:
When I use WGSL
textureLoad
to read from atexture_2d<u32>
bound to aStencil8
texture view using the DX12 backend, the expected stencil value is in the GREEN channel. I expect it in the RED channel because of the WebGPU spec:When I use the Vulkan backend instead, the value is in the RED channel as expected.
I assume this is because the actual SRV format the DX12 backend uses is
DXGI_FORMAT_X24_TYPELESS_G8_UINT
. I think you could useD3D12_SHADER_RESOURCE_VIEW_DESC::Shader4ComponentMapping
to swizzle it into the RED channel.The text was updated successfully, but these errors were encountered: