mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-18 02:52:10 +01:00
[dxvk] Increase UAV slot count to 64 for the graphics pipeline
D3D11 raised this limit from 8 UAVs in the fragment shader to 64 UAVs in all graphics stages combined.
This commit is contained in:
parent
bd71f256e5
commit
17e981f360
@ -2682,8 +2682,8 @@ namespace dxvk {
|
||||
RestoreShaderResources(DxbcProgramType::PixelShader, m_state.ps.shaderResources);
|
||||
RestoreShaderResources(DxbcProgramType::ComputeShader, m_state.cs.shaderResources);
|
||||
|
||||
RestoreUnorderedAccessViews(DxbcProgramType::PixelShader, m_state.ps.unorderedAccessViews, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT);
|
||||
RestoreUnorderedAccessViews(DxbcProgramType::ComputeShader, m_state.cs.unorderedAccessViews, D3D11_1_UAV_SLOT_COUNT);
|
||||
RestoreUnorderedAccessViews(DxbcProgramType::PixelShader, m_state.ps.unorderedAccessViews);
|
||||
RestoreUnorderedAccessViews(DxbcProgramType::ComputeShader, m_state.cs.unorderedAccessViews);
|
||||
}
|
||||
|
||||
|
||||
@ -2722,15 +2722,14 @@ namespace dxvk {
|
||||
|
||||
void D3D11DeviceContext::RestoreUnorderedAccessViews(
|
||||
DxbcProgramType Stage,
|
||||
D3D11UnorderedAccessBindings& Bindings,
|
||||
UINT SlotCount) {
|
||||
D3D11UnorderedAccessBindings& Bindings) {
|
||||
const uint32_t uavSlotId = computeResourceSlotId(
|
||||
Stage, DxbcBindingType::UnorderedAccessView, 0);
|
||||
|
||||
const uint32_t ctrSlotId = computeResourceSlotId(
|
||||
Stage, DxbcBindingType::UavCounter, 0);
|
||||
|
||||
for (uint32_t i = 0; i < SlotCount; i++) {
|
||||
for (uint32_t i = 0; i < Bindings.size(); i++) {
|
||||
BindUnorderedAccessView(
|
||||
uavSlotId + i, ctrSlotId + i,
|
||||
Bindings[i].ptr());
|
||||
|
@ -767,8 +767,7 @@ namespace dxvk {
|
||||
|
||||
void RestoreUnorderedAccessViews(
|
||||
DxbcProgramType Stage,
|
||||
D3D11UnorderedAccessBindings& Bindings,
|
||||
UINT SlotCount);
|
||||
D3D11UnorderedAccessBindings& Bindings);
|
||||
|
||||
DxvkDataSlice AllocUpdateBufferSlice(size_t Size);
|
||||
|
||||
|
@ -6,13 +6,14 @@ namespace dxvk {
|
||||
DxbcProgramType shaderStage,
|
||||
DxbcBindingType bindingType,
|
||||
uint32_t bindingIndex) {
|
||||
// First resource slot index for per-stage resources
|
||||
const uint32_t stageOffset = 132 + 158 * static_cast<uint32_t>(shaderStage);
|
||||
|
||||
if (shaderStage == DxbcProgramType::ComputeShader) {
|
||||
// 0 - 13: Constant buffers
|
||||
// 14 - 29: Samplers
|
||||
// 30 - 157: Shader resources
|
||||
// 158 - 221: Uniform access views
|
||||
const uint32_t stageOffset = 20 + 158 * 5;
|
||||
|
||||
// 158 - 221: Unordered access views
|
||||
switch (bindingType) {
|
||||
case DxbcBindingType::ConstantBuffer: return bindingIndex + stageOffset + 0;
|
||||
case DxbcBindingType::ImageSampler: return bindingIndex + stageOffset + 14;
|
||||
@ -23,15 +24,13 @@ namespace dxvk {
|
||||
}
|
||||
} else {
|
||||
// Global resource slots
|
||||
// 0 - 7: Unordered access views
|
||||
// 8 - 15: UAV counter buffers
|
||||
// 16 - 19: Stream output buffers
|
||||
// 0 - 3: Stream output buffers
|
||||
// 4 - 67: Unordered access views
|
||||
// 68 - 131: UAV counter buffers
|
||||
// Per-stage resource slots:
|
||||
// 0 - 13: Constant buffers
|
||||
// 14 - 29: Samplers
|
||||
// 30 - 157: Shader resources
|
||||
const uint32_t stageOffset = 20 + 158 * static_cast<uint32_t>(shaderStage);
|
||||
|
||||
switch (bindingType) {
|
||||
case DxbcBindingType::UnorderedAccessView:return bindingIndex + 0;
|
||||
case DxbcBindingType::UavCounter: return bindingIndex + 8;
|
||||
|
@ -10,7 +10,7 @@ namespace dxvk {
|
||||
MaxNumVertexBindings = 32,
|
||||
MaxNumOutputStreams = 4,
|
||||
MaxNumViewports = 16,
|
||||
MaxNumResourceSlots = 1096,
|
||||
MaxNumResourceSlots = 1208,
|
||||
MaxNumActiveBindings = 128,
|
||||
MaxNumQueuedCommandBuffers = 8,
|
||||
MaxNumQueryCountPerPool = 128,
|
||||
|
Loading…
x
Reference in New Issue
Block a user