Use initializer list for composite initializations if backend.use_initializer_list is on.

This commit is contained in:
Bill Hollings 2018-01-12 17:19:24 -05:00
Родитель bcaa1f0e3c
Коммит ba1e415a9c
2 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -5485,6 +5485,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
{ {
// Only use this path if we are building composites. // Only use this path if we are building composites.
// This path cannot be used for arithmetic. // This path cannot be used for arithmetic.
constructor_op += type_to_glsl_constructor(get<SPIRType>(result_type));
constructor_op += "{ "; constructor_op += "{ ";
if (splat) if (splat)
constructor_op += to_expression(elems[0]); constructor_op += to_expression(elems[0]);

Просмотреть файл

@ -68,6 +68,7 @@ string CompilerMSL::compile()
backend.discard_literal = "discard_fragment()"; backend.discard_literal = "discard_fragment()";
backend.swizzle_is_function = false; backend.swizzle_is_function = false;
backend.shared_is_implied = false; backend.shared_is_implied = false;
backend.use_initializer_list = true;
backend.native_row_major_matrix = false; backend.native_row_major_matrix = false;
backend.flexible_member_array_supported = false; backend.flexible_member_array_supported = false;
backend.force_temp_use_for_two_vector_shuffles = true; backend.force_temp_use_for_two_vector_shuffles = true;