From 6e5df7a7dd5cedb628bb5930a3668dfc595ae328 Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Mon, 7 Jan 2019 10:51:44 +0100 Subject: [PATCH] Handle FPRoundingMode decoration. Doesn't do anything, but we can parse it correctly for now. --- spirv_common.hpp | 1 + spirv_cross_parsed_ir.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/spirv_common.hpp b/spirv_common.hpp index 78a8d80d..0ac97999 100644 --- a/spirv_common.hpp +++ b/spirv_common.hpp @@ -1336,6 +1336,7 @@ struct Meta uint32_t input_attachment = 0; uint32_t spec_id = 0; uint32_t index = 0; + spv::FPRoundingMode fp_rounding_mode = spv::FPRoundingModeMax; bool builtin = false; }; diff --git a/spirv_cross_parsed_ir.cpp b/spirv_cross_parsed_ir.cpp index 102c7495..a1804233 100644 --- a/spirv_cross_parsed_ir.cpp +++ b/spirv_cross_parsed_ir.cpp @@ -184,6 +184,10 @@ void ParsedIR::set_decoration(uint32_t id, Decoration decoration, uint32_t argum meta[argument].hlsl_is_magic_counter_buffer = true; break; + case DecorationFPRoundingMode: + dec.fp_rounding_mode = static_cast(argument); + break; + default: break; } @@ -329,6 +333,8 @@ uint32_t ParsedIR::get_decoration(uint32_t id, Decoration decoration) const return dec.matrix_stride; case DecorationIndex: return dec.index; + case DecorationFPRoundingMode: + return dec.fp_rounding_mode; default: return 1; } @@ -394,6 +400,10 @@ void ParsedIR::unset_decoration(uint32_t id, Decoration decoration) dec.hlsl_semantic.clear(); break; + case DecorationFPRoundingMode: + dec.fp_rounding_mode = FPRoundingModeMax; + break; + case DecorationHlslCounterBufferGOOGLE: { auto &counter = meta[id].hlsl_magic_counter_buffer;