summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-12-27 10:24:21 -0700
committerBrian Paul <[email protected]>2009-12-27 10:24:21 -0700
commitb46bcd8e7b37aa2e9159e126c1cc88234a3c2790 (patch)
tree440d291cc787c2b951a6581d0bb3cc60c13bc87f /src/mesa
parentcb504a026cbad317c6af1888bfcc616182e0c826 (diff)
parent7831515e69ac875b1ac0b1b248ab10c6cf37bf52 (diff)
Merge branch 'mesa_7_7_branch'
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/shader/prog_print.c8
-rw-r--r--src/mesa/state_tracker/st_cb_bufferobjects.c16
-rw-r--r--src/mesa/state_tracker/st_format.c2
3 files changed, 17 insertions, 9 deletions
diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c
index 52c102cbaa3..9f9789e010c 100644
--- a/src/mesa/shader/prog_print.c
+++ b/src/mesa/shader/prog_print.c
@@ -821,8 +821,10 @@ _mesa_print_program(const struct gl_program *prog)
/**
- * Return binary representation of value (as a string).
+ * Return binary representation of 64-bit value (as a string).
* Insert a comma to separate each group of 8 bits.
+ * Note we return a pointer to local static storage so this is not
+ * re-entrant, etc.
* XXX move to imports.[ch] if useful elsewhere.
*/
static const char *
@@ -831,7 +833,7 @@ binary(GLbitfield64 val)
static char buf[80];
GLint i, len = 0;
for (i = 63; i >= 0; --i) {
- if (val & (1 << i))
+ if (val & (1ULL << i))
buf[len++] = '1';
else if (len > 0 || i == 0)
buf[len++] = '0';
@@ -855,7 +857,7 @@ _mesa_fprint_program_parameters(FILE *f,
_mesa_fprintf(f, "InputsRead: 0x%x (0b%s)\n",
prog->InputsRead, binary(prog->InputsRead));
- _mesa_fprintf(f, "OutputsWritten: 0x%x (0b%s)\n",
+ _mesa_fprintf(f, "OutputsWritten: 0x%llx (0b%s)\n",
prog->OutputsWritten, binary(prog->OutputsWritten));
_mesa_fprintf(f, "NumInstructions=%d\n", prog->NumInstructions);
_mesa_fprintf(f, "NumTemporaries=%d\n", prog->NumTemporaries);
diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c
index 63196afba9c..494a3a99c87 100644
--- a/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -170,15 +170,19 @@ st_bufferobj_data(GLcontext *ctx,
pipe_buffer_reference( &st_obj->buffer, NULL );
- st_obj->buffer = pipe_buffer_create( pipe->screen, 32, buffer_usage, size );
+ if (size != 0) {
+ st_obj->buffer = pipe_buffer_create(pipe->screen, 32, buffer_usage, size);
- if (!st_obj->buffer) {
- return GL_FALSE;
+ if (!st_obj->buffer) {
+ return GL_FALSE;
+ }
+
+ if (data)
+ st_no_flush_pipe_buffer_write(st_context(ctx), st_obj->buffer, 0,
+ size, data);
+ return GL_TRUE;
}
- if (data)
- st_no_flush_pipe_buffer_write(st_context(ctx), st_obj->buffer, 0,
- size, data);
return GL_TRUE;
}
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index a06621d2b73..3e165c9febd 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -285,6 +285,8 @@ st_pipe_format_to_mesa_format(enum pipe_format pipeFormat)
return MESA_FORMAT_ARGB8888;
case PIPE_FORMAT_X8R8G8B8_UNORM:
return MESA_FORMAT_XRGB8888;
+ case PIPE_FORMAT_B8G8R8A8_UNORM:
+ return MESA_FORMAT_ARGB8888_REV;
case PIPE_FORMAT_A1R5G5B5_UNORM:
return MESA_FORMAT_ARGB1555;
case PIPE_FORMAT_A4R4G4B4_UNORM: