mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[dxbc] Correctly report a size of 0 for unbound buffers
This commit is contained in:
parent
ad5da34c57
commit
18cbaefdcb
@ -2626,7 +2626,6 @@ namespace dxvk {
|
|||||||
// bufinfo takes two arguments
|
// bufinfo takes two arguments
|
||||||
// (dst0) The destination register
|
// (dst0) The destination register
|
||||||
// (src0) The buffer register to query
|
// (src0) The buffer register to query
|
||||||
// TODO Check if resource is bound
|
|
||||||
const DxbcBufferInfo bufferInfo = getBufferInfo(ins.src[0]);
|
const DxbcBufferInfo bufferInfo = getBufferInfo(ins.src[0]);
|
||||||
|
|
||||||
bool isSsbo = m_moduleInfo.options.useRawSsbo
|
bool isSsbo = m_moduleInfo.options.useRawSsbo
|
||||||
@ -2649,7 +2648,7 @@ namespace dxvk {
|
|||||||
result.id = m_module.opUDiv(typeId, result.id,
|
result.id = m_module.opUDiv(typeId, result.id,
|
||||||
m_module.constu32(bufferInfo.stride / 4));
|
m_module.constu32(bufferInfo.stride / 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store the result. The scalar will be extended to a
|
// Store the result. The scalar will be extended to a
|
||||||
// vector if the write mask consists of more than one
|
// vector if the write mask consists of more than one
|
||||||
// component, which is the desired behaviour.
|
// component, which is the desired behaviour.
|
||||||
@ -4988,6 +4987,10 @@ namespace dxvk {
|
|||||||
result.id = m_module.opArrayLength(
|
result.id = m_module.opArrayLength(
|
||||||
getVectorTypeId(result.type),
|
getVectorTypeId(result.type),
|
||||||
bufferInfo.varId, 0);
|
bufferInfo.varId, 0);
|
||||||
|
|
||||||
|
// Report a size of 0 if resource is not bound
|
||||||
|
result.id = m_module.opSelect(getVectorTypeId(result.type),
|
||||||
|
bufferInfo.specId, result.id, m_module.constu32(0));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5007,6 +5010,10 @@ namespace dxvk {
|
|||||||
result.type.ccount = 1;
|
result.type.ccount = 1;
|
||||||
result.id = m_module.opImageQuerySize(
|
result.id = m_module.opImageQuerySize(
|
||||||
getVectorTypeId(result.type), bufferId);
|
getVectorTypeId(result.type), bufferId);
|
||||||
|
|
||||||
|
// Report a size of 0 if resource is not bound
|
||||||
|
result.id = m_module.opSelect(getVectorTypeId(result.type),
|
||||||
|
bufferInfo.specId, result.id, m_module.constu32(0));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user