summaryrefslogtreecommitdiffstats
Side-by-side diff
-rw-r--r--src/Makefile.am2
-rw-r--r--src/model/exp004state.h2
-rw-r--r--src/model/map_geometry.c2
-rw-r--r--src/util/ati_meminfo.c39
-rw-r--r--src/util/ati_meminfo.h11
5 files changed, 54 insertions, 2 deletions
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 <stdio.h>
+#include <GL/glut.h>
+
+#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

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.