[Mesa-dev] [PATCH] gen7: Use logical, not physical, dims in 3DSTATE_DEPTH_BUFFER
Chad Versace
chad.versace at linux.intel.com
Wed Oct 2 15:05:45 PDT 2013
On 10/02/2013 10:48 AM, Eric Anholt wrote:
> Chad Versace <chad.versace at linux.intel.com> writes:
>
>> In 3DSTATE_DEPTH_BUFFER, we set Width and Height to the miptree slice's
>> physical dimensions. (Logical and physical dimensions may differ for
>> multisample surfaces).
>>
>> However, in SURFACE_STATE, we always set Width and Height to the slice's
>> logical dimensions. We should do the same for 3DSTATE_DEPTH_BUFFER,
>> because the hw docs say so.
>>
>> No Piglit regressions (-x glx) on Ivybridge with Wayland.
>>
>> CC: Paul Berry <stereotype441 at gmail.com>
>> CC: Jordan Justen <jordan.l.justen at intel.com>
>> CC: Ben Widawsky <ben at bwidawsk.net>
>> Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
>> ---
>> src/mesa/drivers/dri/i965/gen7_blorp.cpp | 3 ---
>> src/mesa/drivers/dri/i965/gen7_misc_state.c | 5 -----
>> 2 files changed, 8 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/gen7_blorp.cpp b/src/mesa/drivers/dri/i965/gen7_blorp.cpp
>> index 9df3d92..158f801 100644
>> --- a/src/mesa/drivers/dri/i965/gen7_blorp.cpp
>> +++ b/src/mesa/drivers/dri/i965/gen7_blorp.cpp
>> @@ -705,9 +705,6 @@ gen7_blorp_emit_depth_stencil_config(struct brw_context *brw,
>> */
>> surfwidth = params->depth.width;
>> surfheight = params->depth.height;
>> - } else {
>> - surfwidth = params->depth.mt->physical_width0;
>> - surfheight = params->depth.mt->physical_height0;
>> }
>
> It looks like surfwidth/height doesn't get initialized in this case any
> more. logical_width0 wouldn't be right either, since you actually want
> the logical of the particular slice.
>
This function doesn't use offsets into the depth buffer. It sets the 3DSTATE_DEPTH_BUFFER
lod and min_array_element fields, just as is done by gen7_misc_state.c. Therefore,
I think that the deleted else branch should now look like this:
} else {
surfwidth = params->depth.mt->logical_width0;
surfheight = params->depth.mt->logical_height0;
}
Does anyone see any problems with that? Of course, I'll retest the patch.
> The gen7_misc_state.c hunk is good, though.
More information about the mesa-dev
mailing list