<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Feb 2, 2017 at 11:09 AM, Nanley Chery <span dir="ltr"><<a href="mailto:nanleychery@gmail.com" target="_blank">nanleychery@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Jan 31, 2017 at 06:51:12PM -0800, Jason Ekstrand wrote:<br>
> ---<br>
> src/intel/isl/isl_surface_<wbr>state.c | 32 ++++++++++++++++++++++++++++++<wbr>++<br>
> 1 file changed, 32 insertions(+)<br>
><br>
> diff --git a/src/intel/isl/isl_surface_<wbr>state.c b/src/intel/isl/isl_surface_<wbr>state.c<br>
> index b735478..c7b220b 100644<br>
> --- a/src/intel/isl/isl_surface_<wbr>state.c<br>
> +++ b/src/intel/isl/isl_surface_<wbr>state.c<br>
> @@ -453,6 +453,38 @@ isl_genX(surf_fill_state_s)(<wbr>const struct isl_device *dev, void *state,<br>
> #endif<br>
><br>
> #if (GEN_GEN >= 8 || GEN_IS_HASWELL)<br>
> + if (info->view->usage & ISL_SURF_USAGE_RENDER_TARGET_<wbr>BIT) {<br>
<br>
</span>It seems that haswell actually allows this, though I don't know if it's<br>
a feature we'd ever want to use.<br>
<br>
>From the Haswell PRM, RENDER_SURFACE_STATE::Shader Channel Select R<br>
<br>
If more than one shader channel select is set to the same<br>
surface channel only the first shader channel in RGBA order will<br>
be written.<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div><div>Neat! I didn't realize it was actually well-defined on haswell. Probably not something we're likely to use though, especially given that broadwell+ don't give such nice guarantees.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">
-Nanley<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
> + /* From the Sky Lake PRM Vol. 2d,<br>
> + * RENDER_SURFACE_STATE::Shader Channel Select Red<br>
> + *<br>
> + * "For Render Target, Red, Green and Blue Shader Channel Selects<br>
> + * MUST be such that only valid components can be swapped i.e. only<br>
> + * change the order of components in the pixel. Any other values for<br>
> + * these Shader Channel Select fields are not valid for Render<br>
> + * Targets. This also means that there MUST not be multiple shader<br>
> + * channels mapped to the same RT channel."<br>
> + */<br>
> + assert(info->view->swizzle.r == ISL_CHANNEL_SELECT_RED ||<br>
> + info->view->swizzle.r == ISL_CHANNEL_SELECT_GREEN ||<br>
> + info->view->swizzle.r == ISL_CHANNEL_SELECT_BLUE);<br>
> + assert(info->view->swizzle.g == ISL_CHANNEL_SELECT_RED ||<br>
> + info->view->swizzle.g == ISL_CHANNEL_SELECT_GREEN ||<br>
> + info->view->swizzle.g == ISL_CHANNEL_SELECT_BLUE);<br>
> + assert(info->view->swizzle.b == ISL_CHANNEL_SELECT_RED ||<br>
> + info->view->swizzle.b == ISL_CHANNEL_SELECT_GREEN ||<br>
> + info->view->swizzle.b == ISL_CHANNEL_SELECT_BLUE);<br>
> + assert(info->view->swizzle.r != info->view->swizzle.g);<br>
> + assert(info->view->swizzle.r != info->view->swizzle.b);<br>
> + assert(info->view->swizzle.g != info->view->swizzle.b);<br>
> +<br>
> + /* From the Sky Lake PRM Vol. 2d,<br>
> + * RENDER_SURFACE_STATE::Shader Channel Select Alpha<br>
> + *<br>
> + * "For Render Target, this field MUST be programmed to<br>
> + * value = SCS_ALPHA."<br>
> + */<br>
> + assert(info->view->swizzle.a == ISL_CHANNEL_SELECT_ALPHA);<br>
> + }<br>
> s.ShaderChannelSelectRed = info->view->swizzle.r;<br>
> s.ShaderChannelSelectGreen = info->view->swizzle.g;<br>
> s.ShaderChannelSelectBlue = info->view->swizzle.b;<br>
> --<br>
> 2.5.0.400.gff86faf<br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> ______________________________<wbr>_________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div></div>