summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-12-07 16:46:30 -0700
committerBrian <[email protected]>2007-12-07 16:46:30 -0700
commit54fc80ab31f89520d3119196bfa9c6332b35fe2f (patch)
tree5ee522b13e1819884e214b12a555a8ed2ad1727d /src/mesa/state_tracker
parent6070a0eb2ba9ba29b861153a10e91c5b463a2ffc (diff)
Define PIPE_FORMAT_ tokens as an enum set, rather than #defines.
This makes debugging a _lot_ easier. In gdb, "print format" used to display 613570600, now you see PIPE_FORMAT_A8R8G8B8_UNORM.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_clear.c6
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c5
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c5
-rw-r--r--src/mesa/state_tracker/st_format.c14
-rw-r--r--src/mesa/state_tracker/st_format.h18
5 files changed, 23 insertions, 25 deletions
diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c
index 1f0d1e64260..b4b2429a2aa 100644
--- a/src/mesa/state_tracker/st_cb_clear.c
+++ b/src/mesa/state_tracker/st_cb_clear.c
@@ -55,7 +55,7 @@
static GLuint
-color_value(GLuint pipeFormat, const GLfloat color[4])
+color_value(enum pipe_format pipeFormat, const GLfloat color[4])
{
GLubyte r, g, b, a;
@@ -81,7 +81,7 @@ color_value(GLuint pipeFormat, const GLfloat color[4])
static uint
-depth_value(GLuint pipeFormat, GLfloat value)
+depth_value(enum pipe_format pipeFormat, GLfloat value)
{
switch (pipeFormat) {
case PIPE_FORMAT_Z16_UNORM:
@@ -104,7 +104,7 @@ depth_value(GLuint pipeFormat, GLfloat value)
static GLboolean
-is_depth_stencil_format(GLuint pipeFormat)
+is_depth_stencil_format(enum pipe_format pipeFormat)
{
switch (pipeFormat) {
case PIPE_FORMAT_S8Z24_UNORM:
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 464cf5ced34..c0e41dbeec5 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -456,7 +456,8 @@ make_texture(struct st_context *st,
struct pipe_context *pipe = st->pipe;
const struct gl_texture_format *mformat;
struct pipe_texture *pt;
- GLuint pipeFormat, cpp;
+ enum pipe_format pipeFormat;
+ GLuint cpp;
GLenum baseFormat;
baseFormat = _mesa_base_format(format);
@@ -729,7 +730,7 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z,
* XXX probably move this to a re-usable place.
*/
static GLboolean
-compatible_formats(GLenum format, GLenum type, GLuint pipeFormat)
+compatible_formats(GLenum format, GLenum type, enum pipe_format pipeFormat)
{
static const GLuint one = 1;
GLubyte littleEndian = *((GLubyte *) &one);
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 0ee5f45aae3..cbda56b5c3d 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -55,7 +55,8 @@
* Compute the renderbuffer's Red/Green/EtcBit fields from the pipe format.
*/
static int
-init_renderbuffer_bits(struct st_renderbuffer *strb, uint pipeFormat)
+init_renderbuffer_bits(struct st_renderbuffer *strb,
+ enum pipe_format pipeFormat)
{
struct pipe_format_info info;
@@ -86,7 +87,7 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
{
struct pipe_context *pipe = ctx->st->pipe;
struct st_renderbuffer *strb = st_renderbuffer(rb);
- const uint pipeFormat
+ const enum pipe_format pipeFormat
= st_choose_pipe_format(pipe, internalFormat, GL_NONE, GL_NONE);
GLuint cpp;
GLbitfield flags = PIPE_SURFACE_FLAG_RENDER; /* want to render to surface */
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index 9e249a47a60..8d39e1bec69 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -99,9 +99,7 @@ format_size(
* XXX temporary here
*/
GLboolean
-st_get_format_info(
- GLuint format,
- struct pipe_format_info *pinfo )
+st_get_format_info(enum pipe_format format, struct pipe_format_info *pinfo)
{
if (pf_layout(format) == PIPE_FORMAT_LAYOUT_RGBAZS) {
pipe_format_rgbazs_t info;
@@ -222,10 +220,10 @@ st_get_format_info(
* Return bytes per pixel for the given format.
*/
GLuint
-st_sizeof_format(GLuint pipeFormat)
+st_sizeof_format(enum pipe_format format)
{
struct pipe_format_info info;
- if (!st_get_format_info( pipeFormat, &info )) {
+ if (!st_get_format_info( format, &info )) {
assert( 0 );
return 0;
}
@@ -237,10 +235,10 @@ st_sizeof_format(GLuint pipeFormat)
* Return bytes per pixel for the given format.
*/
GLenum
-st_format_datatype(GLuint pipeFormat)
+st_format_datatype(enum pipe_format format)
{
struct pipe_format_info info;
- if (!st_get_format_info( pipeFormat, &info )) {
+ if (!st_get_format_info( format, &info )) {
assert( 0 );
return 0;
}
@@ -248,7 +246,7 @@ st_format_datatype(GLuint pipeFormat)
}
-GLuint
+enum pipe_format
st_mesa_format_to_pipe_format(GLuint mesaFormat)
{
switch (mesaFormat) {
diff --git a/src/mesa/state_tracker/st_format.h b/src/mesa/state_tracker/st_format.h
index 23abc36edff..6ccf5536f9d 100644
--- a/src/mesa/state_tracker/st_format.h
+++ b/src/mesa/state_tracker/st_format.h
@@ -26,13 +26,13 @@
**************************************************************************/
-#ifndef ST_CB_TEXIMAGE_H
-#define ST_CB_TEXIMAGE_H
+#ifndef ST_FORMAT_H
+#define ST_FORMAT_H
struct pipe_format_info
{
- GLuint format;
+ enum pipe_format format;
GLenum base_format;
GLenum datatype;
GLubyte red_bits;
@@ -47,21 +47,19 @@ struct pipe_format_info
};
-extern GLboolean
-st_get_format_info(
- GLuint format,
- struct pipe_format_info *pinfo );
+GLboolean
+st_get_format_info(enum pipe_format format, struct pipe_format_info *pinfo);
extern GLuint
-st_sizeof_format(GLuint pipeFormat);
+st_sizeof_format(enum pipe_format format);
extern GLenum
-st_format_datatype(GLuint pipeFormat);
+st_format_datatype(enum pipe_format format);
-extern GLuint
+extern enum pipe_format
st_mesa_format_to_pipe_format(GLuint mesaFormat);