Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>
* uses lower precision. The function parameters don't matter.
*/
if (var && var->type->without_array()->is_sampler()) {
+ /* textureSize always returns highp. */
+ if (!strcmp(ir->callee_name(), "textureSize"))
+ return false;
+
return var->data.precision == GLSL_PRECISION_MEDIUM ||
var->data.precision == GLSL_PRECISION_LOW;
}
}
""",
r'\(expression +f16vec4 +dFdy +\(expression +f16vec4'),
+ Test("textureSize",
+ """
+ #version 310 es
+ precision mediump float;
+ precision mediump int;
+
+ uniform mediump sampler2D tex;
+ out ivec2 color;
+
+ void main()
+ {
+ color = textureSize(tex, 0) * ivec2(2);
+ }
+ """,
+ r'expression ivec2 \* \(txs ivec2 \(var_ref tex'),
]