[Mesa-dev] [PATCH V2 03/10] i965/wm: Set copy of sample mask in 3DSTATE_PS correctly for Haswell

Chris Forbes chrisf at ijw.co.nz
Mon Dec 2 09:52:36 PST 2013


Oops -- when I wrote the comment I was still hoping this would have
some visible effect on the problem I was hunting; never updated it.

On Tue, Dec 3, 2013 at 4:51 AM, Paul Berry <stereotype441 at gmail.com> wrote:
> On 30 November 2013 15:30, Chris Forbes <chrisf at ijw.co.nz> wrote:
>>
>> The bspec says:
>>
>> "SW must program the sample mask value in this field so that it matches
>> with 3DSTATE_SAMPLE_MASK"
>>
>> I haven't observed this to actually fix anything, but stumbled across it
>> while adding the rest of the support for CMS layout for multisample
>>    textures.
>>
>> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
>> ---
>>  src/mesa/drivers/dri/i965/gen7_wm_state.c | 9 +++++++--
>>  1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/gen7_wm_state.c
>> b/src/mesa/drivers/dri/i965/gen7_wm_state.c
>> index 65c9bbf..92e880c 100644
>> --- a/src/mesa/drivers/dri/i965/gen7_wm_state.c
>> +++ b/src/mesa/drivers/dri/i965/gen7_wm_state.c
>> @@ -173,8 +173,11 @@ upload_ps_state(struct brw_context *brw)
>>     if (ctx->Shader.CurrentFragmentProgram == NULL)
>>        dw2 |= GEN7_PS_FLOATING_POINT_MODE_ALT;
>>
>> +   /* Haswell requires the sample mask to be set in this packet as well
>> as
>> +    * in 3DSTATE_SAMPLE_MASK; the values must match, or strange things
>> happen. */
>
>
> In the commit message you say you haven't observed this to fix anything, but
> here you say that strange things happen if you don't set it.  Which is it?
>
> With that discrepancy resolved, this patch is:
>
> Reviewed-by: Paul Berry <stereotype441 at gmail.com>
>
>>
>> +   /* _NEW_BUFFERS, _NEW_MULTISAMPLE */
>>     if (brw->is_haswell)
>> -      dw4 |= SET_FIELD(1, HSW_PS_SAMPLE_MASK); /* 1 sample for now */
>> +      dw4 |= SET_FIELD(gen6_determine_sample_mask(brw),
>> HSW_PS_SAMPLE_MASK);
>>
>>     dw4 |= (brw->max_wm_threads - 1) << max_threads_shift;
>>
>> @@ -274,7 +277,9 @@ upload_ps_state(struct brw_context *brw)
>>  const struct brw_tracked_state gen7_ps_state = {
>>     .dirty = {
>>        .mesa  = (_NEW_PROGRAM_CONSTANTS |
>> -               _NEW_COLOR),
>> +               _NEW_COLOR |
>> +                _NEW_BUFFERS |
>> +                _NEW_MULTISAMPLE),
>>        .brw   = (BRW_NEW_FRAGMENT_PROGRAM |
>>                 BRW_NEW_PS_BINDING_TABLE |
>>                 BRW_NEW_BATCH |
>> --
>> 1.8.4.2
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
>


More information about the mesa-dev mailing list