Skip to content

Commit 4ab9cba

Browse files
committed
Get the element type from the Constant not Global Variable for GEP
1 parent f2de54c commit 4ab9cba

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

renderdoc/driver/shaders/dxil/dxil_debug.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -891,12 +891,17 @@ static bool ConvertDXILConstantToShaderVariable(const Constant *constant, Shader
891891
RDCERR("Constant GetElementPtr first member is not a GlobalVar");
892892
return false;
893893
}
894-
const DXIL::Type *elementType = gv->type;
895-
if(elementType->type != Type::TypeKind::Pointer)
894+
if(gv->type->type != Type::TypeKind::Pointer)
896895
{
897896
RDCERR("Constant GetElementPtr global variable is not a Pointer");
898897
return false;
899898
}
899+
const DXIL::Type *elementType = constant->type;
900+
if(elementType->type != Type::TypeKind::Pointer)
901+
{
902+
RDCERR("Constant variable is not a Pointer");
903+
return false;
904+
}
900905
elementType = elementType->inner;
901906
VarType baseType = ConvertDXILTypeToVarType(elementType);
902907
uint32_t elementSize = GetElementByteSize(baseType);

0 commit comments

Comments
 (0)