mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-11 10:24:10 +01:00
[dxbc] Remove old constant buffer range check
This commit is contained in:
parent
fd547b666e
commit
c4e5323e0e
@ -5570,32 +5570,6 @@ namespace dxvk {
|
|||||||
scount, scomps.data());
|
scount, scomps.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
// HACK: If requested, use the constant buffer size to perform a range
|
|
||||||
// check. This does NOT match the API behaviour, but is needed for some
|
|
||||||
// games since out-of-bounds access is undefined behaviour.
|
|
||||||
if (m_moduleInfo.options.constantBufferRangeCheck && reg.idx[1].relReg) {
|
|
||||||
uint32_t zero = m_module.constf32(0.0f);
|
|
||||||
uint32_t cond = m_module.opULessThan(
|
|
||||||
m_module.defBoolType(), constId.id,
|
|
||||||
m_module.consti32(m_constantBuffers[regId].size));
|
|
||||||
|
|
||||||
if (scount > 1) {
|
|
||||||
std::array<uint32_t, 4> zeroes = {{ zero, zero, zero, zero }};
|
|
||||||
std::array<uint32_t, 4> conds = {{ cond, cond, cond, cond }};
|
|
||||||
|
|
||||||
zero = m_module.opCompositeConstruct(
|
|
||||||
getVectorTypeId(result.type),
|
|
||||||
scount, zeroes.data());
|
|
||||||
cond = m_module.opCompositeConstruct(
|
|
||||||
m_module.defVectorType(m_module.defBoolType(), scount),
|
|
||||||
scount, conds.data());
|
|
||||||
}
|
|
||||||
|
|
||||||
result.id = m_module.opSelect(
|
|
||||||
getVectorTypeId(result.type), cond,
|
|
||||||
result.id, zero);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply any post-processing that might be necessary
|
// Apply any post-processing that might be necessary
|
||||||
result = emitRegisterBitcast(result, reg.dataType);
|
result = emitRegisterBitcast(result, reg.dataType);
|
||||||
result = emitSrcOperandModifiers(result, reg.modifiers);
|
result = emitSrcOperandModifiers(result, reg.modifiers);
|
||||||
|
@ -35,10 +35,6 @@ namespace dxvk {
|
|||||||
/// Enables sm4-compliant division-by-zero behaviour
|
/// Enables sm4-compliant division-by-zero behaviour
|
||||||
bool strictDivision = false;
|
bool strictDivision = false;
|
||||||
|
|
||||||
// Enables range checking for constant buffers.
|
|
||||||
// Fixes issues in some games, breaks others.
|
|
||||||
bool constantBufferRangeCheck = false;
|
|
||||||
|
|
||||||
/// Implement dynamically indexed uniform buffers
|
/// Implement dynamically indexed uniform buffers
|
||||||
/// with storage buffers for tight bounds checking
|
/// with storage buffers for tight bounds checking
|
||||||
bool dynamicIndexedConstantBufferAsSsbo = false;
|
bool dynamicIndexedConstantBufferAsSsbo = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user