[d3d9] Pass new binding info struct to various helper shaders

This commit is contained in:
Philip Rebohle 2022-06-21 11:05:09 +02:00
parent 7b8b50bca6
commit 5edd8e92a8
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 16 additions and 0 deletions

View File

@ -125,6 +125,11 @@ namespace dxvk {
Rc<DxvkShader> D3D9FormatHelper::InitShader(SpirvCodeBuffer code) {
const std::array<DxvkBindingInfo, 2> 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<DxvkResourceSlot, 2> 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;

View File

@ -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<uint32_t> m_entryPointInterfaces;
uint32_t m_entryPointId = 0;
uint32_t m_inputMask = 0u;
DxvkBindingInfo m_bufferBinding;
DxvkResourceSlot m_bufferResource;
};