mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-11-29 19:24:10 +01:00
[dxso] Perform saturate after bitshift modifier
This commit is contained in:
parent
3ff9c4cc43
commit
d39ff9020e
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user