mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 07:20:10 +01: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> (cherry picked from commitbd5d623674)
This commit is contained in:
parent
4a43d723b5
commit
6692869151
2 changed files with 3 additions and 3 deletions
|
|
@ -34,7 +34,7 @@
|
|||
"description": "glsl: fix sampler and image type checking in lower_precision",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "733bee57eb80c92736f3ef1e1267e68ee6cfade6",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -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