HLSL: phase 1: add RWTexture and RWBuffer

There's a lot to do for RWTexture and RWBuffer, so it will be broken up into
several PRs.  This is #1.

This adds RWTexture and RWBuffer support, with the following limitations:
  * Only 4 component formats supported
  * No operator[] yet

Those will be added in other PRs.

This PR supports declarations and the Load & GetDimensions methods.  New tests are
added.
This commit is contained in:
steve-lunarg
2016-10-04 16:58:14 -06:00
parent 9065ed83b8
commit bb0183f817
14 changed files with 2483 additions and 39 deletions

View File

@@ -258,6 +258,13 @@ void HlslScanContext::fillInKeywordMap()
(*KeywordMap)["TextureCubeArray"] = EHTokTextureCubearray;
(*KeywordMap)["Texture2DMS"] = EHTokTexture2DMS;
(*KeywordMap)["Texture2DMSArray"] = EHTokTexture2DMSarray;
(*KeywordMap)["RWTexture1D"] = EHTokRWTexture1d;
(*KeywordMap)["RWTexture1DArray"] = EHTokRWTexture1darray;
(*KeywordMap)["RWTexture2D"] = EHTokRWTexture2d;
(*KeywordMap)["RWTexture2DArray"] = EHTokRWTexture2darray;
(*KeywordMap)["RWTexture3D"] = EHTokRWTexture3d;
(*KeywordMap)["RWBuffer"] = EHTokRWBuffer;
(*KeywordMap)["struct"] = EHTokStruct;
(*KeywordMap)["cbuffer"] = EHTokCBuffer;
@@ -581,6 +588,12 @@ EHlslTokenClass HlslScanContext::tokenizeIdentifier()
case EHTokTextureCubearray:
case EHTokTexture2DMS:
case EHTokTexture2DMSarray:
case EHTokRWTexture1d:
case EHTokRWTexture1darray:
case EHTokRWTexture2d:
case EHTokRWTexture2darray:
case EHTokRWTexture3d:
case EHTokRWBuffer:
return keyword;
// variable, user type, ...