From 5edd8e92a8effe75e92a550de9f816ab23de9815 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Tue, 21 Jun 2022 11:05:09 +0200 Subject: [PATCH] [d3d9] Pass new binding info struct to various helper shaders --- src/d3d9/d3d9_format_helpers.cpp | 7 +++++++ src/d3d9/d3d9_swvp_emu.cpp | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/src/d3d9/d3d9_format_helpers.cpp b/src/d3d9/d3d9_format_helpers.cpp index 09034bb2..2615aa49 100644 --- a/src/d3d9/d3d9_format_helpers.cpp +++ b/src/d3d9/d3d9_format_helpers.cpp @@ -125,6 +125,11 @@ namespace dxvk { Rc D3D9FormatHelper::InitShader(SpirvCodeBuffer code) { + const std::array bindings = { { + { VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, BindingIds::Image, VK_IMAGE_VIEW_TYPE_2D, 0, VK_ACCESS_SHADER_WRITE_BIT }, + { VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, BindingIds::Buffer, VK_IMAGE_VIEW_TYPE_1D, 0, VK_ACCESS_SHADER_READ_BIT }, + } }; + const std::array resourceSlots = { { { BindingIds::Image, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, VK_IMAGE_VIEW_TYPE_2D }, { BindingIds::Buffer, VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, VK_IMAGE_VIEW_TYPE_1D }, @@ -132,6 +137,8 @@ namespace dxvk { DxvkShaderCreateInfo info; info.stage = VK_SHADER_STAGE_COMPUTE_BIT; + info.bindingCount = bindings.size(); + info.bindings = bindings.data(); info.resourceSlotCount = resourceSlots.size(); info.resourceSlots = resourceSlots.data(); info.pushConstOffset = 0; diff --git a/src/d3d9/d3d9_swvp_emu.cpp b/src/d3d9/d3d9_swvp_emu.cpp index 40a38fdc..226191cb 100644 --- a/src/d3d9/d3d9_swvp_emu.cpp +++ b/src/d3d9/d3d9_swvp_emu.cpp @@ -130,6 +130,12 @@ namespace dxvk { m_module.decorateDescriptorSet(buffer, 0); m_module.decorateBinding(buffer, bufferSlot); + m_bufferBinding.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER; + m_bufferBinding.viewType = VK_IMAGE_VIEW_TYPE_MAX_ENUM; + m_bufferBinding.resourceBinding = bufferSlot; + m_bufferBinding.access = VK_ACCESS_SHADER_WRITE_BIT; + m_bufferBinding.stages = 0; + m_bufferResource.slot = bufferSlot; m_bufferResource.type = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER; m_bufferResource.view = VK_IMAGE_VIEW_TYPE_MAX_ENUM; @@ -283,6 +289,8 @@ namespace dxvk { DxvkShaderCreateInfo info; info.stage = VK_SHADER_STAGE_GEOMETRY_BIT; + info.bindingCount = 1; + info.bindings = &m_bufferBinding; info.resourceSlotCount = 1; info.resourceSlots = &m_bufferResource; info.inputMask = m_inputMask; @@ -297,6 +305,7 @@ namespace dxvk { std::vector m_entryPointInterfaces; uint32_t m_entryPointId = 0; uint32_t m_inputMask = 0u; + DxvkBindingInfo m_bufferBinding; DxvkResourceSlot m_bufferResource; };