mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
st/mesa: fix size miss match for some check
While we shrink some variable from "GLuint" to "ubyte", need to update the check from "x != ~0U" to "x != 0xff" too. This fixes the crash for SPECviewperf 13 benchmark medical case. Fixes:d947e3e2c8"st/mesa: decrease the size of st_vertex_program" Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Qiang Yu <yuq825@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11757> (cherry picked from commitcf66ccf3f0)
This commit is contained in:
parent
c870f84dc0
commit
36a10bcf10
4 changed files with 10 additions and 10 deletions
|
|
@ -1741,7 +1741,7 @@
|
|||
"description": "st/mesa: fix size miss match for some check",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "d947e3e2c8c23dd9622c6af20d2fb887a43475f5"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ feedback_vertex(struct gl_context *ctx, const struct draw_context *draw,
|
|||
struct st_vertex_program *stvp = (struct st_vertex_program *)st->vp;
|
||||
GLfloat win[4];
|
||||
const GLfloat *color, *texcoord;
|
||||
GLuint slot;
|
||||
ubyte slot;
|
||||
|
||||
win[0] = v->data[0][0];
|
||||
if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP)
|
||||
|
|
@ -103,13 +103,13 @@ feedback_vertex(struct gl_context *ctx, const struct draw_context *draw,
|
|||
*/
|
||||
|
||||
slot = stvp->result_to_output[VARYING_SLOT_COL0];
|
||||
if (slot != ~0U)
|
||||
if (slot != 0xff)
|
||||
color = v->data[slot];
|
||||
else
|
||||
color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
|
||||
|
||||
slot = stvp->result_to_output[VARYING_SLOT_TEX0];
|
||||
if (slot != ~0U)
|
||||
if (slot != 0xff)
|
||||
texcoord = v->data[slot];
|
||||
else
|
||||
texcoord = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
|
||||
|
|
|
|||
|
|
@ -121,8 +121,8 @@ update_attrib(struct gl_context *ctx, const ubyte *outputMapping,
|
|||
GLuint result, GLuint defaultAttrib)
|
||||
{
|
||||
const GLfloat *src;
|
||||
const GLuint k = outputMapping[result];
|
||||
if (k != ~0U)
|
||||
const ubyte k = outputMapping[result];
|
||||
if (k != 0xff)
|
||||
src = vert->data[k];
|
||||
else
|
||||
src = ctx->Current.Attrib[defaultAttrib];
|
||||
|
|
|
|||
|
|
@ -5981,9 +5981,9 @@ dst_register(struct st_translate *t, gl_register_file file, unsigned index,
|
|||
find_inout_array(t->output_decls,
|
||||
t->num_output_decls, array_id);
|
||||
unsigned mesa_index = decl->mesa_index;
|
||||
int slot = t->outputMapping[mesa_index];
|
||||
ubyte slot = t->outputMapping[mesa_index];
|
||||
|
||||
assert(slot != -1 && t->outputs[slot].File == TGSI_FILE_OUTPUT);
|
||||
assert(slot != 0xff && t->outputs[slot].File == TGSI_FILE_OUTPUT);
|
||||
|
||||
struct ureg_dst dst = t->outputs[slot];
|
||||
dst.ArrayID = array_id;
|
||||
|
|
@ -6116,9 +6116,9 @@ translate_src(struct st_translate *t, const st_src_reg *src_reg)
|
|||
t->num_input_decls,
|
||||
src_reg->array_id);
|
||||
unsigned mesa_index = decl->mesa_index;
|
||||
int slot = t->inputMapping[mesa_index];
|
||||
ubyte slot = t->inputMapping[mesa_index];
|
||||
|
||||
assert(slot != -1 && t->inputs[slot].File == TGSI_FILE_INPUT);
|
||||
assert(slot != 0xff && t->inputs[slot].File == TGSI_FILE_INPUT);
|
||||
|
||||
src = t->inputs[slot];
|
||||
src.ArrayID = src_reg->array_id;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue