nir/gather_info: Handle multi-slot variables in io bitfields
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 27 Oct 2015 03:56:06 +0000 (20:56 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 24 Dec 2015 08:47:20 +0000 (00:47 -0800)
src/glsl/nir/nir_gather_info.c

index c2413e3bbe2dd52fc892adc966e409f03048dd5d..18c8e3649dc6dbbb391d1ff8f7f66757f0f32a62 100644 (file)
@@ -93,16 +93,16 @@ nir_shader_gather_info(nir_shader *shader, nir_function_impl *entrypoint)
 {
    shader->info.inputs_read = 0;
    foreach_list_typed(nir_variable, var, node, &shader->inputs)
-      shader->info.inputs_read |= (1ull << var->data.location);
+      shader->info.inputs_read |= nir_variable_get_io_mask(var, shader->stage);
 
    /* TODO: Some day we may need to add stream support to NIR */
    shader->info.outputs_written = 0;
    foreach_list_typed(nir_variable, var, node, &shader->outputs)
-      shader->info.outputs_written |= (1ull << var->data.location);
+      shader->info.outputs_written |= nir_variable_get_io_mask(var, shader->stage);
 
    shader->info.system_values_read = 0;
    foreach_list_typed(nir_variable, var, node, &shader->system_values)
-      shader->info.system_values_read |= (1ull << var->data.location);
+      shader->info.system_values_read |= nir_variable_get_io_mask(var, shader->stage);
 
    nir_foreach_block(entrypoint, gather_info_block, shader);
 }