<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 13, 2014 at 5:18 PM, Roland Scheidegger <span dir="ltr"><<a href="mailto:sroland@vmware.com" target="_blank">sroland@vmware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Reviewed-by: Roland Scheidegger <<a href="mailto:sroland@vmware.com">sroland@vmware.com</a>><br>
<br>
Not sure though why you moved the function, it's declared elsewhere anyway.<br></blockquote><div><br></div><div>Heh, I guess you're right. I'll un-move the function to reduce churn.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
(And I bet there's cases where transfer ops wouldn't actually be<br>
required which aren't caught by this check, like for instance RGB<br>
formats with only alpha pixel scale, but that was already there, plus I<br>
guess we don't care all that much about performance for apps which<br>
fiddle with that stuff...)<br></blockquote><div><br></div><div>Yeah, We could spend a lot of time optimizing that but I don't see a need.<br></div><div>--Jason<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Am 13.08.2014 20:05, schrieb Jason Ekstrand:<br>
<div><div class="h5">> The _mesa_swizzle_and_convert path can't do transfer ops, so we should bail<br>
> if they're needed.<br>
><br>
> Signed-off-by: Jason Ekstrand <<a href="mailto:jason.ekstrand@intel.com">jason.ekstrand@intel.com</a>><br>
> ---<br>
> src/mesa/main/texstore.c | 63 +++++++++++++++++++++++++-----------------------<br>
> 1 file changed, 33 insertions(+), 30 deletions(-)<br>
><br>
> diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c<br>
> index 42cebbd..50c7dde 100644<br>
> --- a/src/mesa/main/texstore.c<br>
> +++ b/src/mesa/main/texstore.c<br>
> @@ -1462,6 +1462,36 @@ invert_swizzle(uint8_t dst[4], const uint8_t src[4])<br>
> dst[i] = j;<br>
> }<br>
><br>
> +GLboolean<br>
> +_mesa_texstore_needs_transfer_ops(struct gl_context *ctx,<br>
> + GLenum baseInternalFormat,<br>
> + mesa_format dstFormat)<br>
> +{<br>
> + GLenum dstType;<br>
> +<br>
> + /* There are different rules depending on the base format. */<br>
> + switch (baseInternalFormat) {<br>
> + case GL_DEPTH_COMPONENT:<br>
> + case GL_DEPTH_STENCIL:<br>
> + return ctx->Pixel.DepthScale != 1.0f ||<br>
> + ctx->Pixel.DepthBias != 0.0f;<br>
> +<br>
> + case GL_STENCIL_INDEX:<br>
> + return GL_FALSE;<br>
> +<br>
> + default:<br>
> + /* Color formats.<br>
> + * Pixel transfer ops (scale, bias, table lookup) do not apply<br>
> + * to integer formats.<br>
> + */<br>
> + dstType = _mesa_get_format_datatype(dstFormat);<br>
> +<br>
> + return dstType != GL_INT && dstType != GL_UNSIGNED_INT &&<br>
> + ctx->_ImageTransferState;<br>
> + }<br>
> +}<br>
> +<br>
> +<br>
> /** Store a texture by per-channel conversions and swizzling.<br>
> *<br>
> * This function attempts to perform a texstore operation by doing simple<br>
> @@ -1495,6 +1525,9 @@ texstore_swizzle(TEXSTORE_PARAMS)<br>
> if (!is_array)<br>
> return GL_FALSE;<br>
><br>
> + if (_mesa_texstore_needs_transfer_ops(ctx, baseInternalFormat, dstFormat))<br>
> + return GL_FALSE;<br>
> +<br>
> switch (srcType) {<br>
> case GL_FLOAT:<br>
> case GL_UNSIGNED_BYTE:<br>
> @@ -1762,36 +1795,6 @@ texstore_rgba(TEXSTORE_PARAMS)<br>
> }<br>
><br>
> GLboolean<br>
> -_mesa_texstore_needs_transfer_ops(struct gl_context *ctx,<br>
> - GLenum baseInternalFormat,<br>
> - mesa_format dstFormat)<br>
> -{<br>
> - GLenum dstType;<br>
> -<br>
> - /* There are different rules depending on the base format. */<br>
> - switch (baseInternalFormat) {<br>
> - case GL_DEPTH_COMPONENT:<br>
> - case GL_DEPTH_STENCIL:<br>
> - return ctx->Pixel.DepthScale != 1.0f ||<br>
> - ctx->Pixel.DepthBias != 0.0f;<br>
> -<br>
> - case GL_STENCIL_INDEX:<br>
> - return GL_FALSE;<br>
> -<br>
> - default:<br>
> - /* Color formats.<br>
> - * Pixel transfer ops (scale, bias, table lookup) do not apply<br>
> - * to integer formats.<br>
> - */<br>
> - dstType = _mesa_get_format_datatype(dstFormat);<br>
> -<br>
> - return dstType != GL_INT && dstType != GL_UNSIGNED_INT &&<br>
> - ctx->_ImageTransferState;<br>
> - }<br>
> -}<br>
> -<br>
> -<br>
> -GLboolean<br>
> _mesa_texstore_can_use_memcpy(struct gl_context *ctx,<br>
> GLenum baseInternalFormat, mesa_format dstFormat,<br>
> GLenum srcFormat, GLenum srcType,<br>
><br>
<br>
</div></div>_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div><br></div></div>