> Would it be wise to just initialize everything explicitly? For example > this is what _mesa_draw_arrays does: > > memset(&prim, 0, sizeof(prim)); > prim.begin = 1; > prim.end = 1; > prim.mode = mode; > prim.num_instances = numInstances; > prim.base_instance = baseInstance; > prim.draw_id = drawID; > prim.is_indirect = 0; > prim.start = start; > prim.count = count; > > and vbo_exec_Begin has: > > exec->vtx.prim[i].mode = mode; > exec->vtx.prim[i].begin = 1; > exec->vtx.prim[i].end = 0; > exec->vtx.prim[i].indexed = 0; > exec->vtx.prim[i].pad = 0; > exec->vtx.prim[i].start = exec->vtx.vert_count; > exec->vtx.prim[i].count = 0; > exec->vtx.prim[i].num_instances = 1; > exec->vtx.prim[i].base_instance = 0; > exec->vtx.prim[i].is_indirect = 0; > > I do think that your change is all that's strictly needed though. > Sorry about the breakage!
I think you are right, we should initialize all fields explicitly here. I will send out patch for this and also modify commit message as per suggested by Brian. Regards, Neha ________________________________ From: Ilia Mirkin <[email protected]> Sent: Tuesday, January 29, 2019 10:58:01 AM To: Neha Bhende Cc: Brian Paul; ML Mesa-dev Subject: Re: [Mesa-dev] [Review Request (master branch)] st/mesa: Fix topogun-1.06-orc-84k-resize.trace crash Would it be wise to just initialize everything explicitly? For example this is what _mesa_draw_arrays does: memset(&prim, 0, sizeof(prim)); prim.begin = 1; prim.end = 1; prim.mode = mode; prim.num_instances = numInstances; prim.base_instance = baseInstance; prim.draw_id = drawID; prim.is_indirect = 0; prim.start = start; prim.count = count; and vbo_exec_Begin has: exec->vtx.prim[i].mode = mode; exec->vtx.prim[i].begin = 1; exec->vtx.prim[i].end = 0; exec->vtx.prim[i].indexed = 0; exec->vtx.prim[i].pad = 0; exec->vtx.prim[i].start = exec->vtx.vert_count; exec->vtx.prim[i].count = 0; exec->vtx.prim[i].num_instances = 1; exec->vtx.prim[i].base_instance = 0; exec->vtx.prim[i].is_indirect = 0; I do think that your change is all that's strictly needed though. Sorry about the breakage! On Tue, Jan 29, 2019 at 1:31 PM Neha Bhende <[email protected]> wrote: > > This patch fixes regression caused by > bac8534267- st/mesa: allow glDrawElements to work with GL_SELECT feedback > We also need to set instance count while creating new rastpos stage. > > Reviewed-by: Brian Paul <[email protected]> > --- > src/mesa/state_tracker/st_cb_rasterpos.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c > b/src/mesa/state_tracker/st_cb_rasterpos.c > index fecaaf7..cca2fba 100644 > --- a/src/mesa/state_tracker/st_cb_rasterpos.c > +++ b/src/mesa/state_tracker/st_cb_rasterpos.c > @@ -206,6 +206,7 @@ new_draw_rastpos_stage(struct gl_context *ctx, struct > draw_context *draw) > rs->prim.indexed = 0; > rs->prim.begin = 1; > rs->prim.end = 1; > + rs->prim.num_instances = 1; > rs->prim.start = 0; > rs->prim.count = 1; > > -- > 2.7.4 > > _______________________________________________ > mesa-dev mailing list > [email protected] > https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fmesa-dev&data=02%7C01%7Cbhenden%40vmware.com%7Ca611d0289a334ee9273708d6861bb82d%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636843850945848627&sdata=03tQMDRMwfagcQPeALU9Ox2txEb0A8ajAxj2CUgtmIk%3D&reserved=0
_______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
