Skip to content

Commit 63b3728

Browse files
authored
opt: remove useless code (KhronosGroup#6281)
The grammar links the Geometry capability to the entrypoint operand, meaning the code I previously added is useless. Cleaning this up (tests are still there)
1 parent a51e062 commit 63b3728

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

source/opt/trim_capabilities_pass.cpp

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ namespace opt {
3838

3939
namespace {
4040
constexpr uint32_t kOpTypeFloatSizeIndex = 0;
41-
constexpr uint32_t kOpEntryPointExecutionModelIndex = 0;
4241
constexpr uint32_t kOpTypePointerStorageClassIndex = 0;
4342
constexpr uint32_t kTypeArrayTypeIndex = 0;
4443
constexpr uint32_t kOpTypeScalarBitWidthIndex = 0;
@@ -169,30 +168,6 @@ static std::optional<spv::Capability> Handler_OpTypeFloat_Float64(
169168
return size == 64 ? std::optional(spv::Capability::Float64) : std::nullopt;
170169
}
171170

172-
static std::optional<spv::Capability> Handler_OpEntryPoint_Geometry(
173-
const Instruction* instruction) {
174-
assert(instruction->opcode() == spv::Op::OpEntryPoint &&
175-
"This handler only support OpEntryPoint opcodes.");
176-
177-
auto execution_model = spv::ExecutionModel(
178-
instruction->GetSingleWordInOperand(kOpEntryPointExecutionModelIndex));
179-
return execution_model == spv::ExecutionModel::Geometry
180-
? std::optional(spv::Capability::Geometry)
181-
: std::nullopt;
182-
}
183-
184-
static std::optional<spv::Capability>
185-
Handler_OpConditionalEntryPointINTEL_Geometry(const Instruction* instruction) {
186-
assert(instruction->opcode() == spv::Op::OpConditionalEntryPointINTEL &&
187-
"This handler only support OpConditionalEntryPointINTEL opcodes.");
188-
189-
auto execution_model =
190-
spv::ExecutionModel(instruction->GetSingleWordInOperand(1));
191-
return execution_model == spv::ExecutionModel::Geometry
192-
? std::optional(spv::Capability::Geometry)
193-
: std::nullopt;
194-
}
195-
196171
static std::optional<spv::Capability>
197172
Handler_OpTypePointer_StorageInputOutput16(const Instruction* instruction) {
198173
assert(instruction->opcode() == spv::Op::OpTypePointer &&
@@ -466,8 +441,6 @@ constexpr std::array<std::pair<spv::Op, OpcodeHandler>, 16> kOpcodeHandlers{{
466441
{spv::Op::OpTypePointer, Handler_OpTypePointer_StorageUniform16},
467442
{spv::Op::OpTypePointer, Handler_OpTypePointer_StorageUniformBufferBlock16},
468443
{spv::Op::OpTypePointer, Handler_OpTypePointer_StorageBuffer16BitAccess},
469-
{spv::Op::OpEntryPoint, Handler_OpEntryPoint_Geometry },
470-
{spv::Op::OpConditionalEntryPointINTEL, Handler_OpConditionalEntryPointINTEL_Geometry },
471444
// clang-format on
472445
}};
473446

0 commit comments

Comments
 (0)