<p dir="ltr"><br>
On Jul 1, 2016 1:04 AM, "Pohjolainen, Topi" <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>> wrote:<br>
><br>
> On Wed, Jun 29, 2016 at 05:37:35PM -0700, Jason Ekstrand wrote:<br>
> > Eventually, this will be the actual view that gets passed into isl to<br>
> > create the surface state. For now, we just use it for the format and the<br>
> > swizzle.<br>
> > ---<br>
> > src/mesa/drivers/dri/i965/brw_blorp.c | 38 +++++++++++++++++++--------<br>
> > src/mesa/drivers/dri/i965/brw_blorp.h | 16 ++---------<br>
> > src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 34 ++++++++++++++++++++----<br>
> > src/mesa/drivers/dri/i965/brw_blorp_clear.cpp | 2 +-<br>
> > src/mesa/drivers/dri/i965/gen8_blorp.c | 29 ++++----------------<br>
> > 5 files changed, 64 insertions(+), 55 deletions(-)<br>
> ><br>
> > diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c<br>
> > index 5e433d3..df92822 100644<br>
> > --- a/src/mesa/drivers/dri/i965/brw_blorp.c<br>
> > +++ b/src/mesa/drivers/dri/i965/brw_blorp.c<br>
> > @@ -43,9 +43,11 @@ brw_blorp_surface_info_init(struct brw_context *brw,<br>
> > * using INTEL_MSAA_LAYOUT_UMS or INTEL_MSAA_LAYOUT_CMS, then it had better<br>
> > * be a multiple of num_samples.<br>
> > */<br>
> > + unsigned layer_multiplier = 1;<br>
> > if (mt->msaa_layout == INTEL_MSAA_LAYOUT_UMS ||<br>
> > mt->msaa_layout == INTEL_MSAA_LAYOUT_CMS) {<br>
> > assert(mt->num_samples <= 1 || layer % mt->num_samples == 0);<br>
> > + layer_multiplier = MAX2(mt->num_samples, 1);<br>
> > }<br>
> ><br>
> > intel_miptree_check_level_layer(mt, level, layer);<br>
> > @@ -61,13 +63,27 @@ brw_blorp_surface_info_init(struct brw_context *brw,<br>
> > info->aux_usage = ISL_AUX_USAGE_NONE;<br>
> > }<br>
> ><br>
> > + info->view = (struct isl_view) {<br>
> > + .usage = is_render_target ? ISL_SURF_USAGE_RENDER_TARGET_BIT :<br>
> > + ISL_SURF_USAGE_TEXTURE_BIT,<br>
> > + .format = ISL_FORMAT_UNSUPPORTED, /* Set later */<br>
> > + .base_level = level,<br>
> > + .levels = 1,<br>
> > + .base_array_layer = layer / layer_multiplier,<br>
> > + .array_len = 1,<br>
> > + .channel_select = {<br>
> > + ISL_CHANNEL_SELECT_RED,<br>
> > + ISL_CHANNEL_SELECT_GREEN,<br>
> > + ISL_CHANNEL_SELECT_BLUE,<br>
> > + ISL_CHANNEL_SELECT_ALPHA,<br>
> > + },<br>
> > + };<br>
> > +<br>
> > info->level = level;<br>
> > info->layer = layer;<br>
> > info->width = minify(mt->physical_width0, level - mt->first_level);<br>
> > info->height = minify(mt->physical_height0, level - mt->first_level);<br>
> ><br>
> > - info->swizzle = SWIZZLE_XYZW;<br>
> > -<br>
> > if (format == MESA_FORMAT_NONE)<br>
> > format = mt->format;<br>
> ><br>
> > @@ -75,8 +91,8 @@ brw_blorp_surface_info_init(struct brw_context *brw,<br>
> > case MESA_FORMAT_S_UINT8:<br>
> > assert(info->surf.tiling == ISL_TILING_W);<br>
> > /* Prior to Broadwell, we can't render to R8_UINT */<br>
> > - info->brw_surfaceformat = brw->gen >= 8 ? BRW_SURFACEFORMAT_R8_UINT :<br>
> > - BRW_SURFACEFORMAT_R8_UNORM;<br>
> > + info->view.format = brw->gen >= 8 ? BRW_SURFACEFORMAT_R8_UINT :<br>
> > + BRW_SURFACEFORMAT_R8_UNORM;<br>
><br>
> isl_view::format is of the type "enum isl_format" but we assigned it with<br>
> BRW_SURFACEFORMAT?</p>
<p dir="ltr">ISL uses the hardware values so the two are interchangeable. I haven't yet gone through the dri driver and deleted the BRW_SURFACEFORMAT defines. I could, however fix this particular case while I'm in the neighborhood.</p>