From: Connor Abbott Date: Thu, 9 Jul 2015 01:48:57 +0000 (-0400) Subject: vk/compiler: create the right kind of program struct X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=997831868fea1f56223b5fbf59526d0b538527c0;p=mesa.git vk/compiler: create the right kind of program struct This fixes Valgrind errors and gets all the tests to pass with --use-spir-v. --- diff --git a/src/vulkan/compiler.cpp b/src/vulkan/compiler.cpp index 0a8ec87415f..216da89c697 100644 --- a/src/vulkan/compiler.cpp +++ b/src/vulkan/compiler.cpp @@ -981,7 +981,21 @@ anv_compile_shader_spirv(struct anv_compiler *compiler, fail_if(mesa_shader == NULL, "failed to create %s shader\n", stage_info[stage].name); - mesa_shader->Program = rzalloc(mesa_shader, struct gl_program); + switch (stage) { + case VK_SHADER_STAGE_VERTEX: + mesa_shader->Program = &rzalloc(mesa_shader, struct brw_vertex_program)->program.Base; + break; + case VK_SHADER_STAGE_GEOMETRY: + mesa_shader->Program = &rzalloc(mesa_shader, struct brw_geometry_program)->program.Base; + break; + case VK_SHADER_STAGE_FRAGMENT: + mesa_shader->Program = &rzalloc(mesa_shader, struct brw_fragment_program)->program.Base; + break; + case VK_SHADER_STAGE_COMPUTE: + mesa_shader->Program = &rzalloc(mesa_shader, struct brw_compute_program)->program.Base; + break; + } + mesa_shader->Type = stage_info[stage].token; mesa_shader->Stage = stage_info[stage].stage;