.lower_extract_byte = true,
.lower_extract_word = true,
.lower_ffma = true,
+ .vs_inputs_dual_locations = true,
.max_unroll_iterations = 32
};
} /* end of anonymous namespace */
static void
-nir_remap_attributes(nir_shader *shader)
+nir_remap_attributes(nir_shader *shader,
+ const nir_shader_compiler_options *options)
{
- nir_foreach_variable(var, &shader->inputs) {
- var->data.location += _mesa_bitcount_64(shader->info.vs.double_inputs &
- BITFIELD64_MASK(var->data.location));
+ if (options->vs_inputs_dual_locations) {
+ nir_foreach_variable(var, &shader->inputs) {
+ var->data.location +=
+ _mesa_bitcount_64(shader->info.vs.double_inputs &
+ BITFIELD64_MASK(var->data.location));
+ }
}
/* Once the remap is done, reset double_inputs_read, so later it will have
* location 0 and vec4 attr1 in location 1, in NIR attr0 will use
* locations/slots 0 and 1, and attr1 will use location/slot 2 */
if (shader->info.stage == MESA_SHADER_VERTEX)
- nir_remap_attributes(shader);
+ nir_remap_attributes(shader, options);
shader->info.name = ralloc_asprintf(shader, "GLSL%d", shader_prog->Name);
if (shader_prog->Label)
*/
bool use_interpolated_input_intrinsics;
+ /**
+ * Do vertex shader double inputs use two locations? The Vulkan spec
+ * requires two locations to be used, OpenGL allows a single location.
+ */
+ bool vs_inputs_dual_locations;
+
unsigned max_unroll_iterations;
} nir_shader_compiler_options;
.lower_unpack_snorm_4x8 = true,
.lower_unpack_unorm_2x16 = true,
.lower_unpack_unorm_4x8 = true,
+ .vs_inputs_dual_locations = true,
.max_unroll_iterations = 32,
};
.lower_unpack_unorm_2x16 = true,
.lower_extract_byte = true,
.lower_extract_word = true,
+ .vs_inputs_dual_locations = true,
.max_unroll_iterations = 32,
};
.lower_unpack_unorm_2x16 = true,
.lower_extract_byte = true,
.lower_extract_word = true,
+ .vs_inputs_dual_locations = true,
.max_unroll_iterations = 32,
};