Remove deprecated interfaces from instrument passes (#3361)
diff --git a/include/spirv-tools/instrument.hpp b/include/spirv-tools/instrument.hpp
index d3180e4..ef5136a 100644
--- a/include/spirv-tools/instrument.hpp
+++ b/include/spirv-tools/instrument.hpp
@@ -35,10 +35,6 @@
// generated by InstrumentPass::GenDebugStreamWrite. This method is utilized
// by InstBindlessCheckPass.
//
-// kInst2* values support version 2 of the output record format and were used
-// for the transition to this format. These values have now been transferred
-// to the original kInst* values. The kInst2* values are therefore DEPRECATED.
-//
// The first member of the debug output buffer contains the next available word
// in the data stream to be written. Shaders will atomically read and update
// this value so as not to overwrite each others records. This value must be
@@ -94,10 +90,6 @@
static const int kInstCompOutGlobalInvocationIdY = kInstCommonOutCnt + 1;
static const int kInstCompOutGlobalInvocationIdZ = kInstCommonOutCnt + 2;
-// Compute Shader Output Record Offsets - Version 1 (DEPRECATED)
-static const int kInstCompOutGlobalInvocationId = kInstCommonOutCnt;
-static const int kInstCompOutUnused = kInstCommonOutCnt + 1;
-
// Tessellation Control Shader Output Record Offsets
static const int kInstTessCtlOutInvocationId = kInstCommonOutCnt;
static const int kInstTessCtlOutPrimitiveId = kInstCommonOutCnt + 1;
@@ -108,10 +100,6 @@
static const int kInstTessEvalOutTessCoordU = kInstCommonOutCnt + 1;
static const int kInstTessEvalOutTessCoordV = kInstCommonOutCnt + 2;
-// Tessellation Shader Output Record Offsets - Version 1 (DEPRECATED)
-static const int kInstTessOutInvocationId = kInstCommonOutCnt;
-static const int kInstTessOutUnused = kInstCommonOutCnt + 1;
-
// Geometry Shader Output Record Offsets
static const int kInstGeomOutPrimitiveId = kInstCommonOutCnt;
static const int kInstGeomOutInvocationId = kInstCommonOutCnt + 1;
@@ -124,14 +112,12 @@
// Size of Common and Stage-specific Members
static const int kInstStageOutCnt = kInstCommonOutCnt + 3;
-static const int kInst2StageOutCnt = kInstCommonOutCnt + 3;
// Validation Error Code Offset
//
// This identifies the validation error. It also helps to identify
// how many words follow in the record and their meaning.
static const int kInstValidationOutError = kInstStageOutCnt;
-static const int kInst2ValidationOutError = kInst2StageOutCnt;
// Validation-specific Output Record Offsets
//
@@ -144,37 +130,19 @@
static const int kInstBindlessBoundsOutDescBound = kInstStageOutCnt + 2;
static const int kInstBindlessBoundsOutCnt = kInstStageOutCnt + 3;
-static const int kInst2BindlessBoundsOutDescIndex = kInst2StageOutCnt + 1;
-static const int kInst2BindlessBoundsOutDescBound = kInst2StageOutCnt + 2;
-static const int kInst2BindlessBoundsOutCnt = kInst2StageOutCnt + 3;
-
// A bindless uninitialized error will output the index.
static const int kInstBindlessUninitOutDescIndex = kInstStageOutCnt + 1;
static const int kInstBindlessUninitOutUnused = kInstStageOutCnt + 2;
static const int kInstBindlessUninitOutCnt = kInstStageOutCnt + 3;
-static const int kInst2BindlessUninitOutDescIndex = kInst2StageOutCnt + 1;
-static const int kInst2BindlessUninitOutUnused = kInst2StageOutCnt + 2;
-static const int kInst2BindlessUninitOutCnt = kInst2StageOutCnt + 3;
-
// A buffer address unalloc error will output the 64-bit pointer in
// two 32-bit pieces, lower bits first.
static const int kInstBuffAddrUnallocOutDescPtrLo = kInstStageOutCnt + 1;
static const int kInstBuffAddrUnallocOutDescPtrHi = kInstStageOutCnt + 2;
static const int kInstBuffAddrUnallocOutCnt = kInstStageOutCnt + 3;
-static const int kInst2BuffAddrUnallocOutDescPtrLo = kInst2StageOutCnt + 1;
-static const int kInst2BuffAddrUnallocOutDescPtrHi = kInst2StageOutCnt + 2;
-static const int kInst2BuffAddrUnallocOutCnt = kInst2StageOutCnt + 3;
-
-// DEPRECATED
-static const int kInstBindlessOutDescIndex = kInstStageOutCnt + 1;
-static const int kInstBindlessOutDescBound = kInstStageOutCnt + 2;
-static const int kInstBindlessOutCnt = kInstStageOutCnt + 3;
-
// Maximum Output Record Member Count
static const int kInstMaxOutCnt = kInstStageOutCnt + 3;
-static const int kInst2MaxOutCnt = kInst2StageOutCnt + 3;
// Validation Error Codes
//
@@ -223,9 +191,6 @@
// Data[ i + Data[ b + Data[ s + Data[ kDebugInputBindlessInitOffset ] ] ] ]
static const int kDebugInputBindlessInitOffset = 0;
-// DEPRECATED
-static const int kDebugInputBindlessOffsetReserved = 0;
-
// At offset kDebugInputBindlessOffsetLengths is some number of uints which
// provide the bindless length data. More specifically, the number of
// descriptors at (set=s, binding=b) is:
diff --git a/include/spirv-tools/optimizer.hpp b/include/spirv-tools/optimizer.hpp
index b904923..d393495 100644
--- a/include/spirv-tools/optimizer.hpp
+++ b/include/spirv-tools/optimizer.hpp
@@ -762,10 +762,9 @@
// |input_length_enable| controls instrumentation of runtime descriptor array
// references, and |input_init_enable| controls instrumentation of descriptor
// initialization checking, both of which require input buffer support.
-// |version| specifies the buffer record format.
Optimizer::PassToken CreateInstBindlessCheckPass(
uint32_t desc_set, uint32_t shader_id, bool input_length_enable = false,
- bool input_init_enable = false, uint32_t version = 2);
+ bool input_init_enable = false);
// Create a pass to instrument physical buffer address checking
// This pass instruments all physical buffer address references to check that
@@ -786,10 +785,8 @@
// The instrumentation will read and write buffers in debug
// descriptor set |desc_set|. It will write |shader_id| in each output record
// to identify the shader module which generated the record.
-// |version| specifies the output buffer record format.
Optimizer::PassToken CreateInstBuffAddrCheckPass(uint32_t desc_set,
- uint32_t shader_id,
- uint32_t version = 2);
+ uint32_t shader_id);
// Create a pass to instrument OpDebugPrintf instructions.
// This pass replaces all OpDebugPrintf instructions with instructions to write
diff --git a/source/opt/inst_bindless_check_pass.h b/source/opt/inst_bindless_check_pass.h
index 447871b..9335fa5 100644
--- a/source/opt/inst_bindless_check_pass.h
+++ b/source/opt/inst_bindless_check_pass.h
@@ -28,13 +28,6 @@
// external design may change as the layer evolves.
class InstBindlessCheckPass : public InstrumentPass {
public:
- // Deprecated interface
- InstBindlessCheckPass(uint32_t desc_set, uint32_t shader_id,
- bool input_length_enable, bool input_init_enable,
- uint32_t version)
- : InstrumentPass(desc_set, shader_id, kInstValidationIdBindless, version),
- input_length_enabled_(input_length_enable),
- input_init_enabled_(input_init_enable) {}
// Preferred Interface
InstBindlessCheckPass(uint32_t desc_set, uint32_t shader_id,
bool input_length_enable, bool input_init_enable)
diff --git a/source/opt/inst_buff_addr_check_pass.h b/source/opt/inst_buff_addr_check_pass.h
index 67ffcc3..ec7bb68 100644
--- a/source/opt/inst_buff_addr_check_pass.h
+++ b/source/opt/inst_buff_addr_check_pass.h
@@ -28,10 +28,6 @@
// external design of this class may change as the layer evolves.
class InstBuffAddrCheckPass : public InstrumentPass {
public:
- // Deprecated interface
- InstBuffAddrCheckPass(uint32_t desc_set, uint32_t shader_id, uint32_t version)
- : InstrumentPass(desc_set, shader_id, kInstValidationIdBuffAddr,
- version) {}
// Preferred interface
InstBuffAddrCheckPass(uint32_t desc_set, uint32_t shader_id)
: InstrumentPass(desc_set, shader_id, kInstValidationIdBuffAddr) {}
diff --git a/source/opt/inst_debug_printf_pass.h b/source/opt/inst_debug_printf_pass.h
index 2968a20..70b0a72 100644
--- a/source/opt/inst_debug_printf_pass.h
+++ b/source/opt/inst_debug_printf_pass.h
@@ -28,11 +28,10 @@
class InstDebugPrintfPass : public InstrumentPass {
public:
// For test harness only
- InstDebugPrintfPass()
- : InstrumentPass(7, 23, kInstValidationIdDebugPrintf, 2) {}
+ InstDebugPrintfPass() : InstrumentPass(7, 23, kInstValidationIdDebugPrintf) {}
// For all other interfaces
InstDebugPrintfPass(uint32_t desc_set, uint32_t shader_id)
- : InstrumentPass(desc_set, shader_id, kInstValidationIdDebugPrintf, 2) {}
+ : InstrumentPass(desc_set, shader_id, kInstValidationIdDebugPrintf) {}
~InstDebugPrintfPass() override = default;
diff --git a/source/opt/instrument_pass.cpp b/source/opt/instrument_pass.cpp
index c8c6c21..4210ad5 100644
--- a/source/opt/instrument_pass.cpp
+++ b/source/opt/instrument_pass.cpp
@@ -885,14 +885,6 @@
}
bool InstrumentPass::InstProcessEntryPointCallTree(InstProcessFunction& pfn) {
- // Check that format version 2 requested
- if (version_ != 2u) {
- if (consumer()) {
- std::string message = "Unsupported instrumentation format requested";
- consumer()(SPV_MSG_ERROR, 0, {0, 0, 0}, message.c_str());
- }
- return false;
- }
// Make sure all entry points have the same execution model. Do not
// instrument if they do not.
// TODO(greg-lunarg): Handle mixed stages. Technically, a shader module
diff --git a/source/opt/instrument_pass.h b/source/opt/instrument_pass.h
index 11afdce..f6884d2 100644
--- a/source/opt/instrument_pass.h
+++ b/source/opt/instrument_pass.h
@@ -87,18 +87,7 @@
: Pass(),
desc_set_(desc_set),
shader_id_(shader_id),
- validation_id_(validation_id),
- version_(2u) {}
- // Create instrumentation pass for |validation_id| which utilizes descriptor
- // set |desc_set| for debug input and output buffers and writes |shader_id|
- // into debug output records with format |version|. Deprecated.
- InstrumentPass(uint32_t desc_set, uint32_t shader_id, uint32_t validation_id,
- uint32_t version)
- : Pass(),
- desc_set_(desc_set),
- shader_id_(shader_id),
- validation_id_(validation_id),
- version_(version) {}
+ validation_id_(validation_id) {}
// Initialize state for instrumentation of module.
void InitializeInstrument();
@@ -425,9 +414,6 @@
// id for void type
uint32_t void_id_;
- // Record format version
- uint32_t version_;
-
// boolean to remember storage buffer extension
bool storage_buffer_ext_defined_;
diff --git a/source/opt/optimizer.cpp b/source/opt/optimizer.cpp
index cdea031..25adee9 100644
--- a/source/opt/optimizer.cpp
+++ b/source/opt/optimizer.cpp
@@ -416,19 +416,19 @@
} else if (pass_name == "replace-invalid-opcode") {
RegisterPass(CreateReplaceInvalidOpcodePass());
} else if (pass_name == "inst-bindless-check") {
- RegisterPass(CreateInstBindlessCheckPass(7, 23, false, false, 2));
+ RegisterPass(CreateInstBindlessCheckPass(7, 23, false, false));
RegisterPass(CreateSimplificationPass());
RegisterPass(CreateDeadBranchElimPass());
RegisterPass(CreateBlockMergePass());
RegisterPass(CreateAggressiveDCEPass());
} else if (pass_name == "inst-desc-idx-check") {
- RegisterPass(CreateInstBindlessCheckPass(7, 23, true, true, 2));
+ RegisterPass(CreateInstBindlessCheckPass(7, 23, true, true));
RegisterPass(CreateSimplificationPass());
RegisterPass(CreateDeadBranchElimPass());
RegisterPass(CreateBlockMergePass());
RegisterPass(CreateAggressiveDCEPass());
} else if (pass_name == "inst-buff-addr-check") {
- RegisterPass(CreateInstBuffAddrCheckPass(7, 23, 2));
+ RegisterPass(CreateInstBuffAddrCheckPass(7, 23));
RegisterPass(CreateAggressiveDCEPass());
} else if (pass_name == "convert-relaxed-to-half") {
RegisterPass(CreateConvertRelaxedToHalfPass());
@@ -894,12 +894,10 @@
Optimizer::PassToken CreateInstBindlessCheckPass(uint32_t desc_set,
uint32_t shader_id,
bool input_length_enable,
- bool input_init_enable,
- uint32_t version) {
+ bool input_init_enable) {
return MakeUnique<Optimizer::PassToken::Impl>(
- MakeUnique<opt::InstBindlessCheckPass>(desc_set, shader_id,
- input_length_enable,
- input_init_enable, version));
+ MakeUnique<opt::InstBindlessCheckPass>(
+ desc_set, shader_id, input_length_enable, input_init_enable));
}
Optimizer::PassToken CreateInstDebugPrintfPass(uint32_t desc_set,
@@ -909,10 +907,9 @@
}
Optimizer::PassToken CreateInstBuffAddrCheckPass(uint32_t desc_set,
- uint32_t shader_id,
- uint32_t version) {
+ uint32_t shader_id) {
return MakeUnique<Optimizer::PassToken::Impl>(
- MakeUnique<opt::InstBuffAddrCheckPass>(desc_set, shader_id, version));
+ MakeUnique<opt::InstBuffAddrCheckPass>(desc_set, shader_id));
}
Optimizer::PassToken CreateConvertRelaxedToHalfPass() {