break;
case nir_op_fabs:
- ureg_MOV(c->ureg, dst, ureg_abs(src[0]));
+ if (c->options->lower_fabs)
+ ureg_MAX(c->ureg, dst, src[0], ureg_negate(src[0]));
+ else
+ ureg_MOV(c->ureg, dst, ureg_abs(src[0]));
break;
case nir_op_fsat:
/* Only lower 32-bit floats. The only other modifier type officially
* supported by TGSI is 32-bit integer negates, but even those are broken on
* virglrenderer, so skip lowering all integer and f64 float mods.
+ *
+ * The options->lower_fabs requests that we not have native source modifiers
+ * for fabs, and instead emit MAX(a,-a) for nir_op_fabs.
*/
- NIR_PASS_V(s, nir_lower_to_source_mods, nir_lower_float_source_mods);
+ nir_lower_to_source_mods_flags source_mods = nir_lower_fneg_source_mods;
+ if (!options->lower_fabs)
+ source_mods |= nir_lower_fabs_source_mods;
+ NIR_PASS_V(s, nir_lower_to_source_mods, source_mods);
+
NIR_PASS_V(s, nir_convert_from_ssa, true);
NIR_PASS_V(s, nir_lower_vec_to_movs, NULL, NULL);
dEQP-GLES2.functional.shaders.loops.for_constant_iterations.mixed_break_continue_fragment,Fail
dEQP-GLES2.functional.shaders.random.all_features.fragment.22,Fail
-dEQP-GLES2.functional.shaders.random.all_features.fragment.32,Fail
-dEQP-GLES2.functional.shaders.random.all_features.fragment.34,Fail
dEQP-GLES2.functional.shaders.random.all_features.fragment.38,Fail
dEQP-GLES2.functional.shaders.random.all_features.fragment.5,Fail
dEQP-GLES2.functional.shaders.random.all_features.fragment.79,Fail
-dEQP-GLES2.functional.shaders.random.all_features.fragment.80,Fail
dEQP-GLES2.functional.shaders.random.all_features.fragment.86,Fail
-dEQP-GLES2.functional.shaders.random.all_features.fragment.89,Fail
dEQP-GLES2.functional.shaders.random.all_features.fragment.93,Fail
dEQP-GLES2.functional.shaders.random.all_features.fragment.97,Fail
dEQP-GLES2.functional.shaders.random.trigonometric.fragment.15,Fail
dEQP-GLES2.functional.shaders.random.trigonometric.fragment.26,Fail
-dEQP-GLES2.functional.shaders.random.trigonometric.fragment.4,Fail
dEQP-GLES2.functional.shaders.random.trigonometric.fragment.42,Fail
dEQP-GLES2.functional.shaders.random.trigonometric.fragment.45,Fail
dEQP-GLES2.functional.shaders.random.trigonometric.fragment.52,Fail
dEQP-GLES2.functional.uniform_api.random.54,Fail
dEQP-GLES2.functional.uniform_api.random.71,Fail
dEQP-GLES2.functional.uniform_api.random.74,Fail
-dEQP-GLES2.functional.uniform_api.random.80,Fail
dEQP-GLES2.functional.uniform_api.random.81,Fail
dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.array_in_struct.mat4_mat2_both,Fail
dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.array_in_struct.mat4_mat2_fragment,Fail
-dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.array_in_struct.sampler2D_samplerCube_fragment,Fail
dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.basic_array.mat4_both,Fail
dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.basic_array.mat4_fragment,Fail
dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.multiple_nested_structs_arrays.both,Fail
dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.nested_structs_arrays.mat4_mat2_fragment,Fail
dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.struct_in_array.mat4_mat2_both,Fail
dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.struct_in_array.mat4_mat2_fragment,Fail
-dEQP-GLES2.functional.uniform_api.value.assigned.by_value.render.array_in_struct.sampler2D_samplerCube_fragment,Fail
dEQP-GLES2.functional.uniform_api.value.assigned.by_value.render.multiple_nested_structs_arrays.both,Fail
dEQP-GLES2.functional.uniform_api.value.assigned.by_value.render.multiple_nested_structs_arrays.fragment,Fail
dEQP-GLES2.functional.uniform_api.value.initial.render.array_in_struct.mat4_mat2_both,Fail
dEQP-GLES2.functional.uniform_api.value.initial.render.array_in_struct.mat4_mat2_fragment,Fail
-dEQP-GLES2.functional.uniform_api.value.initial.render.basic_array.mat4_both,Fail
-dEQP-GLES2.functional.uniform_api.value.initial.render.basic_array.mat4_fragment,Fail
dEQP-GLES2.functional.uniform_api.value.initial.render.multiple_nested_structs_arrays.both,Fail
dEQP-GLES2.functional.uniform_api.value.initial.render.multiple_nested_structs_arrays.fragment,Fail
dEQP-GLES2.functional.uniform_api.value.initial.render.nested_structs_arrays.mat4_mat2_fragment,Fail
spec@glsl-1.10@execution@samplers@glsl-fs-shadow2d-clamp-z,Fail
spec@glsl-1.10@execution@samplers@glsl-fs-shadow2dproj,Fail
spec@glsl-1.10@execution@samplers@glsl-fs-shadow2dproj-bias,Fail
-spec@glsl-1.10@execution@samplers@glsl-fs-texture2d-dependent-5,Fail
+
spec@glsl-1.10@execution@temp-array-indexing@glsl-fs-vec4-indexing-temp-dst-in-loop,Fail
spec@glsl-1.10@execution@temp-array-indexing@glsl-fs-vec4-indexing-temp-dst-in-nested-loop-combined,Fail
spec@glsl-1.10@execution@temp-array-indexing@glsl-fs-vec4-indexing-temp-src-in-loop,Fail
if (vs->state.type == PIPE_SHADER_IR_NIR) {
static const struct nir_to_tgsi_options swtcl_options = {0};
- static const struct nir_to_tgsi_options hwtcl_options = {
+ static const struct nir_to_tgsi_options hwtcl_r300_options = {
.lower_cmp = true,
+ .lower_fabs = true,
};
+ static const struct nir_to_tgsi_options hwtcl_r500_options = {
+ .lower_cmp = true,
+ };
+ const struct nir_to_tgsi_options *ntt_options;
+ if (r300->screen->caps.has_tcl) {
+ if (r300->screen->caps.is_r500)
+ ntt_options = &hwtcl_r500_options;
+ else
+ ntt_options = &hwtcl_r300_options;
+ } else {
+ ntt_options = &swtcl_options;
+ }
vs->state.tokens = nir_to_tgsi_options(shader->ir.nir, pipe->screen,
- r300->screen->caps.has_tcl ?
- &hwtcl_options : &swtcl_options);
+ ntt_options);
} else {
assert(vs->state.type == PIPE_SHADER_IR_TGSI);
/* we need to keep a local copy of the tokens */