[PATCH vkd3d 3/3] vkd3d: Pass binding offset info to vkd3d-shader for graphics pipelines.

Conor McCarthy cmccarthy at codeweavers.com
Mon Oct 11 09:07:30 CDT 2021


Signed-off-by: Conor McCarthy <cmccarthy at codeweavers.com>
---
 libs/vkd3d/state.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c
index 123761f2..6b088fff 100644
--- a/libs/vkd3d/state.c
+++ b/libs/vkd3d/state.c
@@ -2388,6 +2388,7 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s
     struct vkd3d_shader_transform_feedback_info xfb_info;
     struct vkd3d_shader_spirv_target_info ps_target_info;
     struct vkd3d_shader_interface_info shader_interface;
+    struct vkd3d_shader_binding_offset_info offset_info;
     struct vkd3d_shader_spirv_target_info *target_info;
     const struct d3d12_root_signature *root_signature;
     struct vkd3d_shader_signature input_signature;
@@ -2397,6 +2398,7 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s
     const struct vkd3d_format *format;
     unsigned int instance_divisor;
     VkVertexInputRate input_rate;
+    const void **chain_next;
     unsigned int i, j;
     size_t rt_count;
     uint32_t mask;
@@ -2627,6 +2629,16 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s
     shader_interface.push_constant_buffer_count = root_signature->root_constant_count;
     shader_interface.combined_samplers = NULL;
     shader_interface.combined_sampler_count = 0;
+    chain_next = &shader_interface.next;
+
+    if (root_signature->binding_offsets)
+    {
+        shader_interface.next = &offset_info;
+        offset_info.type = VKD3D_SHADER_STRUCTURE_TYPE_BINDING_OFFSET_INFO;
+        offset_info.next = NULL;
+        offset_info.binding_offsets = root_signature->binding_offsets;
+        chain_next = &offset_info.next;
+    }
 
     for (i = 0; i < ARRAY_SIZE(shader_stages); ++i)
     {
@@ -2692,11 +2704,11 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s
                 goto fail;
         }
 
-        shader_interface.next = shader_stages[i].stage == xfb_stage ? &xfb_info : NULL;
+        *chain_next = shader_stages[i].stage == xfb_stage ? &xfb_info : NULL;
         if (target_info)
         {
-            target_info->next = shader_interface.next;
-            shader_interface.next = target_info;
+            target_info->next = *chain_next;
+            *chain_next = target_info;
         }
 
         if (FAILED(hr = create_shader_stage(device, &graphics->stages[graphics->stage_count],
-- 
2.32.0




More information about the wine-devel mailing list