vk/compiler: Pass the correct is_scalar value to brw_process_nir
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 28 Aug 2015 19:13:17 +0000 (12:13 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 28 Aug 2015 19:13:17 +0000 (12:13 -0700)
src/vulkan/anv_compiler.cpp

index c0aed33bd128d8163b146be18476f9b6320c4b08..40cd484685775d3aea99c00e7e5388f17bac51e4 100644 (file)
@@ -966,19 +966,26 @@ anv_compile_shader_spirv(struct anv_compiler *compiler,
    fail_if(mesa_shader == NULL,
            "failed to create %s shader\n", stage_info[stage].name);
 
+   bool is_scalar;
    switch (stage) {
    case VK_SHADER_STAGE_VERTEX:
       mesa_shader->Program = &rzalloc(mesa_shader, struct brw_vertex_program)->program.Base;
+      is_scalar = compiler->screen->compiler->scalar_vs;
       break;
    case VK_SHADER_STAGE_GEOMETRY:
       mesa_shader->Program = &rzalloc(mesa_shader, struct brw_geometry_program)->program.Base;
+      is_scalar = false;
       break;
    case VK_SHADER_STAGE_FRAGMENT:
       mesa_shader->Program = &rzalloc(mesa_shader, struct brw_fragment_program)->program.Base;
+      is_scalar = true;
       break;
    case VK_SHADER_STAGE_COMPUTE:
       mesa_shader->Program = &rzalloc(mesa_shader, struct brw_compute_program)->program.Base;
+      is_scalar = true;
       break;
+   default:
+      unreachable("Unsupported shader stage");
    }
 
    mesa_shader->Program->Parameters =
@@ -999,7 +1006,7 @@ anv_compile_shader_spirv(struct anv_compiler *compiler,
 
    brw_process_nir(mesa_shader->Program->nir,
                    compiler->screen->devinfo,
-                   NULL, mesa_shader->Stage, false);
+                   NULL, mesa_shader->Stage, is_scalar);
 
    setup_nir_io(mesa_shader->Program, mesa_shader->Program->nir);