[Mesa-dev] [PATCH 1/6] glsl: fix clockARB builtin function

Nicolai Hähnle nhaehnle at gmail.com
Thu Mar 30 07:38:42 UTC 2017


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

The underlying intrinsic is defined to always have a uvec2 return type.
---
 src/compiler/glsl/builtin_functions.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp
index e30509a..683217d 100644
--- a/src/compiler/glsl/builtin_functions.cpp
+++ b/src/compiler/glsl/builtin_functions.cpp
@@ -5940,21 +5940,21 @@ builtin_builder::_shader_clock_intrinsic(builtin_available_predicate avail,
    MAKE_INTRINSIC(type, ir_intrinsic_shader_clock, avail, 0);
    return sig;
 }
 
 ir_function_signature *
 builtin_builder::_shader_clock(builtin_available_predicate avail,
                                const glsl_type *type)
 {
    MAKE_SIG(type, avail, 0);
 
-   ir_variable *retval = body.make_temp(type, "clock_retval");
+   ir_variable *retval = body.make_temp(glsl_type::uvec2_type, "clock_retval");
 
    body.emit(call(shader->symbols->get_function("__intrinsic_shader_clock"),
                   retval, sig->parameters));
 
    if (type == glsl_type::uint64_t_type) {
       body.emit(ret(expr(ir_unop_pack_uint_2x32, retval)));
    } else {
       body.emit(ret(retval));
    }
 
-- 
2.9.3



More information about the mesa-dev mailing list