From 959c70e693e720b49a70008eefb16e14816fb9a9 Mon Sep 17 00:00:00 2001 From: Don Pellegrino Date: Tue, 07 Jul 2009 18:52:38 +0000 Subject: Ran GNU indent. Added utility function to report back on the use of graphics memory by ATI cards. --- diff --git a/src/Makefile.am b/src/Makefile.am index 855add4..1bfd6c4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -18,6 +18,7 @@ exp004viz_SOURCES = \ model/protein_geometry.c \ model/selection_info_init.c \ model/zoom_info_init.c \ + util/ati_meminfo.c \ util/check_error.c \ util/pick_convert.c \ util/sqlinfoprint.c \ @@ -48,6 +49,7 @@ noinst_HEADERS = \ model/selection_purposes.h \ model/zoom_info.h \ model/zoom_info_init.h \ + util/ati_meminfo.h \ util/check_error.h \ util/pick_convert.h \ util/sqlinfoprint.h \ diff --git a/src/model/exp004state.h b/src/model/exp004state.h index 6473028..6f9aad7 100644 --- a/src/model/exp004state.h +++ b/src/model/exp004state.h @@ -24,7 +24,7 @@ #define SELECT_COLOR_A 0.75 typedef enum - { PROTEIN_GEOMETRY, DENSITY_LEGEND_GEOMETRY, MAP_GEOMETRY } LISTS; +{ PROTEIN_GEOMETRY, DENSITY_LEGEND_GEOMETRY, MAP_GEOMETRY } LISTS; #define NUM_LISTS 2 /* diff --git a/src/model/map_geometry.c b/src/model/map_geometry.c index 31154da..055eb83 100644 --- a/src/model/map_geometry.c +++ b/src/model/map_geometry.c @@ -9,7 +9,7 @@ map_geometry (void) { glNewList (S.list_offset + MAP_GEOMETRY, GL_COMPILE); glPolygonMode (GL_FRONT, GL_FILL); - + for (int i = 0; i < ROWS; i++) { glLoadName (i); diff --git a/src/util/ati_meminfo.c b/src/util/ati_meminfo.c new file mode 100644 index 0000000..205d432 --- a/dev/null +++ b/src/util/ati_meminfo.c @@ -0,0 +1,39 @@ +#include "ati_meminfo.h" +#include +#include + +#define VBO_FREE_MEMORY_ATI 0x87FB +#define TEXTURE_FREE_MEMORY_ATI 0x87FC +#define RENDERBUFFER_FREE_MEMORY_ATI 0x87FD + +void +ati_meminfo (void) +{ + GLint param[4]; + + glGetIntegerv (VBO_FREE_MEMORY_ATI, param); + printf ("VBO_FREE_MEMORY_ATI\n"); + printf (" Total memory free in the pool: %i Kbyte\n", param[0]); + printf (" Largest available free block in the pool: %i Kbyte\n", param[1]); + printf (" Total auxiliary memory free: %i Kbyte\n", param[2]); + printf (" Largest auxiliary free block: %i Kbyte\n", param[3]); + printf ("\n"); + + glGetIntegerv (TEXTURE_FREE_MEMORY_ATI, param); + printf ("TEXTURE_FREE_MEMORY_ATI\n"); + printf (" Total memory free in the pool: %i Kbyte\n", param[0]); + printf (" Largest available free block in the pool: %i Kbyte\n", param[1]); + printf (" Total auxiliary memory free: %i Kbyte\n", param[2]); + printf (" Largest auxiliary free block: %i Kbyte\n", param[3]); + printf ("\n"); + + glGetIntegerv (RENDERBUFFER_FREE_MEMORY_ATI, param); + printf ("RENDERBUFFER_FREE_MEMORY_ATI\n"); + printf (" Total memory free in the pool: %i Kbyte\n", param[0]); + printf (" Largest available free block in the pool: %i Kbyte\n", param[1]); + printf (" Total auxiliary memory free: %i Kbyte\n", param[2]); + printf (" Largest auxiliary free block: %i Kbyte\n", param[3]); + printf ("\n"); + + return; +} diff --git a/src/util/ati_meminfo.h b/src/util/ati_meminfo.h new file mode 100644 index 0000000..4c551eb --- a/dev/null +++ b/src/util/ati_meminfo.h @@ -0,0 +1,11 @@ +#ifndef ATI_MEMINFO_H +#define ATI_MEMINFO_H + +/* + * Report the memory usage from the graphics card. Code based on + * documentation at + * http://www.opengl.org/registry/specs/ATI/meminfo.txt. + */ +void ati_meminfo (void); + +#endif // ATI_MEMINFO_H -- cgit v0.8.3.1-22-g547a