mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-15 07:29:17 +01:00
[dxbc] Use texel buffers for raw/structured buffers with sparse feedback
This commit is contained in:
parent
336aafcdf7
commit
eaa5d16616
@ -52,10 +52,15 @@ namespace dxvk {
|
|||||||
|
|
||||||
case DxbcInstClass::BufferLoad: {
|
case DxbcInstClass::BufferLoad: {
|
||||||
uint32_t operandId = ins.op == DxbcOpcode::LdStructured ? 2 : 1;
|
uint32_t operandId = ins.op == DxbcOpcode::LdStructured ? 2 : 1;
|
||||||
|
bool sparseFeedback = ins.dstCount == 2;
|
||||||
|
|
||||||
if (ins.src[operandId].type == DxbcOperandType::UnorderedAccessView) {
|
if (ins.src[operandId].type == DxbcOperandType::UnorderedAccessView) {
|
||||||
const uint32_t registerId = ins.src[operandId].idx[0].offset;
|
const uint32_t registerId = ins.src[operandId].idx[0].offset;
|
||||||
m_analysis->uavInfos[registerId].accessFlags |= VK_ACCESS_SHADER_READ_BIT;
|
m_analysis->uavInfos[registerId].accessFlags |= VK_ACCESS_SHADER_READ_BIT;
|
||||||
|
m_analysis->uavInfos[registerId].sparseFeedback |= sparseFeedback;
|
||||||
|
} else if (ins.src[operandId].type == DxbcOperandType::Resource) {
|
||||||
|
const uint32_t registerId = ins.src[operandId].idx[0].offset;
|
||||||
|
m_analysis->srvInfos[registerId].sparseFeedback |= sparseFeedback;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
@ -19,9 +19,20 @@ namespace dxvk {
|
|||||||
struct DxbcUavInfo {
|
struct DxbcUavInfo {
|
||||||
bool accessTypedLoad = false;
|
bool accessTypedLoad = false;
|
||||||
bool accessAtomicOp = false;
|
bool accessAtomicOp = false;
|
||||||
|
bool sparseFeedback = false;
|
||||||
VkAccessFlags accessFlags = 0;
|
VkAccessFlags accessFlags = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Info about shader resource views
|
||||||
|
*
|
||||||
|
* Stores whether an SRV is accessed with
|
||||||
|
* sparse feedback. Useful for buffers.
|
||||||
|
*/
|
||||||
|
struct DxbcSrvInfo {
|
||||||
|
bool sparseFeedback = false;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Counts cull and clip distances
|
* \brief Counts cull and clip distances
|
||||||
*/
|
*/
|
||||||
@ -35,6 +46,7 @@ namespace dxvk {
|
|||||||
*/
|
*/
|
||||||
struct DxbcAnalysisInfo {
|
struct DxbcAnalysisInfo {
|
||||||
std::array<DxbcUavInfo, 64> uavInfos;
|
std::array<DxbcUavInfo, 64> uavInfos;
|
||||||
|
std::array<DxbcSrvInfo, 128> srvInfos;
|
||||||
std::array<DxbcRegMask, 4096> xRegMasks;
|
std::array<DxbcRegMask, 4096> xRegMasks;
|
||||||
|
|
||||||
DxbcClipCullInfo clipCullIn;
|
DxbcClipCullInfo clipCullIn;
|
||||||
|
@ -1096,7 +1096,11 @@ namespace dxvk {
|
|||||||
: computeSrvBinding(m_programInfo.type(), registerId);
|
: computeSrvBinding(m_programInfo.type(), registerId);
|
||||||
|
|
||||||
// Test whether we should use a raw SSBO for this resource
|
// Test whether we should use a raw SSBO for this resource
|
||||||
bool useRawSsbo = m_moduleInfo.options.minSsboAlignment <= resAlign;
|
bool hasSparseFeedback = isUav
|
||||||
|
? m_analysis->uavInfos[registerId].sparseFeedback
|
||||||
|
: m_analysis->srvInfos[registerId].sparseFeedback;
|
||||||
|
|
||||||
|
bool useRawSsbo = m_moduleInfo.options.minSsboAlignment <= resAlign && !hasSparseFeedback;
|
||||||
|
|
||||||
if (useRawSsbo) {
|
if (useRawSsbo) {
|
||||||
uint32_t elemType = getScalarTypeId(DxbcScalarType::Uint32);
|
uint32_t elemType = getScalarTypeId(DxbcScalarType::Uint32);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user