Handle FPRoundingMode decoration.

Doesn't do anything, but we can parse it correctly for now.
This commit is contained in:
Hans-Kristian Arntzen 2019-01-07 10:51:44 +01:00
parent 169607cd28
commit 6e5df7a7dd
2 changed files with 11 additions and 0 deletions

View File

@ -1336,6 +1336,7 @@ struct Meta
uint32_t input_attachment = 0; uint32_t input_attachment = 0;
uint32_t spec_id = 0; uint32_t spec_id = 0;
uint32_t index = 0; uint32_t index = 0;
spv::FPRoundingMode fp_rounding_mode = spv::FPRoundingModeMax;
bool builtin = false; bool builtin = false;
}; };

View File

@ -184,6 +184,10 @@ void ParsedIR::set_decoration(uint32_t id, Decoration decoration, uint32_t argum
meta[argument].hlsl_is_magic_counter_buffer = true; meta[argument].hlsl_is_magic_counter_buffer = true;
break; break;
case DecorationFPRoundingMode:
dec.fp_rounding_mode = static_cast<FPRoundingMode>(argument);
break;
default: default:
break; break;
} }
@ -329,6 +333,8 @@ uint32_t ParsedIR::get_decoration(uint32_t id, Decoration decoration) const
return dec.matrix_stride; return dec.matrix_stride;
case DecorationIndex: case DecorationIndex:
return dec.index; return dec.index;
case DecorationFPRoundingMode:
return dec.fp_rounding_mode;
default: default:
return 1; return 1;
} }
@ -394,6 +400,10 @@ void ParsedIR::unset_decoration(uint32_t id, Decoration decoration)
dec.hlsl_semantic.clear(); dec.hlsl_semantic.clear();
break; break;
case DecorationFPRoundingMode:
dec.fp_rounding_mode = FPRoundingModeMax;
break;
case DecorationHlslCounterBufferGOOGLE: case DecorationHlslCounterBufferGOOGLE:
{ {
auto &counter = meta[id].hlsl_magic_counter_buffer; auto &counter = meta[id].hlsl_magic_counter_buffer;