From 7b8b50bca6b8ee8ac1f9bd82aa3cbe9551ff66f2 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Wed, 15 Jun 2022 17:07:22 +0200 Subject: [PATCH] [hud] Pass new shader binding info struct to HUD shaders --- src/dxvk/hud/dxvk_hud_renderer.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/dxvk/hud/dxvk_hud_renderer.cpp b/src/dxvk/hud/dxvk_hud_renderer.cpp index 1bd8ca15..167cf3c8 100644 --- a/src/dxvk/hud/dxvk_hud_renderer.cpp +++ b/src/dxvk/hud/dxvk_hud_renderer.cpp @@ -159,6 +159,15 @@ namespace dxvk::hud { SpirvCodeBuffer vsCode(hud_text_vert); SpirvCodeBuffer fsCode(hud_text_frag); + const std::array vsBindings = {{ + { VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 0, VK_IMAGE_VIEW_TYPE_MAX_ENUM, 0, VK_ACCESS_SHADER_READ_BIT }, + { VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, 1, VK_IMAGE_VIEW_TYPE_MAX_ENUM, 0, VK_ACCESS_SHADER_READ_BIT }, + }}; + + const std::array fsBindings = {{ + { VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 2, VK_IMAGE_VIEW_TYPE_MAX_ENUM, 0, VK_ACCESS_SHADER_READ_BIT }, + }}; + const std::array vsResources = {{ { 0, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, VK_IMAGE_VIEW_TYPE_MAX_ENUM }, { 1, VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, VK_IMAGE_VIEW_TYPE_MAX_ENUM }, @@ -170,6 +179,8 @@ namespace dxvk::hud { DxvkShaderCreateInfo vsInfo; vsInfo.stage = VK_SHADER_STAGE_VERTEX_BIT; + vsInfo.bindingCount = vsBindings.size(); + vsInfo.bindings = vsBindings.data(); vsInfo.resourceSlotCount = vsResources.size(); vsInfo.resourceSlots = vsResources.data(); vsInfo.outputMask = 0x3; @@ -178,6 +189,8 @@ namespace dxvk::hud { DxvkShaderCreateInfo fsInfo; fsInfo.stage = VK_SHADER_STAGE_FRAGMENT_BIT; + fsInfo.bindingCount = fsBindings.size(); + fsInfo.bindings = fsBindings.data(); fsInfo.resourceSlotCount = fsResources.size(); fsInfo.resourceSlots = fsResources.data(); fsInfo.inputMask = 0x3; @@ -194,6 +207,10 @@ namespace dxvk::hud { SpirvCodeBuffer vsCode(hud_graph_vert); SpirvCodeBuffer fsCode(hud_graph_frag); + const std::array fsBindings = {{ + { VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 0, VK_IMAGE_VIEW_TYPE_MAX_ENUM, 0, VK_ACCESS_SHADER_READ_BIT }, + }}; + const std::array fsResources = {{ { 0, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, VK_IMAGE_VIEW_TYPE_MAX_ENUM }, }}; @@ -206,6 +223,8 @@ namespace dxvk::hud { DxvkShaderCreateInfo fsInfo; fsInfo.stage = VK_SHADER_STAGE_FRAGMENT_BIT; + fsInfo.bindingCount = fsBindings.size(); + fsInfo.bindings = fsBindings.data(); fsInfo.resourceSlotCount = fsResources.size(); fsInfo.resourceSlots = fsResources.data(); fsInfo.inputMask = 0x1;