[Mesa-dev] [PATCH 2/2] mesa: add stricter checks for float formats in the texstore memcpy path

Marek Olšák maraeo at gmail.com
Sat Apr 23 06:40:22 PDT 2011


E.g. when the internal format was RGBA16F and the source was RG, it would use
memcpy.
---
 src/mesa/main/texstore.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 9a69052..cf12241 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -3551,6 +3551,7 @@ _mesa_texstore_rgba_float32(TEXSTORE_PARAMS)
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
        baseInternalFormat == srcFormat &&
+       baseInternalFormat == baseFormat &&
        srcType == GL_FLOAT) {
       /* simple memcpy path */
       memcpy_texture(ctx, dims,
@@ -3625,6 +3626,7 @@ _mesa_texstore_rgba_float16(TEXSTORE_PARAMS)
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
        baseInternalFormat == srcFormat &&
+       baseInternalFormat == baseFormat &&
        srcType == GL_HALF_FLOAT_ARB) {
       /* simple memcpy path */
       memcpy_texture(ctx, dims,
-- 
1.7.4.1



More information about the mesa-dev mailing list