1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-14 00:48:44 +01:00

[hud] Pass new shader binding info struct to HUD shaders

This commit is contained in:
Philip Rebohle 2022-06-15 17:07:22 +02:00
parent 89dadc8453
commit 7b8b50bca6
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -159,6 +159,15 @@ namespace dxvk::hud {
SpirvCodeBuffer vsCode(hud_text_vert);
SpirvCodeBuffer fsCode(hud_text_frag);
const std::array<DxvkBindingInfo, 2> 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<DxvkBindingInfo, 1> fsBindings = {{
{ VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 2, VK_IMAGE_VIEW_TYPE_MAX_ENUM, 0, VK_ACCESS_SHADER_READ_BIT },
}};
const std::array<DxvkResourceSlot, 2> 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<DxvkBindingInfo, 1> fsBindings = {{
{ VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 0, VK_IMAGE_VIEW_TYPE_MAX_ENUM, 0, VK_ACCESS_SHADER_READ_BIT },
}};
const std::array<DxvkResourceSlot, 1> 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;