aboutsummaryrefslogtreecommitdiff
path: root/source/val
diff options
context:
space:
mode:
authorLei Zhang <antiagainst@google.com>2017-03-01 15:51:44 -0500
committerDavid Neto <dneto@google.com>2017-03-01 18:25:28 -0500
commit40be4bdd34a0fce1dfcc97f571704e7980d09a36 (patch)
tree632ac7bcdbb56ee69f6bf14f95e81c5d415219b3 /source/val
parent94d94e1f4afc57d2ef7f0062205323ce5263afd9 (diff)
downloadspirv-tools-40be4bdd34a0fce1dfcc97f571704e7980d09a36.tar.gz
Allow using FPRoundingMode when see VK_KHR_16bit_storage
According to the extension, FPRoundingMode should be allowed to use without requiring Kernel capability when VK_KHR_16bit_storage is enabled.
Diffstat (limited to 'source/val')
-rw-r--r--source/val/validation_state.cpp1
-rw-r--r--source/val/validation_state.h9
2 files changed, 7 insertions, 3 deletions
diff --git a/source/val/validation_state.cpp b/source/val/validation_state.cpp
index 7a9c5915..db3ceb87 100644
--- a/source/val/validation_state.cpp
+++ b/source/val/validation_state.cpp
@@ -298,6 +298,7 @@ void ValidationState_t::RegisterCapability(SpvCapability cap) {
case SpvCapabilityStorageInputOutput16:
features_.declare_int16_type = true;
features_.declare_float16_type = true;
+ features_.free_fp_rounding_mode = true;
default:
break;
}
diff --git a/source/val/validation_state.h b/source/val/validation_state.h
index 686685ed..30a1b2d6 100644
--- a/source/val/validation_state.h
+++ b/source/val/validation_state.h
@@ -57,8 +57,11 @@ class ValidationState_t {
public:
// Features that can optionally be turned on by a capability.
struct Feature {
- bool declare_int16_type = false; // Allow OpTypeInt with 16 bit width?
- bool declare_float16_type = false; // Allow OpTypeFloat with 16 bit width?
+ bool declare_int16_type = false; // Allow OpTypeInt with 16 bit width?
+ bool declare_float16_type = false; // Allow OpTypeFloat with 16 bit width?
+ bool free_fp_rounding_mode = false; // Allow the FPRoundingMode decoration
+ // and its vaules to be used without
+ // requiring any capability
};
ValidationState_t(const spv_const_context context,
@@ -202,7 +205,7 @@ class ValidationState_t {
/// Returns the memory model of this module, or Simple if uninitialized.
SpvMemoryModel memory_model() const;
- AssemblyGrammar& grammar() { return grammar_; }
+ const AssemblyGrammar& grammar() const { return grammar_; }
/// Registers the instruction
void RegisterInstruction(const spv_parsed_instruction_t& inst);