From: Brian Paul Date: Thu, 1 May 2014 19:05:19 +0000 (-0600) Subject: mesa: move declarations before code in texstore.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5ec1adeb1020c719c5bd72263f1d2719c276f1a7;p=mesa.git mesa: move declarations before code in texstore.c To fix MSVC build. Reviewed-by: Anuj Phogat --- diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 436e5a8398d..764214669e1 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];