[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48325] branches/soc-2012-swiss_cheese/ source/blender/gpu/intern/gpu_immediate.c: corrected calculation of the number of addressable texture units
Jason Wilkins
Jason.A.Wilkins at gmail.com
Wed Jun 27 07:33:56 CEST 2012
Revision: 48325
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48325
Author: jwilkins
Date: 2012-06-27 05:33:39 +0000 (Wed, 27 Jun 2012)
Log Message:
-----------
corrected calculation of the number of addressable texture units
Modified Paths:
--------------
branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate.c
Modified: branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate.c 2012-06-27 01:33:55 UTC (rev 48324)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate.c 2012-06-27 05:33:39 UTC (rev 48325)
@@ -144,23 +144,35 @@
#if GPU_SAFETY
static void calc_last_texture(GPUimmediate* immediate)
{
- GLint maxTextureCoords = 1;
- GLint maxCombinedTextureImageUnits = 0;
+ GLint maxTextureUnits;
+ GLint maxTextureCoords;
+ GLint maxCombinedTextureImageUnits;
if (GLEW_VERSION_1_3 || GLEW_ARB_multitexture) {
glGetIntegerv(
+ GL_MAX_TEXTURE_UNITS,
+ &maxTextureUnits);
+ }
+ else {
+ maxTextureUnits = 1;
+ }
+
+ if (GLEW_VERSION_2_0 || GLEW_ARB_fragment_program) {
+ glGetIntegerv(
GL_MAX_TEXTURE_COORDS,
&maxTextureCoords);
- }
- if (GLEW_VERSION_2_0) {
glGetIntegerv(
GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS,
&maxCombinedTextureImageUnits);
}
+ else {
+ maxTextureCoords = 0;
+ maxCombinedTextureImageUnits = 0;
+ }
immediate->lastTexture =
- GL_TEXTURE0 + MAX2(maxTextureCoords, maxCombinedTextureImageUnits) - 1;
+ GL_TEXTURE0 + MAX3(maxTextureUnits, maxTextureCoords, maxCombinedTextureImageUnits) - 1;
}
#endif
More information about the Bf-blender-cvs
mailing list