Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-07-01 03:30:21 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-07-01 03:30:21 +0400
commitc9add22b5e0a893f4899119ff3047e7b14485969 (patch)
treee4c94fd79a97f85787ccfba27a61118e3a59df33 /source/blender/gpu
parente64ae3ad7c1dbca5487854821384c51426659a9b (diff)
opengl debug info, make GPU_state_print() only show values in arrays that are set. (was print 32 values every time)
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/intern/gpu_draw.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index cfdbf87785e..c3f78f8c28e 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -1891,15 +1891,21 @@ void GPU_state_init(void)
/* debugging aid */
static void gpu_get_print(const char *name, GLenum type)
{
+ const unsigned char err_mark[4] = {0xff, 0xff, 0xff, 0xff};
+
float value[32];
int a;
-
- memset(value, 0, sizeof(value));
+
+ memset(value, 0xff, sizeof(value));
glGetFloatv(type, value);
printf("%s: ", name);
- for (a = 0; a < 32; a++)
+ for (a = 0; a < 32; a++) {
+ if (memcmp(&value[a], err_mark, sizeof(value[a])) == 0) {
+ break;
+ }
printf("%.2f ", value[a]);
+ }
printf("\n");
}