Mesa (master): mesa: move declarations before code in texstore.c

Brian Paul brianp at kemper.freedesktop.org
Thu May 1 22:03:38 UTC 2014


Module: Mesa
Branch: master
Commit: 5ec1adeb1020c719c5bd72263f1d2719c276f1a7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5ec1adeb1020c719c5bd72263f1d2719c276f1a7

Author: Brian Paul <brianp at vmware.com>
Date:   Thu May  1 13:05:19 2014 -0600

mesa: move declarations before code in texstore.c

To fix MSVC build.

Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>

---

 src/mesa/main/texstore.c |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 436e5a8..7642146 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -2473,6 +2473,8 @@ _mesa_texstore_z24_s8(TEXSTORE_PARAMS)
    const GLint srcRowStride
       = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType);
    GLint img, row;
+   GLuint *depth = malloc(srcWidth * sizeof(GLuint));
+   GLubyte *stencil = malloc(srcWidth * sizeof(GLubyte));
 
    ASSERT(dstFormat == MESA_FORMAT_S8_UINT_Z24_UNORM);
    ASSERT(srcFormat == GL_DEPTH_STENCIL_EXT ||
@@ -2482,9 +2484,6 @@ _mesa_texstore_z24_s8(TEXSTORE_PARAMS)
           srcType == GL_UNSIGNED_INT_24_8_EXT ||
           srcType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
 
-   GLuint *depth = malloc(srcWidth * sizeof(GLuint));
-   GLubyte *stencil = malloc(srcWidth * sizeof(GLubyte));
-
    if (!depth || !stencil) {
       free(depth);
       free(stencil);
@@ -3416,6 +3415,11 @@ _mesa_texstore_r11_g11_b10f(TEXSTORE_PARAMS)
 static GLboolean
 _mesa_texstore_z32f_x24s8(TEXSTORE_PARAMS)
 {
+   GLint img, row;
+   const GLint srcRowStride
+      = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType)
+      / sizeof(uint64_t);
+
    ASSERT(dstFormat == MESA_FORMAT_Z32_FLOAT_S8X24_UINT);
    ASSERT(srcFormat == GL_DEPTH_STENCIL ||
           srcFormat == GL_DEPTH_COMPONENT ||
@@ -3424,11 +3428,6 @@ _mesa_texstore_z32f_x24s8(TEXSTORE_PARAMS)
           srcType == GL_UNSIGNED_INT_24_8 ||
           srcType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
 
-   GLint img, row;
-   const GLint srcRowStride
-      = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType)
-      / sizeof(uint64_t);
-
    /* In case we only upload depth we need to preserve the stencil */
    for (img = 0; img < srcDepth; img++) {
       uint64_t *dstRow = (uint64_t *) dstSlices[img];




More information about the mesa-commit mailing list