aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ir.cpp
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2020-04-20 12:06:15 -0500
committerMarge Bot <[email protected]>2020-04-21 06:16:13 +0000
commit4386c06770508d86eaa51839871767887f903d1a (patch)
treec6ff2d3cbdf559e3942b106e3d9a871ac6e2c031 /src/compiler/glsl/ir.cpp
parent95f555a93a8891ebba2a291eecd984eb2364d636 (diff)
glsl: Hard-code noise to zero in builtin_functions.cpp
Version 4.4 of the GLSL spec changed the definition of noise*() to always return zero and earlier versions of the spec allowed zero as a valid implementation. All drivers, as far as I can tell, unconditionally call lower_noise() today which turns ir_unop_noise into zero. We've got a 10-year-old comment in there saying "In the future, ir_unop_noise may be replaced by a call to a function that implements noise." Well, it's the future now and we've not yet gotten around to that. In the mean time, the GLSL spec has made doing so illegal. To make things worse, we then pretend to handle the opcode in glsl_to_nir, ir_to_mesa, and st_glsl_to_tgsi even though it should never get there given the lowering. The lowering in st_glsl_to_tgsi defines noise*() to be 0.5 which is an illegal implementation of the noise functions according to pre-4.4 specs. We also have opcodes for this in NIR which are never used because, again, we always call lower_noise(). Let's just kill the whole opcode and make builtin_builder.cpp build a bunch of functions that just return zero. Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4624>
Diffstat (limited to 'src/compiler/glsl/ir.cpp')
-rw-r--r--src/compiler/glsl/ir.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/compiler/glsl/ir.cpp b/src/compiler/glsl/ir.cpp
index 4d4bc0fb957..922dcd3c819 100644
--- a/src/compiler/glsl/ir.cpp
+++ b/src/compiler/glsl/ir.cpp
@@ -345,9 +345,6 @@ ir_expression::ir_expression(int op, ir_rvalue *op0)
this->type = glsl_type::get_instance(GLSL_TYPE_UINT64,
op0->type->vector_elements, 1);
break;
- case ir_unop_noise:
- this->type = glsl_type::float_type;
- break;
case ir_unop_unpack_double_2x32:
case ir_unop_unpack_uint_2x32: