On 24 September 2012 12:12, Eric Anholt <span dir="ltr"><<a href="mailto:eric@anholt.net" target="_blank">eric@anholt.net</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>> writes:<br>
> + /* If we are blitting from sRGB to linear or vice versa, we still want the<br>
> + * blit to be a direct copy, so we need source and destination to use the<br>
> + * same format. However, we want the destination sRGB/linear state to be<br>
> + * correct (so that sRGB blending is used when doing an MSAA resolve to an<br>
> + * sRGB surface, and linear blending is used when doing an MSAA resolve to<br>
> + * a linear surface). Since blorp blits don't support any format<br>
> + * conversion (except between sRGB and linear), we can accomplish this by<br>
> + * simply setting up the source to use the same format as the destination.<br>
> + */<br>
> + src.brw_surfaceformat = dst.brw_surfaceformat;<br>
<br>
</div>We'd get in trouble here if we ever have to relax formats_match to allow<br>
things like RGBA <-> BGRA blits (other drivers have apparently had to do<br>
this). You may consider an assert that the linear versions of the two<br>
formats match or something, though actually this is close enough to<br>
formats_match() in the file that I'm not too worried.<br></blockquote><div><br>Yeah, that's a good point. I'll go ahead and add the assertion. Thanks.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Reviewed-by: Eric Anholt <<a href="mailto:eric@anholt.net">eric@anholt.net</a>><br>
</blockquote></div><br>