[Mesa-dev] [PATCH 1/2] i965: Combine 3DSTATE_STREAMOUT emitters and genX_sol_state atoms.
Kenneth Graunke
kenneth at whitecape.org
Thu Jun 23 00:31:27 UTC 2016
On Wednesday, June 22, 2016 5:21:34 PM PDT Jason Ekstrand wrote:
> On Wed, Jun 22, 2016 at 4:26 PM, Kenneth Graunke <kenneth at whitecape.org>
> wrote:
>
> > They're basically the same. Let's avoid the code duplication.
> >
> > Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> > ---
> > src/mesa/drivers/dri/i965/brw_state.h | 2 +-
> > src/mesa/drivers/dri/i965/brw_state_upload.c | 2 +-
> > src/mesa/drivers/dri/i965/gen7_sol_state.c | 32 ++++++++--
> > src/mesa/drivers/dri/i965/gen8_sol_state.c | 90
> > +---------------------------
> > 4 files changed, 31 insertions(+), 95 deletions(-)
> >
> > diff --git a/src/mesa/drivers/dri/i965/brw_state.h
> > b/src/mesa/drivers/dri/i965/brw_state.h
> > index b29412e..a16e876 100644
> > --- a/src/mesa/drivers/dri/i965/brw_state.h
> > +++ b/src/mesa/drivers/dri/i965/brw_state.h
> > @@ -166,7 +166,6 @@ extern const struct brw_tracked_state gen8_wm_state;
> > extern const struct brw_tracked_state gen8_raster_state;
> > extern const struct brw_tracked_state gen8_sbe_state;
> > extern const struct brw_tracked_state gen8_sf_state;
> > -extern const struct brw_tracked_state gen8_sol_state;
> > extern const struct brw_tracked_state gen8_sf_clip_viewport;
> > extern const struct brw_tracked_state gen8_vertices;
> > extern const struct brw_tracked_state gen8_vf_topology;
> > @@ -303,6 +302,7 @@ void gen8_upload_ps_extra(struct brw_context *brw,
> > /* gen7_sol_state.c */
> > void gen7_upload_3dstate_so_decl_list(struct brw_context *brw,
> > const struct brw_vue_map *vue_map);
> > +void gen8_upload_3dstate_so_buffers(struct brw_context *brw);
> >
> > /* gen8_surface_state.c */
> >
> > diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c
> > b/src/mesa/drivers/dri/i965/brw_state_upload.c
> > index 0b47ebe..4a20821 100644
> > --- a/src/mesa/drivers/dri/i965/brw_state_upload.c
> > +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c
> > @@ -337,7 +337,7 @@ static const struct brw_tracked_state
> > *gen8_render_atoms[] =
> > &gen7_te_state,
> > &gen8_ds_state,
> > &gen8_gs_state,
> > - &gen8_sol_state,
> > + &gen7_sol_state,
> > &gen6_clip_state,
> > &gen8_raster_state,
> > &gen8_sbe_state,
> > diff --git a/src/mesa/drivers/dri/i965/gen7_sol_state.c
> > b/src/mesa/drivers/dri/i965/gen7_sol_state.c
> > index 4749cc8..8fcc591 100644
> > --- a/src/mesa/drivers/dri/i965/gen7_sol_state.c
> > +++ b/src/mesa/drivers/dri/i965/gen7_sol_state.c
> > @@ -222,7 +222,9 @@ upload_3dstate_streamout(struct brw_context *brw, bool
> > active,
> > /* BRW_NEW_TRANSFORM_FEEDBACK */
> > struct gl_transform_feedback_object *xfb_obj =
> > ctx->TransformFeedback.CurrentObject;
> > - uint32_t dw1 = 0, dw2 = 0;
> > + const struct gl_transform_feedback_info *linked_xfb_info =
> > + &xfb_obj->shader_program->LinkedTransformFeedback;
> > + uint32_t dw1 = 0, dw2 = 0, dw3 = 0, dw4 = 0;
> > int i;
> >
> > if (active) {
> >
>
> In here (not visible) gen7 sets a bunch of enable bits that don't exist on
> gen8. That should be inside of an "if (brw->gen <= 7)" guard.
D'oh...thanks. Fixed locally.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160622/c3e36782/attachment.sig>
More information about the mesa-dev
mailing list