Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion external/SPIRV-Tools
Submodule SPIRV-Tools updated 113 files
5 changes: 4 additions & 1 deletion tools/clang/lib/SPIRV/SpirvEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8031,7 +8031,10 @@ SpirvInstruction *SpirvEmitter::createVectorSplat(const Expr *scalarExpr,
// Should find a more meaningful one.
if (auto *constVal = dyn_cast<SpirvConstant>(scalarVal)) {
llvm::SmallVector<SpirvConstant *, 4> elements(size_t(size), constVal);
const bool isSpecConst = constVal->getopcode() == spv::Op::OpSpecConstant;
const bool isSpecConst =
constVal->getopcode() == spv::Op::OpSpecConstant ||
constVal->getopcode() == spv::Op::OpSpecConstantFalse ||
constVal->getopcode() == spv::Op::OpSpecConstantTrue;
auto *value =
spvBuilder.getConstantComposite(vecType, elements, isSpecConst);
if (!value)
Expand Down
4 changes: 3 additions & 1 deletion tools/clang/test/CodeGenSPIRV/vk.spec-constant.reuse.hlsl
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// RUN: %dxc -T ps_6_0 -HV 2018 -E main -fcgl %s -spirv | FileCheck %s

// CHECK: OpDecorate %y SpecId 0
// CHECK: %y = OpSpecConstantFalse %bool
[[vk::constant_id(0)]] const bool y = false;


[shader("pixel")]
float4 main(float4 position : SV_Position) : SV_Target0 {
// CHECK: OpConstantComposite %v4bool %y %y %y %y
// CHECK: OpSpecConstantComposite %v4bool %y %y %y %y
return y ? position : 1.0;
}
Loading