From 2fdd17d259f2b6abb9a76df9be70c3a467e3fb65 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg=20Kristensen?= Date: Fri, 12 Jun 2015 17:17:01 -0700 Subject: [PATCH] vk: Generate CS prog_data into the pipeline instance We were generating the prog_data into a local variable and never initializing the pipeline->cs_prog_data one. --- src/vulkan/compiler.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/vulkan/compiler.cpp b/src/vulkan/compiler.cpp index 0db7935f085..2a193e396e6 100644 --- a/src/vulkan/compiler.cpp +++ b/src/vulkan/compiler.cpp @@ -614,12 +614,13 @@ brw_codegen_cs_prog(struct brw_context *brw, const GLuint *program; void *mem_ctx = ralloc_context(NULL); GLuint program_size; - struct brw_cs_prog_data prog_data; + struct brw_cs_prog_data *prog_data = &pipeline->cs_prog_data; struct gl_shader *cs = prog->_LinkedShaders[MESA_SHADER_COMPUTE]; assert (cs); - memset(&prog_data, 0, sizeof(prog_data)); + memset(prog_data, 0, sizeof(*prog_data)); + /* Allocate the references to the uniforms that will end up in the * prog_data associated with the compiled program, and which will be freed @@ -629,13 +630,13 @@ brw_codegen_cs_prog(struct brw_context *brw, /* The backend also sometimes adds params for texture size. */ param_count += 2 * ctx->Const.Program[MESA_SHADER_COMPUTE].MaxTextureImageUnits; - prog_data.base.param = + prog_data->base.param = rzalloc_array(NULL, const gl_constant_value *, param_count); - prog_data.base.pull_param = + prog_data->base.pull_param = rzalloc_array(NULL, const gl_constant_value *, param_count); - prog_data.base.nr_params = param_count; + prog_data->base.nr_params = param_count; - program = brw_cs_emit(brw, mem_ctx, key, &prog_data, + program = brw_cs_emit(brw, mem_ctx, key, prog_data, &cp->program, prog, &program_size); if (program == NULL) { ralloc_free(mem_ctx); -- 2.30.2