diff options
author | Ehsan Nasiri <ehsann@google.com> | 2017-02-01 15:37:39 -0500 |
---|---|---|
committer | David Neto <dneto@google.com> | 2017-04-07 09:49:48 -0400 |
commit | 23af06c3a308a4e388412809788add9a8510fe80 (patch) | |
tree | ca004030c530fe8226d7e4b70ebb10e5bb549bce /source/val | |
parent | 4895ace29b8b091fa9a19364afd3e1c0f096aa3c (diff) | |
download | spirv-tools-23af06c3a308a4e388412809788add9a8510fe80.tar.gz |
Validator support for Variable Pointer extension.
If the variable_pointer extension is used:
* OpLoad's pointer argument may be the result of any of the following:
* OpSelect
* OpPhi
* OpFunctionCall
* OpPtrAccessChain
* OpCopyObject
* OpLoad
* OpConstantNull
* Return value of a function may be a pointer.
* It is valid to use a pointer as the return value of a function.
* OpStore should allow a variable pointer argument.
Diffstat (limited to 'source/val')
-rw-r--r-- | source/val/validation_state.cpp | 8 | ||||
-rw-r--r-- | source/val/validation_state.h | 6 |
2 files changed, 14 insertions, 0 deletions
diff --git a/source/val/validation_state.cpp b/source/val/validation_state.cpp index 12e864d3..86e2d980 100644 --- a/source/val/validation_state.cpp +++ b/source/val/validation_state.cpp @@ -300,6 +300,14 @@ void ValidationState_t::RegisterCapability(SpvCapability cap) { features_.declare_int16_type = true; features_.declare_float16_type = true; features_.free_fp_rounding_mode = true; + break; + case SpvCapabilityVariablePointers: + features_.variable_pointers = true; + features_.variable_pointers_uniform_buffer_block = true; + break; + case SpvCapabilityVariablePointersUniformBufferBlock: + features_.variable_pointers_uniform_buffer_block = true; + break; default: break; } diff --git a/source/val/validation_state.h b/source/val/validation_state.h index a61fbabb..d130c0ff 100644 --- a/source/val/validation_state.h +++ b/source/val/validation_state.h @@ -62,6 +62,12 @@ class ValidationState_t { bool free_fp_rounding_mode = false; // Allow the FPRoundingMode decoration // and its vaules to be used without // requiring any capability + + // Allow functionalities enabled by VariablePointers capability. + bool variable_pointers = false; + // Allow functionalities enabled by VariablePointersUniformBufferBlock + // capability. + bool variable_pointers_uniform_buffer_block = false; }; ValidationState_t(const spv_const_context context, |