mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-02 22:29:16 +01:00
[dxbc] Fix operand modifiers on 64-bit types
This commit is contained in:
parent
7b9644f355
commit
f81395c742
@ -4575,7 +4575,9 @@ namespace dxvk {
|
|||||||
|
|
||||||
switch (value.type.ctype) {
|
switch (value.type.ctype) {
|
||||||
case DxbcScalarType::Float32: value.id = m_module.opFAbs(typeId, value.id); break;
|
case DxbcScalarType::Float32: value.id = m_module.opFAbs(typeId, value.id); break;
|
||||||
|
case DxbcScalarType::Float64: value.id = m_module.opFAbs(typeId, value.id); break;
|
||||||
case DxbcScalarType::Sint32: value.id = m_module.opSAbs(typeId, value.id); break;
|
case DxbcScalarType::Sint32: value.id = m_module.opSAbs(typeId, value.id); break;
|
||||||
|
case DxbcScalarType::Sint64: value.id = m_module.opSAbs(typeId, value.id); break;
|
||||||
default: Logger::warn("DxbcCompiler: Cannot get absolute value for given type");
|
default: Logger::warn("DxbcCompiler: Cannot get absolute value for given type");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4648,15 +4650,22 @@ namespace dxvk {
|
|||||||
DxbcOpModifiers modifiers) {
|
DxbcOpModifiers modifiers) {
|
||||||
const uint32_t typeId = getVectorTypeId(value.type);
|
const uint32_t typeId = getVectorTypeId(value.type);
|
||||||
|
|
||||||
if (value.type.ctype == DxbcScalarType::Float32) {
|
|
||||||
// Saturating only makes sense on floats
|
|
||||||
if (modifiers.saturate) {
|
if (modifiers.saturate) {
|
||||||
const DxbcRegMask mask = DxbcRegMask::firstN(value.type.ccount);
|
DxbcRegMask mask;
|
||||||
const DxbcRegisterValue vec0 = emitBuildConstVecf32(0.0f, 0.0f, 0.0f, 0.0f, mask);
|
DxbcRegisterValue vec0, vec1;
|
||||||
const DxbcRegisterValue vec1 = emitBuildConstVecf32(1.0f, 1.0f, 1.0f, 1.0f, mask);
|
|
||||||
|
|
||||||
value.id = m_module.opNClamp(typeId, value.id, vec0.id, vec1.id);
|
if (value.type.ctype == DxbcScalarType::Float32) {
|
||||||
|
mask = DxbcRegMask::firstN(value.type.ccount);
|
||||||
|
vec0 = emitBuildConstVecf32(0.0f, 0.0f, 0.0f, 0.0f, mask);
|
||||||
|
vec1 = emitBuildConstVecf32(1.0f, 1.0f, 1.0f, 1.0f, mask);
|
||||||
|
} else if (value.type.ctype == DxbcScalarType::Float64) {
|
||||||
|
mask = DxbcRegMask::firstN(value.type.ccount * 2);
|
||||||
|
vec0 = emitBuildConstVecf64(0.0, 0.0, mask);
|
||||||
|
vec1 = emitBuildConstVecf64(1.0, 1.0, mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mask)
|
||||||
|
value.id = m_module.opNClamp(typeId, value.id, vec0.id, vec1.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
|
@ -195,6 +195,10 @@ namespace dxvk {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
operator bool () const {
|
||||||
|
return m_mask != 0;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
uint8_t m_mask = 0;
|
uint8_t m_mask = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user