Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgreg-lunarg <greg@lunarg.com>2020-12-01 19:28:16 +0300
committerGitHub <noreply@github.com>2020-12-01 19:28:16 +0300
commit7046c05d2fb9478982bc35b989356d51e8b49a1d (patch)
tree0c8636d9f1d18c4642c1ca895224e4ac930e3dae /include
parentcf2d1e7afcdcd892cb5f37b04021b678d2919f7e (diff)
Add texel buffer out-of-bounds checking instrumentation (#4038)
This instruments ImageRead, ImageWrite and ImageFetch when applied to texel buffers. Also add new (but not yet generated) buffer OOB error codes differentiated for VUID classification.
Diffstat (limited to 'include')
-rw-r--r--include/spirv-tools/instrument.hpp4
-rw-r--r--include/spirv-tools/optimizer.hpp14
2 files changed, 13 insertions, 5 deletions
diff --git a/include/spirv-tools/instrument.hpp b/include/spirv-tools/instrument.hpp
index 9c01cb693..2b47a5645 100644
--- a/include/spirv-tools/instrument.hpp
+++ b/include/spirv-tools/instrument.hpp
@@ -171,6 +171,10 @@ static const int kInstErrorBindlessBounds = 0;
static const int kInstErrorBindlessUninit = 1;
static const int kInstErrorBuffAddrUnallocRef = 2;
static const int kInstErrorBindlessBuffOOB = 3;
+static const int kInstErrorBuffOOBUniform = 4;
+static const int kInstErrorBuffOOBStorage = 5;
+static const int kInstErrorBuffOOBUniformTexel = 6;
+static const int kInstErrorBuffOOBStorageTexel = 7;
// Direct Input Buffer Offsets
//
diff --git a/include/spirv-tools/optimizer.hpp b/include/spirv-tools/optimizer.hpp
index f12774d6d..27352b250 100644
--- a/include/spirv-tools/optimizer.hpp
+++ b/include/spirv-tools/optimizer.hpp
@@ -747,12 +747,16 @@ Optimizer::PassToken CreateCombineAccessChainsPass();
// 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.
-// |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.
+// |desc_length_enable| controls instrumentation of runtime descriptor array
+// references, |desc_init_enable| controls instrumentation of descriptor
+// initialization checking, and |buff_oob_enable| controls instrumentation
+// of storage and uniform buffer bounds checking, all of which require input
+// buffer support. |texbuff_oob_enable| controls instrumentation of texel
+// buffers, which does not require input buffer support.
Optimizer::PassToken CreateInstBindlessCheckPass(
- uint32_t desc_set, uint32_t shader_id, bool input_length_enable = false,
- bool input_init_enable = false, bool input_buff_oob_enable = false);
+ uint32_t desc_set, uint32_t shader_id, bool desc_length_enable = false,
+ bool desc_init_enable = false, bool buff_oob_enable = false,
+ bool texbuff_oob_enable = false);
// Create a pass to instrument physical buffer address checking
// This pass instruments all physical buffer address references to check that