Commit d39ff902 authored by Joshua Ashton's avatar Joshua Ashton 🐸

[dxso] Perform saturate after bitshift modifier

parent 3ff9c4cc
Pipeline #975 passed with stage
in 4 minutes and 11 seconds
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment