diff --git a/src/dxso/dxso_compiler.h b/src/dxso/dxso_compiler.h index 169b1547d..7698a7be4 100644 --- a/src/dxso/dxso_compiler.h +++ b/src/dxso/dxso_compiler.h @@ -487,14 +487,6 @@ namespace dxvk { if (value.type.ctype == DxsoScalarType::Float32) { const uint32_t typeId = getVectorTypeId(value.type); - // Saturating only makes sense on floats - if (saturate) { - value.id = m_module.opNClamp( - typeId, value.id, - m_module.constfReplicant(0.0f, value.type.ccount), - m_module.constfReplicant(1.0f, value.type.ccount)); - } - // There doesn't seem to be a nice float bitshift method for float vectors // in Spirv that I can see... Resorting to multiplication. if (shift != 0) { @@ -509,6 +501,14 @@ namespace dxvk { else value.id = m_module.opVectorTimesScalar(typeId, value.id, shiftConst); } + + // Saturating only makes sense on floats + if (saturate) { + value.id = m_module.opNClamp( + typeId, value.id, + m_module.constfReplicant(0.0f, value.type.ccount), + m_module.constfReplicant(1.0f, value.type.ccount)); + } } this->emitValueStore(ptr, value, writeMask, predicate);