st/mesa: allow R8 to not be exposed as renderable by driver
[mesa.git] / src / mesa / main / glspirv.c
index 21a1beb84536dc302217bab943685667ef718168..64daf54ec422bfd0342f6f7550efa6a6b0a3d119 100644 (file)
@@ -148,9 +148,7 @@ _mesa_spirv_link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
 
       /* Create program and attach it to the linked shader */
       struct gl_program *gl_prog =
-         ctx->Driver.NewProgram(ctx,
-                                _mesa_shader_stage_to_program(shader_type),
-                                prog->Name, false);
+         ctx->Driver.NewProgram(ctx, shader_type, prog->Name, false);
       if (!gl_prog) {
          prog->data->LinkStatus = LINKING_FAILURE;
          _mesa_delete_linked_shader(ctx, linked);
@@ -239,13 +237,13 @@ _mesa_spirv_to_nir(struct gl_context *ctx,
 
    for (unsigned i = 0; i < spirv_data->NumSpecializationConstants; ++i) {
       spec_entries[i].id = spirv_data->SpecializationConstantsIndex[i];
-      spec_entries[i].data32 = spirv_data->SpecializationConstantsValue[i];
+      spec_entries[i].value.u32 = spirv_data->SpecializationConstantsValue[i];
       spec_entries[i].defined_on_module = false;
    }
 
    const struct spirv_to_nir_options spirv_options = {
       .environment = NIR_SPIRV_OPENGL,
-      .lower_workgroup_access_to_offsets = true,
+      .frag_coord_is_sysval = ctx->Const.GLSLFragCoordIsSysVal,
       .caps = ctx->Const.SpirVCapabilities,
       .ubo_addr_format = nir_address_format_32bit_index_offset,
       .ssbo_addr_format = nir_address_format_32bit_index_offset,
@@ -284,7 +282,7 @@ _mesa_spirv_to_nir(struct gl_context *ctx,
     * inline functions.  That way they get properly initialized at the top
     * of the function and not at the top of its caller.
     */
-   NIR_PASS_V(nir, nir_lower_constant_initializers, nir_var_function_temp);
+   NIR_PASS_V(nir, nir_lower_variable_initializers, nir_var_function_temp);
    NIR_PASS_V(nir, nir_lower_returns);
    NIR_PASS_V(nir, nir_inline_functions);
    NIR_PASS_V(nir, nir_opt_deref);
@@ -370,7 +368,7 @@ _mesa_SpecializeShaderARB(GLuint shader,
 
    for (unsigned i = 0; i < numSpecializationConstants; ++i) {
       spec_entries[i].id = pConstantIndex[i];
-      spec_entries[i].data32 = pConstantValue[i];
+      spec_entries[i].value.u32 = pConstantValue[i];
       spec_entries[i].defined_on_module = false;
    }