vk/compiler: Handle interpolation qualifiers for SPIR-V shaders
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 1 Sep 2015 22:15:04 +0000 (15:15 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 1 Sep 2015 22:15:04 +0000 (15:15 -0700)
src/vulkan/anv_compiler.cpp

index e024bf0a0eb577a9e1f71e1d6268bfcf95f54700..1f961eb043b19de394d1cf2238ffe05c2745a543 100644 (file)
@@ -946,6 +946,16 @@ setup_nir_io(struct gl_shader *mesa_shader,
    struct gl_program *prog = mesa_shader->Program;
    foreach_list_typed(nir_variable, var, node, &shader->inputs) {
       prog->InputsRead |= BITFIELD64_BIT(var->data.location);
+      if (shader->stage == MESA_SHADER_FRAGMENT) {
+         struct gl_fragment_program *fprog = (struct gl_fragment_program *)prog;
+
+         fprog->InterpQualifier[var->data.location] =
+            (glsl_interp_qualifier)var->data.interpolation;
+         if (var->data.centroid)
+            fprog->IsCentroid |= BITFIELD64_BIT(var->data.location);
+         if (var->data.sample)
+            fprog->IsSample |= BITFIELD64_BIT(var->data.location);
+      }
    }
 
    foreach_list_typed(nir_variable, var, node, &shader->outputs) {