**************************************************************************/
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- * Nicolai Haehnle <prefect_@gmx.net>
+/**
+ * \file
+ *
+ * \author Keith Whitwell <keith@tungstengraphics.com>
+ * \author Nicolai Haehnle <prefect_@gmx.net>
*/
#ifndef __R300_CONTEXT_H__
#include "r300_vertprog.h"
#include "r300_fragprog.h"
+/**
+ * This function takes a float and packs it into a uint32_t
+ */
static __inline__ uint32_t r300PackFloat32(float fl)
{
union {
/* Need refcounting on dma buffers:
*/
struct r300_dma_buffer {
- int refcount; /* the number of retained regions in buf */
+ int refcount; /**< the number of retained regions in buf */
drmBufPtr buf;
int id;
};
#define R300_FALLBACK_RAST 2
/**
- * R300 context structure.
+ * \brief R300 context structure.
*/
struct r300_context {
struct radeon_context radeon; /* parent class, must be first */
#define R300_CONTEXT(ctx) ((r300ContextPtr)(ctx->DriverCtx))
-static __inline GLuint r300PackColor(GLuint cpp,
- GLubyte r, GLubyte g, GLubyte b, GLubyte a)
-{
- switch (cpp) {
- case 2:
- return PACK_COLOR_565(r, g, b);
- case 4:
- return PACK_COLOR_8888(r, g, b, a);
- default:
- return 0;
- }
-}
extern void r300DestroyContext(__DRIcontextPrivate * driContextPriv);
extern GLboolean r300CreateContext(const __GLcontextModes * glVisual,
__DRIcontextPrivate * driContextPriv,
CLAMPED_FLOAT_TO_UBYTE(color[2], cf[2]);
CLAMPED_FLOAT_TO_UBYTE(color[3], cf[3]);
- rmesa->hw.blend_color.cmd[1] = r300PackColor(4, color[3], color[0],
+ rmesa->hw.blend_color.cmd[1] = PACK_COLOR_8888(color[3], color[0],
color[1], color[2]);
}
static void r300SetTexBorderColor(r300TexObjPtr t, GLubyte c[4])
{
- t->pp_border_color = r300PackColor(4, c[0], c[1], c[2], c[3]);
+ t->pp_border_color = PACK_COLOR_8888(c[0], c[1], c[2], c[3]);
}
/**
typedef struct radeon_context radeonContextRec;
typedef struct radeon_context* radeonContextPtr;
-static __inline GLuint radeonPackColor(GLuint cpp,
- GLubyte r, GLubyte g, GLubyte b, GLubyte a)
-{
- switch (cpp) {
- case 2:
- return PACK_COLOR_565(r, g, b);
- case 4:
- return PACK_COLOR_8888(a, r, g, b);
- default:
- return 0;
- }
-}
-
#define TEX_0 0x1
#define TEX_1 0x2
#define TEX_2 0x4