From c9b12c71d703b2b8c0b1514647bdffdad942d04c Mon Sep 17 00:00:00 2001 From: Jonathan Marek Date: Sun, 15 Dec 2019 10:42:23 -0500 Subject: [PATCH] turnip: fix emit_textures for compute shaders Signed-off-by: Jonathan Marek Reviewed-by: Eric Anholt Part-of: --- src/freedreno/vulkan/tu_cmd_buffer.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c index a7ff5242dd8..54e353704e5 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.c +++ b/src/freedreno/vulkan/tu_cmd_buffer.c @@ -2727,16 +2727,16 @@ tu6_emit_consts(struct tu_cmd_buffer *cmd, static VkResult tu6_emit_textures(struct tu_cmd_buffer *cmd, + const struct tu_pipeline *pipeline, + struct tu_descriptor_state *descriptors_state, gl_shader_stage type, struct tu_cs_entry *entry, bool *needs_border) { struct tu_device *device = cmd->device; struct tu_cs *draw_state = &cmd->sub_cs; - struct tu_descriptor_state *descriptors_state = - &cmd->descriptors[VK_PIPELINE_BIND_POINT_GRAPHICS]; const struct tu_program_descriptor_linkage *link = - &cmd->state.pipeline->program.link[type]; + &pipeline->program.link[type]; VkResult result; if (link->texture_map.num == 0 && link->sampler_map.num == 0) { @@ -3136,11 +3136,13 @@ tu6_bind_draw_states(struct tu_cmd_buffer *cmd, bool needs_border = false; struct tu_cs_entry vs_tex, fs_tex; - result = tu6_emit_textures(cmd, MESA_SHADER_VERTEX, &vs_tex, &needs_border); + result = tu6_emit_textures(cmd, pipeline, descriptors_state, + MESA_SHADER_VERTEX, &vs_tex, &needs_border); if (result != VK_SUCCESS) return result; - result = tu6_emit_textures(cmd, MESA_SHADER_FRAGMENT, &fs_tex, &needs_border); + result = tu6_emit_textures(cmd, pipeline, descriptors_state, + MESA_SHADER_FRAGMENT, &fs_tex, &needs_border); if (result != VK_SUCCESS) return result; @@ -3477,7 +3479,8 @@ tu_dispatch(struct tu_cmd_buffer *cmd, tu_emit_compute_driver_params(cs, pipeline, info); bool needs_border; - result = tu6_emit_textures(cmd, MESA_SHADER_COMPUTE, &ib, &needs_border); + result = tu6_emit_textures(cmd, pipeline, descriptors_state, + MESA_SHADER_COMPUTE, &ib, &needs_border); if (result != VK_SUCCESS) { cmd->record_result = result; return; -- 2.30.2