mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +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) {
|
if (modifiers.saturate) {
|
||||||
// Saturating only makes sense on floats
|
DxbcRegMask mask;
|
||||||
if (modifiers.saturate) {
|
DxbcRegisterValue vec0, vec1;
|
||||||
const DxbcRegMask mask = DxbcRegMask::firstN(value.type.ccount);
|
|
||||||
const DxbcRegisterValue vec0 = emitBuildConstVecf32(0.0f, 0.0f, 0.0f, 0.0f, mask);
|
if (value.type.ctype == DxbcScalarType::Float32) {
|
||||||
const DxbcRegisterValue vec1 = emitBuildConstVecf32(1.0f, 1.0f, 1.0f, 1.0f, mask);
|
mask = DxbcRegMask::firstN(value.type.ccount);
|
||||||
|
vec0 = emitBuildConstVecf32(0.0f, 0.0f, 0.0f, 0.0f, mask);
|
||||||
value.id = m_module.opNClamp(typeId, value.id, vec0.id, vec1.id);
|
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;
|
||||||
|
@ -194,6 +194,10 @@ namespace dxvk {
|
|||||||
out += (m_mask & 0x8) ? "w" : "";
|
out += (m_mask & 0x8) ? "w" : "";
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
operator bool () const {
|
||||||
|
return m_mask != 0;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user