[hlsl-writer] Emit texture types

This CL adds emission of the texture types from the HLSL backend.

Bug: tint:146
Change-Id: I378bd6d63719acfbedff887bdf280709dc981e8f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/32221
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
dan sinclair
2020-11-10 22:10:56 +00:00
committed by Commit Bot service account
parent 84f827506a
commit 2e6dc6037a
3 changed files with 218 additions and 0 deletions

View File

@@ -104,6 +104,43 @@ decorated with `NonWritable` or each member of the struct can be decorated with
| tanh | GLSLstd450Tanh | tanh | tanh |
| trunc | GLSLstd450Trunc | trunc | trunc |
# Types
## Sampler Types
| WGSL | SPIR-V | MSL | HLSL |
|------|--------|-----|------|
| sampler | OpTypeSampler | | SamplerState |
| sampler_comparison | OpTypeSampler | | SamplerComparisonState |
## Texture Types
| WGSL | SPIR-V | MSL | HLSL |
|------|--------|-----|------|
| texture_1d | OpTypeImage | | Texture1D |
| texture_1d_array | OpTypeImage | | Texture1DArray |
| texture_2d | OpTypeImage | | Texture2D |
| texture_2d_array | OpTypeImage | | Texture2DArray |
| texture_3d | OpTypeImage | | Texture3D |
| texture_cube | OpTypeImage | | TextureCube |
| texture_cube_array | OpTypeImage | | TextureCubeArray |
| | | |
| texture_multisampled_2d&lt;type&gt; | OpTypeImage | | Texture2D |
| | | |
| texture_depth_2d | OpTypeImage | | Texture2D |
| texture_depth_2d_array | OpTypeImage | | Texture2DArray |
| texture_depth_cube | OpTypeImage | | TextureCube |
| texture_depth_cube_array | OpTypeImage | | TextureCubeArray |
| | | |
| texture_storage_ro_1d&lt;image_storage_type&gt; | OpTypeImage | | RWTexture1D |
| texture_storage_ro_1d_array&lt;image_storage_type&gt; | OpTypeImage | | RWTexture1DArray |
| texture_storage_ro_2d&lt;image_storage_type&gt; | OpTypeImage | | RWTexture2D |
| texture_storage_ro_2d_array&lt;image_storage_type&gt; | OpTypeImage | | RWTexture2DArray |
| texture_storage_ro_3d&lt;image_storage_type&gt; | OpTypeImage | | RWTexture3D |
| | | |
| texture_storage_wo_1d&lt;image_storage_type&gt; | OpTypeImage | | RWTexture1D |
| texture_storage_wo_1d_array&lt;image_storage_type&gt; | OpTypeImage | | RWTexture1DArray |
| texture_storage_wo_2d&lt;image_storage_type&gt; | OpTypeImage | | RWTexture2D |
| texture_storage_wo_2d_array&lt;image_storage_type&gt; | OpTypeImage | | RWTexture2DArray |
| texture_storage_wo_3d&lt;image_storage_type&gt; | OpTypeImage | | RWTexture3D|
# Short-circuting
## HLSL
TODO(dsinclair): Nested if's