summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-08-22 18:35:50 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-08-22 18:52:40 -0600
commitfa8cbc45e883762f3c3f1f11497a035c217f8d65 (patch)
treec3cf20f0c35d799eb76cb864ddf06f3c8a2d21c2
parente9190ec534abb817d4f5d1660c84a0ace3376c84 (diff)
Need to store vendor and renderer strings in the context.
As it was, we always returned the same pointer. So glxinfo, which calls glGetString() before printing anything, was printing the same string for both vendor and renderer.
-rw-r--r--src/mesa/state_tracker/st_cb_strings.c14
-rw-r--r--src/mesa/state_tracker/st_context.h3
2 files changed, 9 insertions, 8 deletions
diff --git a/src/mesa/state_tracker/st_cb_strings.c b/src/mesa/state_tracker/st_cb_strings.c
index ac1a8b1422..776f518e2b 100644
--- a/src/mesa/state_tracker/st_cb_strings.c
+++ b/src/mesa/state_tracker/st_cb_strings.c
@@ -46,8 +46,6 @@ st_get_string(GLcontext * ctx, GLenum name)
{
struct st_context *st = st_context(ctx);
struct pipe_context *pipe = st->pipe;
- static char buffer[128];
-
switch (name) {
case GL_VENDOR: {
@@ -59,20 +57,20 @@ st_get_string(GLcontext * ctx, GLenum name)
* additional string allows "and XyzCorp" to reflect this.
*/
if (vendor && strcmp(vendor, tungsten) != 0)
- snprintf(buffer, sizeof(buffer), "%s and %s", tungsten, vendor);
+ snprintf(st->vendor, sizeof(st->vendor),
+ "%s and %s", tungsten, vendor);
else
- snprintf(buffer, sizeof(buffer), "%s", tungsten);
+ snprintf(st->vendor, sizeof(st->vendor), "%s", tungsten);
- return (GLubyte *) buffer;
- break;
+ return (GLubyte *) st->vendor;
}
case GL_RENDERER:
- snprintf(buffer, sizeof(buffer), "TG3D, %s on %s",
+ snprintf(st->renderer, sizeof(st->renderer), "TG3D, %s on %s",
pipe->get_name( pipe ),
pipe->winsys->get_name( pipe->winsys ));
- return (GLubyte *) buffer;
+ return (GLubyte *) st->renderer;
default:
return NULL;
diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h
index 38d6a3ed86..13ea28237c 100644
--- a/src/mesa/state_tracker/st_context.h
+++ b/src/mesa/state_tracker/st_context.h
@@ -97,6 +97,9 @@ struct st_context
GLuint frontbuffer_dirty:1;
} flags;
+ char vendor[100];
+ char renderer[100];
+
/* State to be validated:
*/
struct st_tracked_state **atoms;