<p dir="ltr">Really it's a workaround to fix bad vectorization in the Intel compiler, but it doesn't it doesn't hurt for other compilers, even if the performance difference is marginal if at all, and could only help. If it was problematic otherwise I'd guard it with an #ifdef _INTEL_COMPILER. I can update the patch with a comment explaining why it's there in case other developers stumble on it and think "wtf".</p>
<div class="gmail_quote">On Jun 28, 2016 6:38 PM, "Roland Scheidegger" <<a href="mailto:sroland@vmware.com">sroland@vmware.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="elided-text">Am 28.06.2016 um 22:45 schrieb Chuck Atkins:<br>
> This aligns the 4-element color float array to 16 byte boundaries. This<br>
> should allow compiler vectorizers to generate better optimizations.<br>
> Also fixes broken vectorization generated by Intel compiler.<br>
><br>
> Reported-by: Tim Rowley <<a href="mailto:timothy.o.rowley@intel.com">timothy.o.rowley@intel.com</a>><br>
> Signed-off-by: Chuck Atkins <<a href="mailto:chuck.atkins@kitware.com">chuck.atkins@kitware.com</a>><br>
> ---<br>
> src/gallium/include/pipe/p_state.h | 2 +-<br>
> 1 file changed, 1 insertion(+), 1 deletion(-)<br>
><br>
> diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h<br>
> index 1543e90..95f140f 100644<br>
> --- a/src/gallium/include/pipe/p_state.h<br>
> +++ b/src/gallium/include/pipe/p_state.h<br>
> @@ -326,7 +326,7 @@ struct pipe_blend_state<br>
><br>
> struct pipe_blend_color<br>
> {<br>
> - float color[4];<br>
> + PIPE_ALIGN_VAR(16) float color[4];<br>
> };<br>
><br>
<br>
</div>I'm wondering if that's really needed. I have a difficult time to<br>
imagine setting blend color is performance critical. And driver internal<br>
you can obviously still align pipe_blend_color structs yourself.<br>
But OTOH, why not...<br>
<br>
Acked-by: Roland Scheidegger <<a href="mailto:sroland@vmware.com">sroland@vmware.com</a>><br>
</blockquote></div>