mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-28 00:00:47 +02:00
glsl: fix sampler and image type checking in lower_precision
Use the param type, not the referenced variable. The referenced variable
can be a structure, which wouldn't be recognized as a sampler or image.
Fixes: 733bee57eb - glsl: lower samplers with highp coordinates correctly
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Tested-by: Dieter Nützel Dieter@nuetzel-hh.de on gfx8 (Polaris 20)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34959>
This commit is contained in:
parent
0dc5d649ea
commit
bd5d623674
1 changed files with 2 additions and 2 deletions
|
|
@ -423,7 +423,7 @@ handle_call(ir_call *ir, const struct set *lowerable_rvalues)
|
|||
ir_variable *resource = param->variable_referenced();
|
||||
|
||||
assert(ir->callee->return_precision == GLSL_PRECISION_HIGH);
|
||||
assert(glsl_type_is_image(glsl_without_array(resource->type)));
|
||||
assert(glsl_type_is_image(param->type));
|
||||
|
||||
/* GLSL ES 3.20 requires that images have a precision modifier, but if
|
||||
* you set one, it doesn't do anything, because all intrinsics are
|
||||
|
|
@ -466,7 +466,7 @@ handle_call(ir_call *ir, const struct set *lowerable_rvalues)
|
|||
* We should lower the type of the return value if the sampler type
|
||||
* uses lower precision. The function parameters don't matter.
|
||||
*/
|
||||
if (var && glsl_type_is_sampler(glsl_without_array(var->type))) {
|
||||
if (var && glsl_type_is_sampler(param->type)) {
|
||||
/* textureGatherOffsets always takes a highp array of constants. As
|
||||
* per the discussion https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16547#note_1393704
|
||||
* trying to lower the precision results in segfault later on
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue