mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 05:52:11 +01:00
[d3d11] Track highest bound sampler
This commit is contained in:
parent
6c372e40f6
commit
3dbd9d8659
@ -3788,7 +3788,7 @@ namespace dxvk {
|
||||
result.stages[i].cbvCount = m_state.cbv[stage].maxCount;
|
||||
result.stages[i].srvCount = m_state.srv[stage].maxCount;
|
||||
result.stages[i].uavCount = 0;
|
||||
result.stages[i].samplerCount = D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT;
|
||||
result.stages[i].samplerCount = m_state.samplers[stage].maxCount;
|
||||
result.stages[i].reserved = 0;
|
||||
}
|
||||
|
||||
@ -4125,7 +4125,7 @@ namespace dxvk {
|
||||
const auto& bindings = m_state.samplers[Stage];
|
||||
uint32_t slotId = computeSamplerBinding(Stage, 0);
|
||||
|
||||
for (uint32_t i = 0; i < bindings.samplers.size(); i++)
|
||||
for (uint32_t i = 0; i < bindings.maxCount; i++)
|
||||
BindSampler<Stage>(slotId + i, bindings.samplers[i]);
|
||||
}
|
||||
|
||||
@ -4319,6 +4319,9 @@ namespace dxvk {
|
||||
BindSampler<ShaderStage>(slotId + i, sampler);
|
||||
}
|
||||
}
|
||||
|
||||
bindings.maxCount = std::clamp(StartSlot + NumSamplers,
|
||||
bindings.maxCount, uint32_t(bindings.samplers.size()));
|
||||
}
|
||||
|
||||
|
||||
|
@ -103,9 +103,13 @@ namespace dxvk {
|
||||
struct D3D11ShaderStageSamplerBinding {
|
||||
std::array<D3D11SamplerState*, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT> samplers = { };
|
||||
|
||||
uint32_t maxCount = 0;
|
||||
|
||||
void reset() {
|
||||
for (uint32_t i = 0; i < samplers.size(); i++)
|
||||
for (uint32_t i = 0; i < maxCount; i++)
|
||||
samplers[i] = nullptr;
|
||||
|
||||
maxCount = 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user