Some older drivers don't support GLSL versions with the concept of flat
varyings and also don't support integers. Here we add a new setting to
make sure we don't use the optimisation that sets varyings to flat.
This setting helps us avoid marking varyings as flat and therefore
potentially having them changed to ints via varying packing.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6500
Fixes:
7647023f3bb5 ("glsl: enable the use of the nir based varying linker")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16573>
*/
bool force_indirect_unrolling_sampler;
+ /* Some older drivers don't support GLSL versions with the concept of flat
+ * varyings and also don't support integers. This setting helps us avoid
+ * marking varyings as flat and potentially having them changed to ints via
+ * varying packing.
+ */
+ bool no_integers;
+
/**
* Specifies which type of indirectly accessed variables should force
* loop unrolling.
/* The varying is loaded from same uniform, so no need to do any
* interpolation. Mark it as flat explicitly.
*/
- if (in_var && in_var->data.interpolation <= INTERP_MODE_NOPERSPECTIVE) {
+ if (!consumer->options->no_integers &&
+ in_var && in_var->data.interpolation <= INTERP_MODE_NOPERSPECTIVE) {
in_var->data.interpolation = INTERP_MODE_FLAT;
out_var->data.interpolation = INTERP_MODE_FLAT;
}
.force_indirect_unrolling = nir_var_all,
.force_indirect_unrolling_sampler = true,
.max_unroll_iterations = 32,
+ .no_integers = true,
};
static const struct nir_shader_compiler_options gallivm_nir_options = {
.lower_vector_cmp = true,
.force_indirect_unrolling_sampler = true,
.max_unroll_iterations = 32,
+ .no_integers = true,
.use_interpolated_input_intrinsics = true,
};
.max_unroll_iterations = 32,
.use_interpolated_input_intrinsics = true,
+ .no_integers = true,
};
static const nir_shader_compiler_options r500_fs_compiler_options = {
.max_unroll_iterations = 32,
.use_interpolated_input_intrinsics = true,
+ .no_integers = true,
};
static const nir_shader_compiler_options r300_vs_compiler_options = {
.max_unroll_iterations = 32,
.use_interpolated_input_intrinsics = true,
+ .no_integers = true,
};
static const nir_shader_compiler_options r300_fs_compiler_options = {
.max_unroll_iterations = 64,
.use_interpolated_input_intrinsics = true,
+ .no_integers = true,
};
static const void *