Re: [Mesa-dev] [PATCH] Allow glTexImage2D with a depth component cube map
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/16/2011 07:56 PM, Anuj Phogat wrote: > From: Anuj Phogat > > Hi, > > Here is a patch to allow glTexImage2D and glCopyTexImage2D with depth > component cubemap. > It is listed in mesa work queue with a label "CUBE1". I've tested the patch > and output looks visually correct. > Please review the fix and let me know if i'm missing something. > > Thanks > Anuj > --- > src/mesa/main/teximage.c | 10 -- > 1 files changed, 8 insertions(+), 2 deletions(-) > > diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c > index acf7187..81f75c8 100644 > --- a/src/mesa/main/teximage.c > +++ b/src/mesa/main/teximage.c > @@ -1596,7 +1596,7 @@ texture_error_check( struct gl_context *ctx, > > /* additional checks for depth textures */ > if (_mesa_base_tex_format(ctx, internalFormat) == GL_DEPTH_COMPONENT) { > - /* Only 1D, 2D, rect and array textures supported, not 3D or cubes */ > + /* Only 1D, 2D, rect, array and cube textures are supported, not 3D*/ >if (target != GL_TEXTURE_1D && >target != GL_PROXY_TEXTURE_1D && >target != GL_TEXTURE_2D && > @@ -1606,7 +1606,13 @@ texture_error_check( struct gl_context *ctx, >target != GL_TEXTURE_2D_ARRAY && >target != GL_PROXY_TEXTURE_2D_ARRAY && >target != GL_TEXTURE_RECTANGLE_ARB && > - target != GL_PROXY_TEXTURE_RECTANGLE_ARB) { > + target != GL_PROXY_TEXTURE_RECTANGLE_ARB && > + target != GL_TEXTURE_CUBE_MAP_POSITIVE_X && > + target != GL_TEXTURE_CUBE_MAP_NEGATIVE_X && > + target != GL_TEXTURE_CUBE_MAP_POSITIVE_Y && > + target != GL_TEXTURE_CUBE_MAP_NEGATIVE_Y && > + target != GL_TEXTURE_CUBE_MAP_POSITIVE_Z && > + target != GL_TEXTURE_CUBE_MAP_NEGATIVE_Z) { > if (!isProxy) > _mesa_error(ctx, GL_INVALID_ENUM, > "glTexImage(target/internalFormat)"); Anuj, the patch looks good, except that the lines are not vertically aligned. Could you resubmit this with the alignment fixed? To highlight hard tabs in vim, the magic invocation is `:set list`. Also, could you share that test with us? - Chad Versace chad.vers...@linux.intel.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJOxtjzAAoJEAIvNt057x8iR2EQAJsNSps6eJ/pPipE4/AQS3nU WDYIuvNUMXwKWXcduJWu3MdMtCj33owDXU1kg3zWQ0bqHfHqXywBtXE9Cb9oU40P SAsyygLNDIajwD1VnxpL+NxSyZ3JLTlVk16MjOQrxfzPB1yzI1hL7sdc42ZvYmQl 8r0F9Z/zxnlvRa8jys76z1DGJg9f7R68hRYtvkzu7AZd1mlDKHzgyIFvUFAgKTm2 5pzCiCf47KPezPgTPPbWMPpOgez8haeWuqnowyVudpAdUuAVu7pA31VVvhiuQBZk lj+RgTvEPs1CCvEmrFwlfZpTparyn946EekR8ClmrQ8x9c5oV+z1wGFE4tON3ghf IhoDXSqJw+76tqTUVDFO0b/BwQSu+HHlDxRuRiccq102AP9I8xOPfwHP/ZxeuS7E O7PcqYTvziBWXWydNhVo1IxWN/FOgH4tj5FJwhxwCtvgB8jujk63XvkeT5nPoWxn DqYOUBC2DsXkjwI6gWRSS+b2OvcRt/UlyE4wgLmvjDe+m9JS2VZFqgzaUqgd4TJH D0uNFRvlptFfzU1LiM+MDnxDgvqsB86HvSw4idEFkKuMgGWxtDZn94IczJ5OiEyn 7P/0HiJXaYW0EcmF1/y/OO1ZljxhJ0w77MRBLCYiJFnLHgYHEDnjRBBM+i+b/V5x P8pYjx+DDbR0DZs5pmHQ =MS0g -END PGP SIGNATURE- ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] Allow glTexImage2D with a depth component cube map
On 11/16/2011 07:56 PM, Anuj Phogat wrote: From: Anuj Phogat Hi, Here is a patch to allow glTexImage2D and glCopyTexImage2D with depth component cubemap. It is listed in mesa work queue with a label "CUBE1". I've tested the patch and output looks visually correct. Please review the fix and let me know if i'm missing something. Thanks Anuj --- src/mesa/main/teximage.c | 10 -- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index acf7187..81f75c8 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1596,7 +1596,7 @@ texture_error_check( struct gl_context *ctx, /* additional checks for depth textures */ if (_mesa_base_tex_format(ctx, internalFormat) == GL_DEPTH_COMPONENT) { - /* Only 1D, 2D, rect and array textures supported, not 3D or cubes */ + /* Only 1D, 2D, rect, array and cube textures are supported, not 3D*/ if (target != GL_TEXTURE_1D&& target != GL_PROXY_TEXTURE_1D&& target != GL_TEXTURE_2D&& @@ -1606,7 +1606,13 @@ texture_error_check( struct gl_context *ctx, target != GL_TEXTURE_2D_ARRAY&& target != GL_PROXY_TEXTURE_2D_ARRAY&& target != GL_TEXTURE_RECTANGLE_ARB&& - target != GL_PROXY_TEXTURE_RECTANGLE_ARB) { + target != GL_PROXY_TEXTURE_RECTANGLE_ARB&& + target != GL_TEXTURE_CUBE_MAP_POSITIVE_X&& + target != GL_TEXTURE_CUBE_MAP_NEGATIVE_X&& + target != GL_TEXTURE_CUBE_MAP_POSITIVE_Y&& + target != GL_TEXTURE_CUBE_MAP_NEGATIVE_Y&& + target != GL_TEXTURE_CUBE_MAP_POSITIVE_Z&& + target != GL_TEXTURE_CUBE_MAP_NEGATIVE_Z) { The cubemap targets are only valid in OpenGL 3.0 (or later) or when GL_EXT_gpu_shader4 is available. Also, GL_PROXY_TEXTURE_CUBE_MAP is missing. if (!isProxy) _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage(target/internalFormat)"); ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] Allow glTexImage2D with a depth component cube map
On 11/21/2011 03:45 PM, anuj.pho...@gmail.com wrote: From: Anuj Phogat Thanks for the review comments. Here is the updated patch to allow depth component cube maps in GL 3.0. I'll post the piglit testcase for this patch in a separate e-mail. Anuj Signed-off-by: Anuj Phogat --- src/mesa/main/teximage.c | 27 +-- 1 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index acf7187..f1391be 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1596,7 +1596,7 @@ texture_error_check( struct gl_context *ctx, /* additional checks for depth textures */ if (_mesa_base_tex_format(ctx, internalFormat) == GL_DEPTH_COMPONENT) { - /* Only 1D, 2D, rect and array textures supported, not 3D or cubes */ + /* Only 1D, 2D, rect, cube and array textures are supported, not 3D*/ if (target != GL_TEXTURE_1D&& target != GL_PROXY_TEXTURE_1D&& target != GL_TEXTURE_2D&& @@ -1607,13 +1607,28 @@ texture_error_check( struct gl_context *ctx, target != GL_PROXY_TEXTURE_2D_ARRAY&& target != GL_TEXTURE_RECTANGLE_ARB&& target != GL_PROXY_TEXTURE_RECTANGLE_ARB) { - if (!isProxy) -_mesa_error(ctx, GL_INVALID_ENUM, -"glTexImage(target/internalFormat)"); - return GL_TRUE; + if (ctx->VersionMajor>= 3 || ctx->Extensions.EXT_gpu_shader4) { +/*Cubemaps are only supported for GL version> 3.0 or with EXT_gpu_shader4*/ +if (target != GL_TEXTURE_CUBE_MAP_POSITIVE_X&& +target != GL_TEXTURE_CUBE_MAP_NEGATIVE_X&& +target != GL_TEXTURE_CUBE_MAP_POSITIVE_Y&& +target != GL_TEXTURE_CUBE_MAP_NEGATIVE_Y&& +target != GL_TEXTURE_CUBE_MAP_POSITIVE_Z&& +target != GL_TEXTURE_CUBE_MAP_NEGATIVE_Z&& +target != GL_PROXY_TEXTURE_CUBE_MAP) { + if (!isProxy) + _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage(target/internalFormat)"); + return GL_TRUE; +} + } + else { + if (!isProxy) + _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage(target/internalFormat)"); + return GL_TRUE; + } } } - + /* additional checks for compressed textures */ if (_mesa_is_compressed_format(ctx, internalFormat)) { if (!target_can_be_compressed(ctx, target, internalFormat)) { I think something like this would be simpler: @@ -1629,7 +1629,9 @@ texture_error_check( struct gl_context *ctx, target != GL_TEXTURE_2D_ARRAY && target != GL_PROXY_TEXTURE_2D_ARRAY && target != GL_TEXTURE_RECTANGLE_ARB && - target != GL_PROXY_TEXTURE_RECTANGLE_ARB) { + target != GL_PROXY_TEXTURE_RECTANGLE_ARB && + !((_mesa_is_cube_face(target) || target == GL_PROXY_TEXTURE_CUBE_MAP) && +(ctx->VersionMajor >= 3 || ctx->Extensions.EXT_gpu_shader4))) { if (!isProxy) _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage(target/internalFormat)"); I haven't tested this so the logic might be incorrect. -Brian ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] Allow glTexImage2D with a depth component cube map
On 11/22/2011 11:42 AM, Anuj Phogat wrote: [snip] > I agree. This is simpler to read and _mesa_is_cube_map_face() can be reused > in mesa. Posting an updated patch with your suggestions. > > > I haven't tested this so the logic might be incorrect. > It worked as it is. Just defined a new function _mesa_is_cube_face(). > > Thanks > Anuj Actually, Brian already added that function; it's in teximage.h. > Signed-off-by: Anuj Phogat > --- > src/mesa/main/image.c| 18 ++ > src/mesa/main/image.h|3 +++ > src/mesa/main/teximage.c | 25 - > 3 files changed, 33 insertions(+), 13 deletions(-) > > diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c > index 7d95dd6..9ba5317 100644 > --- a/src/mesa/main/image.c > +++ b/src/mesa/main/image.c > @@ -1086,6 +1086,24 @@ _mesa_is_compressed_format(struct gl_context *ctx, > GLenum format) > } > } > > +/** > + * Test if the given texture target is a cubemap face > + */ > +GLboolean > +_mesa_is_cube_map_face(GLenum target) > +{ > + switch (target) { > + case GL_TEXTURE_CUBE_MAP_POSITIVE_X : > + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X : > + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y : > + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y : > + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z : > + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z : > + return GL_TRUE; > + default: > + return GL_FALSE; > + } > +} > > /** > * Return the address of a specific pixel in an image (1D, 2D or 3D). > diff --git a/src/mesa/main/image.h b/src/mesa/main/image.h > index 46adaec..2c88578 100644 > --- a/src/mesa/main/image.h > +++ b/src/mesa/main/image.h > @@ -84,6 +84,9 @@ _mesa_is_integer_format(GLenum format); > extern GLboolean > _mesa_is_compressed_format(struct gl_context *ctx, GLenum format); > > +extern GLboolean > +_mesa_is_cube_map_face(GLenum target); > + > extern GLvoid * > _mesa_image_address( GLuint dimensions, > const struct gl_pixelstore_attrib *packing, > diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c > index acf7187..43eec61 100644 > --- a/src/mesa/main/teximage.c > +++ b/src/mesa/main/teximage.c > @@ -1593,28 +1593,27 @@ texture_error_check( struct gl_context *ctx, > return GL_TRUE; >} > } > - > - /* additional checks for depth textures */ > + > + /* additional checks for depth textures */ > if (_mesa_base_tex_format(ctx, internalFormat) == GL_DEPTH_COMPONENT) { > - /* Only 1D, 2D, rect and array textures supported, not 3D or cubes */ > + /* Only 1D, 2D, rect, array and cube textures supported, not 3D > + * Cubemaps are only supported for GL version > 3.0 or with > EXT_gpu_shader4 */ >if (target != GL_TEXTURE_1D && >target != GL_PROXY_TEXTURE_1D && >target != GL_TEXTURE_2D && > - target != GL_PROXY_TEXTURE_2D && > - target != GL_TEXTURE_1D_ARRAY && > - target != GL_PROXY_TEXTURE_1D_ARRAY && > - target != GL_TEXTURE_2D_ARRAY && >target != GL_PROXY_TEXTURE_2D_ARRAY && >target != GL_TEXTURE_RECTANGLE_ARB && > - target != GL_PROXY_TEXTURE_RECTANGLE_ARB) { > - if (!isProxy) > -_mesa_error(ctx, GL_INVALID_ENUM, > -"glTexImage(target/internalFormat)"); > - return GL_TRUE; > + target != GL_PROXY_TEXTURE_RECTANGLE_ARB && > + !((_mesa_is_cube_map_face(target) || target == > GL_PROXY_TEXTURE_CUBE_MAP) && > + (ctx->VersionMajor >= 3 || ctx->Extensions.EXT_gpu_shader4))) { > +if (!isProxy) > + _mesa_error(ctx, GL_INVALID_ENUM, > + "glTexImage(target/internalFormat)"); > +return GL_TRUE; >} > } > > - /* additional checks for compressed textures */ > + /* additional checks for compressed textures */ > if (_mesa_is_compressed_format(ctx, internalFormat)) { >if (!target_can_be_compressed(ctx, target, internalFormat)) { > if (!isProxy) Seems like some spurious whitespace changes got introduced here...this isProxy stuff shouldn't be appearing in the diff. Mesa coding style is 3-space indentation with 8-space tabs. (Yeah, it's quite unusual... :)) In vim I accomplish this via the following .vimrc line: autocmd BufNewFile,BufRead /home/kwg/Projects/mesa/* set noexpandtab tabstop=8 softtabstop=3 shiftwidth=3 I'm sure there are recipes for other editors. Also, you might consider using git-send-email to send out your patches: git send-email --to mesa-dev@lists.freedesktop.org --annotate HEAD~1..HEAD ...sends the top commit from your current branch to the list. You can change the HEAD~1 to send a whole series; --compose lets you write a [PATCH 0/n] mail introducing the series if you like. The nice thing about git-send-email is that recipients can save the email as an mbox file (in Thunderbird, just right click and hit save) and then use 'git am ' to
Re: [Mesa-dev] [PATCH] Allow glTexImage2D with a depth component cube map
On 11/22/2011 01:21 PM, Kenneth Graunke wrote: On 11/22/2011 11:42 AM, Anuj Phogat wrote: [snip] I agree. This is simpler to read and _mesa_is_cube_map_face() can be reused in mesa. Posting an updated patch with your suggestions. > I haven't tested this so the logic might be incorrect. It worked as it is. Just defined a new function _mesa_is_cube_face(). Thanks Anuj Actually, Brian already added that function; it's in teximage.h. Signed-off-by: Anuj Phogat --- src/mesa/main/image.c| 18 ++ src/mesa/main/image.h|3 +++ src/mesa/main/teximage.c | 25 - 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 7d95dd6..9ba5317 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1086,6 +1086,24 @@ _mesa_is_compressed_format(struct gl_context *ctx, GLenum format) } } +/** + * Test if the given texture target is a cubemap face + */ +GLboolean +_mesa_is_cube_map_face(GLenum target) +{ + switch (target) { + case GL_TEXTURE_CUBE_MAP_POSITIVE_X : + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X : + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y : + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y : + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z : + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z : + return GL_TRUE; + default: + return GL_FALSE; + } +} /** * Return the address of a specific pixel in an image (1D, 2D or 3D). diff --git a/src/mesa/main/image.h b/src/mesa/main/image.h index 46adaec..2c88578 100644 --- a/src/mesa/main/image.h +++ b/src/mesa/main/image.h @@ -84,6 +84,9 @@ _mesa_is_integer_format(GLenum format); extern GLboolean _mesa_is_compressed_format(struct gl_context *ctx, GLenum format); +extern GLboolean +_mesa_is_cube_map_face(GLenum target); + extern GLvoid * _mesa_image_address( GLuint dimensions, const struct gl_pixelstore_attrib *packing, diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index acf7187..43eec61 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1593,28 +1593,27 @@ texture_error_check( struct gl_context *ctx, return GL_TRUE; } } - - /* additional checks for depth textures */ + + /* additional checks for depth textures */ if (_mesa_base_tex_format(ctx, internalFormat) == GL_DEPTH_COMPONENT) { - /* Only 1D, 2D, rect and array textures supported, not 3D or cubes */ + /* Only 1D, 2D, rect, array and cube textures supported, not 3D + * Cubemaps are only supported for GL version> 3.0 or with EXT_gpu_shader4 */ if (target != GL_TEXTURE_1D&& target != GL_PROXY_TEXTURE_1D&& target != GL_TEXTURE_2D&& - target != GL_PROXY_TEXTURE_2D&& - target != GL_TEXTURE_1D_ARRAY&& - target != GL_PROXY_TEXTURE_1D_ARRAY&& - target != GL_TEXTURE_2D_ARRAY&& I don't think you should delete those lines. target != GL_PROXY_TEXTURE_2D_ARRAY&& target != GL_TEXTURE_RECTANGLE_ARB&& - target != GL_PROXY_TEXTURE_RECTANGLE_ARB) { - if (!isProxy) -_mesa_error(ctx, GL_INVALID_ENUM, -"glTexImage(target/internalFormat)"); - return GL_TRUE; + target != GL_PROXY_TEXTURE_RECTANGLE_ARB&& + !((_mesa_is_cube_map_face(target) || target == GL_PROXY_TEXTURE_CUBE_MAP)&& + (ctx->VersionMajor>= 3 || ctx->Extensions.EXT_gpu_shader4))) { +if (!isProxy) + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexImage(target/internalFormat)"); +return GL_TRUE; } } - /* additional checks for compressed textures */ + /* additional checks for compressed textures */ if (_mesa_is_compressed_format(ctx, internalFormat)) { if (!target_can_be_compressed(ctx, target, internalFormat)) { if (!isProxy) Seems like some spurious whitespace changes got introduced here...this isProxy stuff shouldn't be appearing in the diff. Mesa coding style is 3-space indentation with 8-space tabs. (Yeah, it's quite unusual... :)) FWIW, I don't indent with tabs. From docs/devinfo.html: indent -br -i3 -npcs --no-tabs infile.c -o outfile.c -Brian ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] Allow glTexImage2D with a depth component cube map
On Tue 22 Nov 2011 12:21:09 PM PST, Kenneth Graunke wrote: On 11/22/2011 11:42 AM, Anuj Phogat wrote: [snip] I agree. This is simpler to read and _mesa_is_cube_map_face() can be reused in mesa. Posting an updated patch with your suggestions. > I haven't tested this so the logic might be incorrect. It worked as it is. Just defined a new function _mesa_is_cube_face(). Actually, Brian already added that function; it's in teximage.h. I just realised that my mesa branch was not updated with git://anongit.freedesktop.org/mesa/mesa. _mesa_is_cube_face() do exist in teximage.h After fetching all the recent changes and installing libdrm 2.4.27, i am getting following error while building the mesa driver: i830_state.c: In function ‘i830Enable’: i830_state.c:851:51: error: ‘struct intel_renderbuffer’ has no member named ‘region’ gmake[6]: *** [i830_state.o] Error 1 gmake[6]: *** Waiting for unfinished jobs gmake[6]: Leaving directory `/home/anuj/projects/mesa/src/mesa/drivers/dri/i915' gmake[5]: *** [lib] Error 2 gmake[5]: Leaving directory `/home/anuj/projects/mesa/src/mesa/drivers/dri/i915' gmake[4]: *** [subdirs] Error 1 gmake[4]: Leaving directory `/home/anuj/projects/mesa/src/mesa/drivers/dri' gmake[3]: *** [default] Error 1 gmake[3]: Leaving directory `/home/anuj/projects/mesa/src/mesa/drivers' gmake[2]: *** [driver_subdirs] Error 2 gmake[2]: Leaving directory `/home/anuj/projects/mesa/src/mesa' make[1]: *** [subdirs] Error 1 make[1]: Leaving directory `/home/anuj/projects/mesa/src' make: *** [default] Error 1 Is this a known issue or something specific to my system configuration? - /* additional checks for depth textures */ + + /* additional checks for depth textures */ if (_mesa_base_tex_format(ctx, internalFormat) == GL_DEPTH_COMPONENT) { - /* Only 1D, 2D, rect and array textures supported, not 3D or cubes */ + /* Only 1D, 2D, rect, array and cube textures supported, not 3D + * Cubemaps are only supported for GL version> 3.0 or with EXT_gpu_shader4 */ if (target != GL_TEXTURE_1D&& target != GL_PROXY_TEXTURE_1D&& target != GL_TEXTURE_2D&& - target != GL_PROXY_TEXTURE_2D&& - target != GL_TEXTURE_1D_ARRAY&& - target != GL_PROXY_TEXTURE_1D_ARRAY&& - target != GL_TEXTURE_2D_ARRAY&& target != GL_PROXY_TEXTURE_2D_ARRAY&& target != GL_TEXTURE_RECTANGLE_ARB&& - target != GL_PROXY_TEXTURE_RECTANGLE_ARB) { - if (!isProxy) -_mesa_error(ctx, GL_INVALID_ENUM, -"glTexImage(target/internalFormat)"); - return GL_TRUE; + target != GL_PROXY_TEXTURE_RECTANGLE_ARB&& + !((_mesa_is_cube_map_face(target) || target == GL_PROXY_TEXTURE_CUBE_MAP)&& + (ctx->VersionMajor>= 3 || ctx->Extensions.EXT_gpu_shader4))) { +if (!isProxy) + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexImage(target/internalFormat)"); +return GL_TRUE; } } target != GL_PROXY_TEXTURE_2D&& target != GL_TEXTURE_1D_ARRAY&& target != GL_PROXY_TEXTURE_1D_ARRAY&& target != GL_TEXTURE_2D_ARRAY&& I deleted these 4 lines by mistake. I'll correct this in next patch. - /* additional checks for compressed textures */ + /* additional checks for compressed textures */ if (_mesa_is_compressed_format(ctx, internalFormat)) { if (!target_can_be_compressed(ctx, target, internalFormat)) { if (!isProxy) Seems like some spurious whitespace changes got introduced here...this isProxy stuff shouldn't be appearing in the diff. Mesa coding style is 3-space indentation with 8-space tabs. (Yeah, it's quite unusual... :)) In vim I accomplish this via the following .vimrc line: autocmd BufNewFile,BufRead /home/kwg/Projects/mesa/* set noexpandtab tabstop=8 softtabstop=3 shiftwidth=3 I'm sure there are recipes for other editors. Also, you might consider using git-send-email to send out your patches: git send-email --to mesa-dev@lists.freedesktop.org --annotate HEAD~1..HEAD ...sends the top commit from your current branch to the list. You can change the HEAD~1 to send a whole series; --compose lets you write a [PATCH 0/n] mail introducing the series if you like. The nice thing about git-send-email is that recipients can save the email as an mbox file (in Thunderbird, just right click and hit save) and then use 'git am' to apply the patch, committing it with the proper commit message, authorship, etc. It's really convenient. Assuming the spurious hunks get dropped, this patch is Reviewed-by: Kenneth Graunke Thanks! Thanks for sharing the configuration for .vimrc. I'm already using git send-email for sending out the patches. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] Allow glTexImage2D with a depth component cube map
On 11/22/2011 03:34 PM, Anuj Phogat wrote: > On Tue 22 Nov 2011 12:21:09 PM PST, Kenneth Graunke wrote: >> On 11/22/2011 11:42 AM, Anuj Phogat wrote: >> [snip] >>> I agree. This is simpler to read and _mesa_is_cube_map_face() can >>> be reused >>> in mesa. Posting an updated patch with your suggestions. >>> >>> > I haven't tested this so the logic might be incorrect. >>> It worked as it is. Just defined a new function _mesa_is_cube_face(). >> >> Actually, Brian already added that function; it's in teximage.h. > > I just realised that my mesa branch was not updated with > git://anongit.freedesktop.org/mesa/mesa. _mesa_is_cube_face() do exist > in teximage.h > After fetching all the recent changes and installing libdrm 2.4.27, i am > getting following error while building the mesa driver: > > i830_state.c: In function ‘i830Enable’: > i830_state.c:851:51: error: ‘struct intel_renderbuffer’ has no member > named ‘region’ > gmake[6]: *** [i830_state.o] Error 1 > gmake[6]: *** Waiting for unfinished jobs > gmake[6]: Leaving directory > `/home/anuj/projects/mesa/src/mesa/drivers/dri/i915' > gmake[5]: *** [lib] Error 2 > gmake[5]: Leaving directory > `/home/anuj/projects/mesa/src/mesa/drivers/dri/i915' > gmake[4]: *** [subdirs] Error 1 > gmake[4]: Leaving directory `/home/anuj/projects/mesa/src/mesa/drivers/dri' > gmake[3]: *** [default] Error 1 > gmake[3]: Leaving directory `/home/anuj/projects/mesa/src/mesa/drivers' > gmake[2]: *** [driver_subdirs] Error 2 > gmake[2]: Leaving directory `/home/anuj/projects/mesa/src/mesa' > make[1]: *** [subdirs] Error 1 > make[1]: Leaving directory `/home/anuj/projects/mesa/src' > make: *** [default] Error 1 > > Is this a known issue or something specific to my system configuration? Yep, Chad broke that yesterday when he pushed HiZ. Oops. Chad and Eric are fixing it. You don't need the i830/i915 drivers on your system anyway, so you can just do 'make -i' to ignore it...or re-run configure and drop i830/i915 from your --with-dri-drivers. It should be fixed shortly anyway. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] Allow glTexImage2D with a depth component cube map
On 11/23/2011 05:14 PM, Anuj Phogat wrote: From: Anuj Phogat This is an updated patch to allow glTexImage2D with a depth component cube map. Patch was producing an expected ouput with depth-cube-map test (posted on piglit mailing list). But i'm getting an incorrect output since i updated my mesa branch with git://anongit.freedesktop.org/mesa/mesa. Luminance value is not getting copied to green and blue channels. So the color value i'm seeing in fragment shader is (L,0,0,1). I verified that this issue is only with depth cube maps not with depth 2D textures. Is this a known issue? I will try to debug it further. Which driver are you testing with? ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] Allow glTexImage2D with a depth component cube map
Hi Brian, >> This is an updated patch to allow glTexImage2D with a depth component >> cube map. Patch >> was producing an expected ouput with depth-cube-map test (posted on >> piglit mailing list). >> But i'm getting an incorrect output since i updated my mesa branch >> with git://anongit.freedesktop.org/mesa/mesa. >> Luminance value is not getting copied to green and blue channels. So >> the color value i'm seeing in fragment >> shader is (L,0,0,1). I verified that this issue is only with depth >> cube maps not with depth 2D textures. >> Is this a known issue? I will try to debug it further. > > Which driver are you testing with? Just figured out that my path for libdrm wasn't set correctly so driver was falling back to software rasterizer. glxinfo output: OpenGL vendor string: Mesa Project OpenGL renderer string: Software Rasterizer OpenGL version string: 3.0 Mesa 7.12-devel (git-24d25b5) OpenGL shading language version string: 1.30 So, the software rasterizer is not copying the Luminance value to green and blue channels. I'm getting the expected output (L,L,L,1) on setting correct path for libdrm. glxinfo output: OpenGL vendor string: Tungsten Graphics, Inc OpenGL renderer string: Mesa DRI Intel(R) Sandybridge Mobile x86/MMX/SSE2 OpenGL version string: 3.0 Mesa 7.12-devel (git-24d25b5) OpenGL shading language version string: 1.30 -Anuj ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] Allow glTexImage2D with a depth component cube map
On 11/26/2011 08:13 PM, Anuj Phogat wrote: Hi Brian, This is an updated patch to allow glTexImage2D with a depth component cube map. Patch was producing an expected ouput with depth-cube-map test (posted on piglit mailing list). But i'm getting an incorrect output since i updated my mesa branch with git://anongit.freedesktop.org/mesa/mesa. Luminance value is not getting copied to green and blue channels. So the color value i'm seeing in fragment shader is (L,0,0,1). I verified that this issue is only with depth cube maps not with depth 2D textures. Is this a known issue? I will try to debug it further. Which driver are you testing with? Just figured out that my path for libdrm wasn't set correctly so driver was falling back to software rasterizer. glxinfo output: OpenGL vendor string: Mesa Project OpenGL renderer string: Software Rasterizer OpenGL version string: 3.0 Mesa 7.12-devel (git-24d25b5) OpenGL shading language version string: 1.30 So, the software rasterizer is not copying the Luminance value to green and blue channels. I'm getting the expected output (L,L,L,1) on setting correct path for libdrm. glxinfo output: OpenGL vendor string: Tungsten Graphics, Inc OpenGL renderer string: Mesa DRI Intel(R) Sandybridge Mobile x86/MMX/SSE2 OpenGL version string: 3.0 Mesa 7.12-devel (git-24d25b5) OpenGL shading language version string: 1.30 I think you need to update swrast/s_texfilter.c to use sample_depth_texture() for cube textures. Same thing for 1D/2D_ARRAY textures too, it appears. -Brian ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev