mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-07 23:31:13 +00:00
Rename ShaderResource::IsSRV to a more generic IsReadOnly property
This commit is contained in:
@@ -816,7 +816,7 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11Pipe::Shader &stage, QL
|
||||
{
|
||||
for(const ShaderResource &bind : shaderDetails->ReadOnlyResources)
|
||||
{
|
||||
if(bind.IsSRV && bind.bindPoint == i)
|
||||
if(bind.IsReadOnly && bind.bindPoint == i)
|
||||
{
|
||||
shaderInput = &bind;
|
||||
break;
|
||||
|
||||
@@ -594,7 +594,7 @@ void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, QLabel *
|
||||
{
|
||||
for(const ShaderResource &bind : shaderDetails->ReadOnlyResources)
|
||||
{
|
||||
if(bind.IsSRV && mapping.ReadOnlyResources[bind.bindPoint].bind == i)
|
||||
if(bind.IsReadOnly && mapping.ReadOnlyResources[bind.bindPoint].bind == i)
|
||||
{
|
||||
shaderInput = &bind;
|
||||
map = &mapping.ReadOnlyResources[bind.bindPoint];
|
||||
|
||||
@@ -740,7 +740,7 @@ QTreeWidgetItem *ShaderViewer::makeResourceRegister(const BindpointMap &bind, ui
|
||||
|
||||
QChar regChar('u');
|
||||
|
||||
if(res.IsSRV)
|
||||
if(res.IsReadOnly)
|
||||
regChar = QChar('t');
|
||||
|
||||
// %1 = reg prefix (t or u for D3D11)
|
||||
|
||||
@@ -2005,7 +2005,7 @@ void TextureViewer::InitStageResourcePreviews(ShaderStage stage,
|
||||
for(int b = 0; b < resourceDetails.count; b++)
|
||||
{
|
||||
const ShaderResource &bind = resourceDetails[b];
|
||||
if(bind.bindPoint == idx && bind.IsSRV)
|
||||
if(bind.bindPoint == idx && bind.IsReadOnly)
|
||||
{
|
||||
bindName = bind.name;
|
||||
otherBind = true;
|
||||
@@ -2014,7 +2014,7 @@ void TextureViewer::InitStageResourcePreviews(ShaderStage stage,
|
||||
|
||||
if(bind.bindPoint == idx)
|
||||
{
|
||||
if(bind.IsSampler && !bind.IsSRV)
|
||||
if(bind.IsSampler && !bind.IsReadOnly)
|
||||
samplerBind = true;
|
||||
else
|
||||
otherBind = true;
|
||||
|
||||
@@ -237,7 +237,7 @@ struct ShaderResource
|
||||
{
|
||||
bool32 IsSampler;
|
||||
bool32 IsTexture;
|
||||
bool32 IsSRV;
|
||||
bool32 IsReadOnly;
|
||||
|
||||
TextureDim resType;
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ void Serialiser::Serialise(const char *name, ShaderResource &el)
|
||||
{
|
||||
Serialise("", el.IsSampler);
|
||||
Serialise("", el.IsTexture);
|
||||
Serialise("", el.IsSRV);
|
||||
Serialise("", el.IsReadOnly);
|
||||
Serialise("", el.resType);
|
||||
Serialise("", el.name);
|
||||
Serialise("", el.variableType);
|
||||
|
||||
@@ -207,17 +207,16 @@ ShaderReflection *MakeShaderReflection(DXBC::DXBCFile *dxbc)
|
||||
|
||||
if(r.type != DXBC::ShaderInputBind::TYPE_CBUFFER)
|
||||
{
|
||||
bool IsReadWrite = (r.type == DXBC::ShaderInputBind::TYPE_UAV_RWTYPED ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_UAV_RWSTRUCTURED ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_UAV_RWBYTEADDRESS ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_UAV_APPEND_STRUCTURED ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_UAV_CONSUME_STRUCTURED ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_UAV_RWSTRUCTURED_WITH_COUNTER);
|
||||
bool IsReadOnly = (r.type == DXBC::ShaderInputBind::TYPE_TBUFFER ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_TEXTURE ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_SAMPLER ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_STRUCTURED ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_BYTEADDRESS);
|
||||
|
||||
if(IsReadWrite)
|
||||
numRWResources++;
|
||||
else
|
||||
if(IsReadOnly)
|
||||
numROResources++;
|
||||
else
|
||||
numRWResources++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,16 +240,11 @@ ShaderReflection *MakeShaderReflection(DXBC::DXBCFile *dxbc)
|
||||
r.dimension != DXBC::ShaderInputBind::DIM_UNKNOWN &&
|
||||
r.dimension != DXBC::ShaderInputBind::DIM_BUFFER &&
|
||||
r.dimension != DXBC::ShaderInputBind::DIM_BUFFEREX);
|
||||
res.IsSRV = (r.type == DXBC::ShaderInputBind::TYPE_TBUFFER ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_TEXTURE ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_STRUCTURED ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_BYTEADDRESS);
|
||||
bool IsReadWrite = (r.type == DXBC::ShaderInputBind::TYPE_UAV_RWTYPED ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_UAV_RWSTRUCTURED ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_UAV_RWBYTEADDRESS ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_UAV_APPEND_STRUCTURED ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_UAV_CONSUME_STRUCTURED ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_UAV_RWSTRUCTURED_WITH_COUNTER);
|
||||
res.IsReadOnly = (r.type == DXBC::ShaderInputBind::TYPE_TBUFFER ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_TEXTURE ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_SAMPLER ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_STRUCTURED ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_BYTEADDRESS);
|
||||
|
||||
switch(r.dimension)
|
||||
{
|
||||
@@ -318,10 +312,10 @@ ShaderReflection *MakeShaderReflection(DXBC::DXBCFile *dxbc)
|
||||
}
|
||||
}
|
||||
|
||||
if(IsReadWrite)
|
||||
ret->ReadWriteResources[rwidx++] = res;
|
||||
else
|
||||
if(res.IsReadOnly)
|
||||
ret->ReadOnlyResources[roidx++] = res;
|
||||
else
|
||||
ret->ReadWriteResources[rwidx++] = res;
|
||||
}
|
||||
|
||||
uint32_t numInterfaces = 0;
|
||||
|
||||
@@ -257,16 +257,11 @@ void MakeShaderReflection(DXBC::DXBCFile *dxbc, ShaderReflection *refl,
|
||||
r.dimension != DXBC::ShaderInputBind::DIM_UNKNOWN &&
|
||||
r.dimension != DXBC::ShaderInputBind::DIM_BUFFER &&
|
||||
r.dimension != DXBC::ShaderInputBind::DIM_BUFFEREX);
|
||||
res.IsSRV = (r.type == DXBC::ShaderInputBind::TYPE_TBUFFER ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_TEXTURE ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_STRUCTURED ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_BYTEADDRESS);
|
||||
bool IsReadWrite = (r.type == DXBC::ShaderInputBind::TYPE_UAV_RWTYPED ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_UAV_RWSTRUCTURED ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_UAV_RWBYTEADDRESS ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_UAV_APPEND_STRUCTURED ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_UAV_CONSUME_STRUCTURED ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_UAV_RWSTRUCTURED_WITH_COUNTER);
|
||||
res.IsReadOnly = (r.type == DXBC::ShaderInputBind::TYPE_TBUFFER ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_SAMPLER ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_TEXTURE ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_STRUCTURED ||
|
||||
r.type == DXBC::ShaderInputBind::TYPE_BYTEADDRESS);
|
||||
|
||||
switch(r.dimension)
|
||||
{
|
||||
@@ -334,7 +329,7 @@ void MakeShaderReflection(DXBC::DXBCFile *dxbc, ShaderReflection *refl,
|
||||
}
|
||||
}
|
||||
|
||||
res.bindPoint = IsReadWrite ? rwidx : roidx;
|
||||
res.bindPoint = res.IsReadOnly ? roidx : rwidx;
|
||||
|
||||
BindpointMap map;
|
||||
map.arraySize = r.bindCount == 0 ? ~0U : r.bindCount;
|
||||
@@ -342,16 +337,16 @@ void MakeShaderReflection(DXBC::DXBCFile *dxbc, ShaderReflection *refl,
|
||||
map.bind = r.reg;
|
||||
map.used = true;
|
||||
|
||||
if(IsReadWrite)
|
||||
{
|
||||
mapping->ReadWriteResources[rwidx] = map;
|
||||
refl->ReadWriteResources[rwidx++] = res;
|
||||
}
|
||||
else
|
||||
if(res.IsReadOnly)
|
||||
{
|
||||
mapping->ReadOnlyResources[roidx] = map;
|
||||
refl->ReadOnlyResources[roidx++] = res;
|
||||
}
|
||||
else
|
||||
{
|
||||
mapping->ReadWriteResources[rwidx] = map;
|
||||
refl->ReadWriteResources[rwidx++] = res;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t numInterfaces = 0;
|
||||
|
||||
@@ -927,11 +927,9 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg,
|
||||
GLint values[numProps];
|
||||
gl.glGetProgramResourceiv(sepProg, eGL_UNIFORM, u, numProps, resProps, numProps, NULL, values);
|
||||
|
||||
bool IsReadWrite = false;
|
||||
|
||||
ShaderResource res;
|
||||
res.IsSampler = false; // no separate sampler objects in GL
|
||||
res.IsSRV = true;
|
||||
res.IsReadOnly = true;
|
||||
res.IsTexture = true;
|
||||
res.variableType.descriptor.rows = 1;
|
||||
res.variableType.descriptor.cols = 4;
|
||||
@@ -1182,88 +1180,77 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg,
|
||||
res.resType = TextureDim::Buffer;
|
||||
res.variableType.descriptor.name = "imageBuffer";
|
||||
res.variableType.descriptor.type = VarType::Float;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_IMAGE_1D)
|
||||
{
|
||||
res.resType = TextureDim::Texture1D;
|
||||
res.variableType.descriptor.name = "image1D";
|
||||
res.variableType.descriptor.type = VarType::Float;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_IMAGE_1D_ARRAY)
|
||||
{
|
||||
res.resType = TextureDim::Texture1DArray;
|
||||
res.variableType.descriptor.name = "image1DArray";
|
||||
res.variableType.descriptor.type = VarType::Float;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_IMAGE_2D)
|
||||
{
|
||||
res.resType = TextureDim::Texture2D;
|
||||
res.variableType.descriptor.name = "image2D";
|
||||
res.variableType.descriptor.type = VarType::Float;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_IMAGE_2D_ARRAY)
|
||||
{
|
||||
res.resType = TextureDim::Texture2DArray;
|
||||
res.variableType.descriptor.name = "image2DArray";
|
||||
res.variableType.descriptor.type = VarType::Float;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_IMAGE_2D_RECT)
|
||||
{
|
||||
res.resType = TextureDim::TextureRect;
|
||||
res.variableType.descriptor.name = "image2DRect";
|
||||
res.variableType.descriptor.type = VarType::Float;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_IMAGE_3D)
|
||||
{
|
||||
res.resType = TextureDim::Texture3D;
|
||||
res.variableType.descriptor.name = "image3D";
|
||||
res.variableType.descriptor.type = VarType::Float;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_IMAGE_CUBE)
|
||||
{
|
||||
res.resType = TextureDim::TextureCube;
|
||||
res.variableType.descriptor.name = "imageCube";
|
||||
res.variableType.descriptor.type = VarType::Float;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_IMAGE_CUBE_MAP_ARRAY)
|
||||
{
|
||||
res.resType = TextureDim::TextureCubeArray;
|
||||
res.variableType.descriptor.name = "imageCubeArray";
|
||||
res.variableType.descriptor.type = VarType::Float;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_IMAGE_2D_MULTISAMPLE)
|
||||
{
|
||||
res.resType = TextureDim::Texture2DMS;
|
||||
res.variableType.descriptor.name = "image2DMS";
|
||||
res.variableType.descriptor.type = VarType::Float;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_IMAGE_2D_MULTISAMPLE_ARRAY)
|
||||
{
|
||||
res.resType = TextureDim::Texture2DMSArray;
|
||||
res.variableType.descriptor.name = "image2DMSArray";
|
||||
res.variableType.descriptor.type = VarType::Float;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
// int images
|
||||
else if(values[0] == eGL_INT_IMAGE_BUFFER)
|
||||
@@ -1271,88 +1258,77 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg,
|
||||
res.resType = TextureDim::Buffer;
|
||||
res.variableType.descriptor.name = "iimageBuffer";
|
||||
res.variableType.descriptor.type = VarType::Int;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_INT_IMAGE_1D)
|
||||
{
|
||||
res.resType = TextureDim::Texture1D;
|
||||
res.variableType.descriptor.name = "iimage1D";
|
||||
res.variableType.descriptor.type = VarType::Int;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_INT_IMAGE_1D_ARRAY)
|
||||
{
|
||||
res.resType = TextureDim::Texture1DArray;
|
||||
res.variableType.descriptor.name = "iimage1DArray";
|
||||
res.variableType.descriptor.type = VarType::Int;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_INT_IMAGE_2D)
|
||||
{
|
||||
res.resType = TextureDim::Texture2D;
|
||||
res.variableType.descriptor.name = "iimage2D";
|
||||
res.variableType.descriptor.type = VarType::Int;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_INT_IMAGE_2D_ARRAY)
|
||||
{
|
||||
res.resType = TextureDim::Texture2DArray;
|
||||
res.variableType.descriptor.name = "iimage2DArray";
|
||||
res.variableType.descriptor.type = VarType::Int;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_INT_IMAGE_2D_RECT)
|
||||
{
|
||||
res.resType = TextureDim::TextureRect;
|
||||
res.variableType.descriptor.name = "iimage2DRect";
|
||||
res.variableType.descriptor.type = VarType::Int;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_INT_IMAGE_3D)
|
||||
{
|
||||
res.resType = TextureDim::Texture3D;
|
||||
res.variableType.descriptor.name = "iimage3D";
|
||||
res.variableType.descriptor.type = VarType::Int;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_INT_IMAGE_CUBE)
|
||||
{
|
||||
res.resType = TextureDim::TextureCube;
|
||||
res.variableType.descriptor.name = "iimageCube";
|
||||
res.variableType.descriptor.type = VarType::Int;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_INT_IMAGE_CUBE_MAP_ARRAY)
|
||||
{
|
||||
res.resType = TextureDim::TextureCubeArray;
|
||||
res.variableType.descriptor.name = "iimageCubeArray";
|
||||
res.variableType.descriptor.type = VarType::Int;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_INT_IMAGE_2D_MULTISAMPLE)
|
||||
{
|
||||
res.resType = TextureDim::Texture2DMS;
|
||||
res.variableType.descriptor.name = "iimage2DMS";
|
||||
res.variableType.descriptor.type = VarType::Int;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_INT_IMAGE_2D_MULTISAMPLE_ARRAY)
|
||||
{
|
||||
res.resType = TextureDim::Texture2DMSArray;
|
||||
res.variableType.descriptor.name = "iimage2DMSArray";
|
||||
res.variableType.descriptor.type = VarType::Int;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
// unsigned int images
|
||||
else if(values[0] == eGL_UNSIGNED_INT_IMAGE_BUFFER)
|
||||
@@ -1360,88 +1336,77 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg,
|
||||
res.resType = TextureDim::Buffer;
|
||||
res.variableType.descriptor.name = "uimageBuffer";
|
||||
res.variableType.descriptor.type = VarType::UInt;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_UNSIGNED_INT_IMAGE_1D)
|
||||
{
|
||||
res.resType = TextureDim::Texture1D;
|
||||
res.variableType.descriptor.name = "uimage1D";
|
||||
res.variableType.descriptor.type = VarType::UInt;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_UNSIGNED_INT_IMAGE_1D_ARRAY)
|
||||
{
|
||||
res.resType = TextureDim::Texture1DArray;
|
||||
res.variableType.descriptor.name = "uimage1DArray";
|
||||
res.variableType.descriptor.type = VarType::UInt;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_UNSIGNED_INT_IMAGE_2D)
|
||||
{
|
||||
res.resType = TextureDim::Texture2D;
|
||||
res.variableType.descriptor.name = "uimage2D";
|
||||
res.variableType.descriptor.type = VarType::UInt;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_UNSIGNED_INT_IMAGE_2D_ARRAY)
|
||||
{
|
||||
res.resType = TextureDim::Texture2DArray;
|
||||
res.variableType.descriptor.name = "uimage2DArray";
|
||||
res.variableType.descriptor.type = VarType::UInt;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_UNSIGNED_INT_IMAGE_2D_RECT)
|
||||
{
|
||||
res.resType = TextureDim::TextureRect;
|
||||
res.variableType.descriptor.name = "uimage2DRect";
|
||||
res.variableType.descriptor.type = VarType::UInt;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_UNSIGNED_INT_IMAGE_3D)
|
||||
{
|
||||
res.resType = TextureDim::Texture3D;
|
||||
res.variableType.descriptor.name = "uimage3D";
|
||||
res.variableType.descriptor.type = VarType::UInt;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_UNSIGNED_INT_IMAGE_CUBE)
|
||||
{
|
||||
res.resType = TextureDim::TextureCube;
|
||||
res.variableType.descriptor.name = "uimageCube";
|
||||
res.variableType.descriptor.type = VarType::UInt;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY)
|
||||
{
|
||||
res.resType = TextureDim::TextureCubeArray;
|
||||
res.variableType.descriptor.name = "uimageCubeArray";
|
||||
res.variableType.descriptor.type = VarType::UInt;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE)
|
||||
{
|
||||
res.resType = TextureDim::Texture2DMS;
|
||||
res.variableType.descriptor.name = "uimage2DMS";
|
||||
res.variableType.descriptor.type = VarType::UInt;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
else if(values[0] == eGL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY)
|
||||
{
|
||||
res.resType = TextureDim::Texture2DMSArray;
|
||||
res.variableType.descriptor.name = "uimage2DMSArray";
|
||||
res.variableType.descriptor.type = VarType::UInt;
|
||||
res.IsSRV = false;
|
||||
IsReadWrite = true;
|
||||
res.IsReadOnly = false;
|
||||
}
|
||||
// atomic counter
|
||||
else if(values[0] == eGL_UNSIGNED_INT_ATOMIC_COUNTER)
|
||||
@@ -1449,10 +1414,9 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg,
|
||||
res.resType = TextureDim::Buffer;
|
||||
res.variableType.descriptor.name = "atomic_uint";
|
||||
res.variableType.descriptor.type = VarType::UInt;
|
||||
res.IsSRV = false;
|
||||
res.IsReadOnly = false;
|
||||
res.IsTexture = false;
|
||||
res.variableType.descriptor.cols = 1;
|
||||
IsReadWrite = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1468,7 +1432,7 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg,
|
||||
|
||||
res.name = name;
|
||||
|
||||
vector<ShaderResource> &reslist = (IsReadWrite ? rwresources : roresources);
|
||||
vector<ShaderResource> &reslist = (res.IsReadOnly ? roresources : rwresources);
|
||||
|
||||
res.bindPoint = (int32_t)reslist.size();
|
||||
reslist.push_back(res);
|
||||
@@ -1508,7 +1472,7 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg,
|
||||
|
||||
ShaderResource res;
|
||||
res.IsSampler = false;
|
||||
res.IsSRV = false;
|
||||
res.IsReadOnly = false;
|
||||
res.IsTexture = false;
|
||||
res.resType = TextureDim::Buffer;
|
||||
res.variableType.descriptor.rows = 0;
|
||||
|
||||
@@ -4075,7 +4075,7 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint,
|
||||
if(ssbo)
|
||||
{
|
||||
res.IsSampler = false;
|
||||
res.IsSRV = false;
|
||||
res.IsReadOnly = false;
|
||||
res.IsTexture = false;
|
||||
res.name = cblock.name;
|
||||
res.resType = TextureDim::Buffer;
|
||||
@@ -4148,14 +4148,7 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint,
|
||||
res.IsSampler =
|
||||
type->type == SPVTypeData::eSampledImage || type->type == SPVTypeData::eSampler;
|
||||
res.IsTexture = res.resType != TextureDim::Buffer && type->type != SPVTypeData::eSampler;
|
||||
|
||||
if(type->type == SPVTypeData::eSampler)
|
||||
{
|
||||
res.resType = TextureDim::Unknown;
|
||||
res.IsSRV = false;
|
||||
}
|
||||
|
||||
bool isrw = false;
|
||||
res.IsReadOnly = true;
|
||||
|
||||
SPVTypeData *sampledType = type->baseType;
|
||||
if(type->type == SPVTypeData::eSampler)
|
||||
@@ -4165,7 +4158,6 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint,
|
||||
else if(type->texdim == spv::DimSubpassData)
|
||||
{
|
||||
res.resType = TextureDim::Texture2D;
|
||||
res.IsSRV = true;
|
||||
|
||||
if(sampledType->type == SPVTypeData::eFloat)
|
||||
res.variableType.descriptor.type = VarType::Float;
|
||||
@@ -4178,6 +4170,8 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint,
|
||||
}
|
||||
else
|
||||
{
|
||||
bool isrw = false;
|
||||
|
||||
if(sampledType->type == SPVTypeData::eImage)
|
||||
{
|
||||
isrw = (sampledType->sampled == 2);
|
||||
@@ -4188,7 +4182,7 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint,
|
||||
isrw = (type->sampled == 2);
|
||||
}
|
||||
|
||||
res.IsSRV = !isrw;
|
||||
res.IsReadOnly = !isrw;
|
||||
|
||||
if(sampledType->type == SPVTypeData::eFloat)
|
||||
res.variableType.descriptor.type = VarType::Float;
|
||||
@@ -4243,10 +4237,10 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint,
|
||||
// are used
|
||||
RDCASSERT(!bindmap.used || bindmap.bind >= 0);
|
||||
|
||||
if(isrw)
|
||||
rwresources.push_back(shaderrespair(bindmap, res));
|
||||
else
|
||||
if(res.IsReadOnly)
|
||||
roresources.push_back(shaderrespair(bindmap, res));
|
||||
else
|
||||
rwresources.push_back(shaderrespair(bindmap, res));
|
||||
}
|
||||
}
|
||||
else if(inst->var->storage == spv::StorageClassPrivate)
|
||||
|
||||
Reference in New Issue
Block a user