On 29 December 2012 04:35, Chris Forbes <chr...@ijw.co.nz> wrote: > - Set the multisample mode > - Set the surface dimensions correctly, in pixels. > > Signed-off-by: Chris Forbes <chr...@ijw.co.nz> >
Surface_state is used for texturing as well as for render targets. Can you clarify in the commit message that this patch applies just to surface_states used in texturing? Surface_states used for render targets already handle multisampling correctly. > --- > src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > index 1c54d59..160bd3f 100644 > --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > @@ -814,6 +814,14 @@ brw_update_texture_surface(struct gl_context *ctx, > > intel_miptree_get_dimensions_for_image(firstImage, &width, &height, > &depth); > > + if (tObj->Target == GL_TEXTURE_2D_MULTISAMPLE || > + tObj->Target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY) { > + /* surface_state wants pixel dimensions, not the 2x2 or 4x2 size > + * of the surface as stored in the miptree's levels array. */ > + width = intelObj->mt->singlesample_width0; > + height = intelObj->mt->singlesample_height0; > + } > + > Hopefully this kludge can go away after I've fixed up the logical vs. physical size ambiguity I mentioned in my comments on patch 21/26. > surf = brw_state_batch(brw, AUB_TRACE_SURFACE_STATE, > 6 * 4, 32, &binding_table[surf_index]); > > @@ -837,7 +845,7 @@ brw_update_texture_surface(struct gl_context *ctx, > ((intelObj->mt->region->pitch * intelObj->mt->cpp) - 1) << > BRW_SURFACE_PITCH_SHIFT); > > - surf[4] = 0; > + surf[4] = brw_get_surface_num_multisamples(intelObj->mt->num_samples); > > surf[5] = (mt->align_h == 4) ? BRW_SURFACE_VERTICAL_ALIGN_ENABLE : 0; > > -- > 1.8.0.3 > > _______________________________________________ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev >
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev