HLSL: add readonly qualifier to tbuffer, so they end up as SRV

This commit is contained in:
steve-lunarg 2017-04-20 13:16:23 -06:00
parent be28355019
commit 7b1dcd6693
7 changed files with 101 additions and 29 deletions

View file

@ -491,6 +491,48 @@ protected:
}
};
/********************************************************************************
The following IO resolver maps types in HLSL register space, as follows:
t for shader resource views (SRV)
TEXTURE1D
TEXTURE1DARRAY
TEXTURE2D
TEXTURE2DARRAY
TEXTURE3D
TEXTURECUBE
TEXTURECUBEARRAY
TEXTURE2DMS
TEXTURE2DMSARRAY
STRUCTUREDBUFFER
BYTEADDRESSBUFFER
BUFFER
TBUFFER
s for samplers
SAMPLER
SAMPLER1D
SAMPLER2D
SAMPLER3D
SAMPLERCUBE
SAMPLERSTATE
SAMPLERCOMPARISONSTATE
u for unordered access views (UAV)
RWBYTEADDRESSBUFFER
RWSTRUCTUREDBUFFER
APPENDSTRUCTUREDBUFFER
CONSUMESTRUCTUREDBUFFER
RWBUFFER
RWTEXTURE1D
RWTEXTURE1DARRAY
RWTEXTURE2D
RWTEXTURE2DARRAY
RWTEXTURE3D
b for constant buffer views (CBV)
CBUFFER
********************************************************************************/
struct TDefaultHlslIoResolver : public TDefaultIoResolverBase
{
bool validateBinding(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& type, bool /*is_live*/) override
@ -498,7 +540,6 @@ struct TDefaultHlslIoResolver : public TDefaultIoResolverBase
if (type.getQualifier().hasBinding()) {
const int set = getLayoutSet(type);
// Use Uav binding if requested: else will pass through to old behavior
if (isUavType(type))
return checkEmpty(set, baseUavBinding + type.getQualifier().layoutBinding);