Skip to content

Commit

Permalink
Always enable the generation of OpDebugBasicType for bool type
Browse files Browse the repository at this point in the history
  • Loading branch information
chaocNV authored and arcady-lunarg committed Dec 7, 2023
1 parent 0fedf7d commit 9a35abf
Show file tree
Hide file tree
Showing 14 changed files with 5,792 additions and 5,865 deletions.
2 changes: 1 addition & 1 deletion SPIRV/GlslangToSpv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4407,7 +4407,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
if (explicitLayout != glslang::ElpNone)
spvType = builder.makeUintType(32);
else
spvType = builder.makeBoolType(false);
spvType = builder.makeBoolType();
break;
case glslang::EbtInt:
spvType = builder.makeIntType(32);
Expand Down
13 changes: 7 additions & 6 deletions SPIRV/SpvBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,22 +182,23 @@ Id Builder::makeVoidType()
return type->getResultId();
}

Id Builder::makeBoolType(bool const compilerGenerated)
Id Builder::makeBoolType()
{
Instruction* type;
if (groupedTypes[OpTypeBool].size() == 0) {
type = new Instruction(getUniqueId(), NoType, OpTypeBool);
groupedTypes[OpTypeBool].push_back(type);
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
module.mapInstruction(type);

if (emitNonSemanticShaderDebugInfo) {
auto const debugResultId = makeBoolDebugType(32);
debugId[type->getResultId()] = debugResultId;
}

} else
type = groupedTypes[OpTypeBool].back();

if (emitNonSemanticShaderDebugInfo && !compilerGenerated)
{
auto const debugResultId = makeBoolDebugType(32);
debugId[type->getResultId()] = debugResultId;
}

return type->getResultId();
}
Expand Down
2 changes: 1 addition & 1 deletion SPIRV/SpvBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class Builder {

// For creating new types (will return old type if the requested one was already made).
Id makeVoidType();
Id makeBoolType(bool const compilerGenerated = true);
Id makeBoolType();
Id makePointer(StorageClass, Id pointee);
Id makeForwardPointer(StorageClass);
Id makePointerFromForwardPointer(StorageClass, Id forwardPointerType, Id pointee);
Expand Down
1,827 changes: 903 additions & 924 deletions Test/baseResults/spv.debuginfo.glsl.comp.out

Large diffs are not rendered by default.

1,813 changes: 902 additions & 911 deletions Test/baseResults/spv.debuginfo.glsl.frag.out

Large diffs are not rendered by default.

584 changes: 288 additions & 296 deletions Test/baseResults/spv.debuginfo.glsl.tesc.out

Large diffs are not rendered by default.

312 changes: 157 additions & 155 deletions Test/baseResults/spv.debuginfo.glsl.tese.out

Large diffs are not rendered by default.

828 changes: 415 additions & 413 deletions Test/baseResults/spv.debuginfo.glsl.vert.out

Large diffs are not rendered by default.

1,827 changes: 901 additions & 926 deletions Test/baseResults/spv.debuginfo.hlsl.comp.out

Large diffs are not rendered by default.

1,883 changes: 936 additions & 947 deletions Test/baseResults/spv.debuginfo.hlsl.frag.out

Large diffs are not rendered by default.

787 changes: 390 additions & 397 deletions Test/baseResults/spv.debuginfo.hlsl.tesc.out

Large diffs are not rendered by default.

600 changes: 301 additions & 299 deletions Test/baseResults/spv.debuginfo.hlsl.tese.out

Large diffs are not rendered by default.

912 changes: 457 additions & 455 deletions Test/baseResults/spv.debuginfo.hlsl.vert.out

Large diffs are not rendered by default.

267 changes: 133 additions & 134 deletions Test/baseResults/spv.debuginfo.scalar_types.glsl.frag.out

Large diffs are not rendered by default.

0 comments on commit 9a35abf

Please sign in to comment.