summaryrefslogtreecommitdiffstats
authorDon Pellegrino <don@drexel.edu>2009-07-07 18:52:38 (GMT)
committer Don Pellegrino <don@drexel.edu>2009-07-07 18:52:38 (GMT)
commit959c70e693e720b49a70008eefb16e14816fb9a9 (patch) (unidiff)
tree9aa9a3c8c4964eb9b6d46b782660d0972ec8b1c1
parent94b89e8fc1b0980dfe1f6856005d4ea8a5aa477e (diff)
downloadexp005-959c70e693e720b49a70008eefb16e14816fb9a9.zip
exp005-959c70e693e720b49a70008eefb16e14816fb9a9.tar.gz
exp005-959c70e693e720b49a70008eefb16e14816fb9a9.tar.bz2
Ran GNU indent. Added utility function to report back on the use of
graphics memory by ATI cards.
-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 = \
18 model/protein_geometry.c \18 model/protein_geometry.c \
19 model/selection_info_init.c \19 model/selection_info_init.c \
20 model/zoom_info_init.c \20 model/zoom_info_init.c \
21 util/ati_meminfo.c \
21 util/check_error.c \22 util/check_error.c \
22 util/pick_convert.c \23 util/pick_convert.c \
23 util/sqlinfoprint.c \24 util/sqlinfoprint.c \
@@ -48,6 +49,7 @@ noinst_HEADERS = \
48 model/selection_purposes.h \49 model/selection_purposes.h \
49 model/zoom_info.h \50 model/zoom_info.h \
50 model/zoom_info_init.h \51 model/zoom_info_init.h \
52 util/ati_meminfo.h \
51 util/check_error.h \53 util/check_error.h \
52 util/pick_convert.h \54 util/pick_convert.h \
53 util/sqlinfoprint.h \55 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 @@
24#define SELECT_COLOR_A 0.7524#define SELECT_COLOR_A 0.75
2525
26typedef enum26typedef enum
27 { PROTEIN_GEOMETRY, DENSITY_LEGEND_GEOMETRY, MAP_GEOMETRY } LISTS;27{ PROTEIN_GEOMETRY, DENSITY_LEGEND_GEOMETRY, MAP_GEOMETRY } LISTS;
28#define NUM_LISTS 228#define NUM_LISTS 2
2929
30/*30/*
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)
9{9{
10 glNewList (S.list_offset + MAP_GEOMETRY, GL_COMPILE);10 glNewList (S.list_offset + MAP_GEOMETRY, GL_COMPILE);
11 glPolygonMode (GL_FRONT, GL_FILL);11 glPolygonMode (GL_FRONT, GL_FILL);
12 12
13 for (int i = 0; i < ROWS; i++)13 for (int i = 0; i < ROWS; i++)
14 {14 {
15 glLoadName (i);15 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 @@
1#include "ati_meminfo.h"
2#include <stdio.h>
3#include <GL/glut.h>
4
5#define VBO_FREE_MEMORY_ATI 0x87FB
6#define TEXTURE_FREE_MEMORY_ATI 0x87FC
7#define RENDERBUFFER_FREE_MEMORY_ATI 0x87FD
8
9void
10ati_meminfo (void)
11{
12 GLint param[4];
13
14 glGetIntegerv (VBO_FREE_MEMORY_ATI, param);
15 printf ("VBO_FREE_MEMORY_ATI\n");
16 printf (" Total memory free in the pool: %i Kbyte\n", param[0]);
17 printf (" Largest available free block in the pool: %i Kbyte\n", param[1]);
18 printf (" Total auxiliary memory free: %i Kbyte\n", param[2]);
19 printf (" Largest auxiliary free block: %i Kbyte\n", param[3]);
20 printf ("\n");
21
22 glGetIntegerv (TEXTURE_FREE_MEMORY_ATI, param);
23 printf ("TEXTURE_FREE_MEMORY_ATI\n");
24 printf (" Total memory free in the pool: %i Kbyte\n", param[0]);
25 printf (" Largest available free block in the pool: %i Kbyte\n", param[1]);
26 printf (" Total auxiliary memory free: %i Kbyte\n", param[2]);
27 printf (" Largest auxiliary free block: %i Kbyte\n", param[3]);
28 printf ("\n");
29
30 glGetIntegerv (RENDERBUFFER_FREE_MEMORY_ATI, param);
31 printf ("RENDERBUFFER_FREE_MEMORY_ATI\n");
32 printf (" Total memory free in the pool: %i Kbyte\n", param[0]);
33 printf (" Largest available free block in the pool: %i Kbyte\n", param[1]);
34 printf (" Total auxiliary memory free: %i Kbyte\n", param[2]);
35 printf (" Largest auxiliary free block: %i Kbyte\n", param[3]);
36 printf ("\n");
37
38 return;
39}
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 @@
1#ifndef ATI_MEMINFO_H
2#define ATI_MEMINFO_H
3
4/*
5 * Report the memory usage from the graphics card. Code based on
6 * documentation at
7 * http://www.opengl.org/registry/specs/ATI/meminfo.txt.
8 */
9void ati_meminfo (void);
10
11#endif // ATI_MEMINFO_H

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.