-
Notifications
You must be signed in to change notification settings - Fork 953
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
Support stencil-only views and copying to/from combined depth-stencil textures #3436
Support stencil-only views and copying to/from combined depth-stencil textures #3436
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is amazing stuff - my only main ask is if there could be a test for it - with this amount of code it's hard to judge if it's actually correct
4e04893
to
b6a6ccf
Compare
I created a It should test depth view creation indirectly since it's needed for the copy via shader and to test stencil view creation, there is some commented out code to do so. One thing worth noting is that once we get the CTS up and running, it should also test copying to/from combined depth-stencil textures and creation of stencil-only views. |
b538f9f
to
36e4df7
Compare
36e4df7
to
1bcd63e
Compare
WARP is failing with...
My Nvidia dGPU and Intel iGPU run the test without issues. |
1bcd63e
to
0133bcc
Compare
The |
… textures - break down `describe` into `block_dimensions`, `required_features`, `guaranteed_format_features`, `sample_type` and `block_size` - `sample_type` and `block_size` now take an optional `TextureAspect` To enable copying to/from combined depth-stencil textures: - [validation] copy aspect must refer to a single aspect of format - [validation] update `validate_linear_texture_data` according to the WebGPU spec - [validation] require missing `DEPTH_TEXTURE_AND_BUFFER_COPIES` downlevel flag for `queue_write_texture` and `command_encoder_copy_buffer_to_texture` - [metal] set the right `MTLBlitOption` for texture/buffer copies - [dx12] use specific copy texture formats and set the right texture plane To create stencil-only views from combined depth-stencil textures: - [metal] set the right format `X24_Stencil8`/`X32_Stencil8` for the view and `MTLTextureUsage::PixelFormatView` for the texture - [gles] set the right `DEPTH_STENCIL_TEXTURE_MODE` to either `DEPTH_COMPONENT` or `STENCIL_INDEX` - [dx12] set the right formats `DXGI_FORMAT_X32_TYPELESS_G8X24_UINT` and `DXGI_FORMAT_X24_TYPELESS_G8_UINT`
5c6c1b7
to
00209f3
Compare
Should be good to go now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely stunning work all over, as always!
General changes:
describe
intoblock_dimensions
,required_features
,guaranteed_format_features
,sample_type
andblock_size
sample_type
andblock_size
now take an optionalTextureAspect
To enable copying to/from combined depth-stencil textures:
validate_linear_texture_data
according to the WebGPU specDEPTH_TEXTURE_AND_BUFFER_COPIES
downlevel flag forqueue_write_texture
andcommand_encoder_copy_buffer_to_texture
MTLBlitOption
for texture/buffer copiesTo create stencil-only views from combined depth-stencil textures:
X24_Stencil8
/X32_Stencil8
for the view andMTLTextureUsage::PixelFormatView
for the textureDEPTH_STENCIL_TEXTURE_MODE
to eitherDEPTH_COMPONENT
orSTENCIL_INDEX
DXGI_FORMAT_X32_TYPELESS_G8X24_UINT
andDXGI_FORMAT_X24_TYPELESS_G8_UINT