|
|
@@ -9104,9 +9104,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
|
|
|
auto &arg_type = expression_type(ops[2]);
|
|
|
auto func = type_to_glsl_constructor(type);
|
|
|
|
|
|
- // If we're sign-extending or zero-extending, we need to make sure we cast from the correct type.
|
|
|
- // For truncation, it does not matter, so don't emit useless casts.
|
|
|
- if (arg_type.width < type.width)
|
|
|
+ if (arg_type.width < type.width || type_is_floating_point(type))
|
|
|
emit_unary_func_op_cast(result_type, id, ops[2], func.c_str(), input_type, type.basetype);
|
|
|
else
|
|
|
emit_unary_func_op(result_type, id, ops[2], func.c_str());
|
|
|
@@ -12119,7 +12117,12 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block)
|
|
|
|
|
|
SPIRBlock::ContinueBlockType continue_type = SPIRBlock::ContinueNone;
|
|
|
if (block.continue_block)
|
|
|
+ {
|
|
|
continue_type = continue_block_type(get<SPIRBlock>(block.continue_block));
|
|
|
+ // If we know we cannot emit a loop, mark the block early as a complex loop so we don't force unnecessary recompiles.
|
|
|
+ if (continue_type == SPIRBlock::ComplexLoop)
|
|
|
+ block.complex_continue = true;
|
|
|
+ }
|
|
|
|
|
|
// If we have loop variables, stop masking out access to the variable now.
|
|
|
for (auto var_id : block.loop_variables)
|