On Wednesday, March 11, 2015 11:53:40 AM Jordan Justen wrote: > Signed-off-by: Jordan Justen <jordan.l.jus...@intel.com> > --- > src/mesa/drivers/dri/i965/brw_context.h | 2 ++ > src/mesa/drivers/dri/i965/brw_state.h | 1 + > src/mesa/drivers/dri/i965/brw_state_upload.c | 28 > +++++++++++++++++++++++++++- > 3 files changed, 30 insertions(+), 1 deletion(-) > > diff --git a/src/mesa/drivers/dri/i965/brw_context.h > b/src/mesa/drivers/dri/i965/brw_context.h > index e693f50..f15cd7c 100644 > --- a/src/mesa/drivers/dri/i965/brw_context.h > +++ b/src/mesa/drivers/dri/i965/brw_context.h > @@ -151,6 +151,7 @@ struct brw_wm_prog_data; > > enum brw_pipeline { > BRW_RENDER_PIPELINE, > + BRW_COMPUTE_PIPELINE, > > BRW_NUM_PIPELINES > }; > @@ -1395,6 +1396,7 @@ struct brw_context > > int num_atoms[BRW_NUM_PIPELINES]; > const struct brw_tracked_state render_atoms[57]; > + const struct brw_tracked_state compute_atoms[0]; > > /* If (INTEL_DEBUG & DEBUG_BATCH) */ > struct {
I'm uncomfortable with this. My understanding is that zero-length arrays are a GCC extension from the pre-C99 days corresponding to (more or less) a variable-length array...which are usually used at the end of a structure. They indicate that there /is/ array data there, but some arbitrary amount. This is in the middle of a structure, and with no actual data, the pointer just points...at the next (totally unrelated) field? I'd feel a lot more confident if you changed this to compute_atoms[1]. Then it'd be a real array with real storage. num_atoms will be 0 anyway; there shouldn't be any harm in overallocating it. With that change, Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev