#ifndef __R200_CONTEXT_H__
#define __R200_CONTEXT_H__
-#ifdef GLX_DIRECT_RENDERING
-
#include "tnl/t_vertex.h"
#include "drm.h"
#include "radeon_drm.h"
/* Flags for software fallback cases */
/* See correponding strings in r200_swtcl.c */
-#define R200_FALLBACK_TEXTURE 0x1
-#define R200_FALLBACK_DRAW_BUFFER 0x2
-#define R200_FALLBACK_STENCIL 0x4
-#define R200_FALLBACK_RENDER_MODE 0x8
-#define R200_FALLBACK_BLEND_EQ 0x10
-#define R200_FALLBACK_BLEND_FUNC 0x20
-#define R200_FALLBACK_DISABLE 0x40
-#define R200_FALLBACK_BORDER_MODE 0x80
+#define R200_FALLBACK_TEXTURE 0x01
+#define R200_FALLBACK_DRAW_BUFFER 0x02
+#define R200_FALLBACK_STENCIL 0x04
+#define R200_FALLBACK_RENDER_MODE 0x08
+#define R200_FALLBACK_DISABLE 0x10
+#define R200_FALLBACK_BORDER_MODE 0x20
/* The blit width for texture uploads
*/
struct r200_colorbuffer_state {
GLuint clear;
+#if 000
GLint drawOffset, drawPitch;
+#endif
int roundEnable;
};
struct r200_depthbuffer_state {
+ GLuint clear;
GLfloat scale;
};
+#if 000
struct r200_pixel_state {
GLint readOffset, readPitch;
};
+#endif
struct r200_scissor_state {
drm_clip_rect_t rect;
GLuint pp_cubic_faces; /* cube face 1,2,3,4 log2 sizes */
GLboolean border_fallback;
+
+ GLuint tile_bits; /* hw texture tile bits used on this texture */
};
struct r200_texture_env_state {
r200TexObjPtr texobj;
- GLenum format;
- GLenum envMode;
+ GLuint outputreg;
+ GLuint unitneeded;
};
#define R200_MAX_TEXTURE_UNITS 6
#define TEX_PP_TXSIZE 4 /*2c0c*/
#define TEX_PP_TXPITCH 5 /*2c10*/
#define TEX_PP_BORDER_COLOR 6 /*2c14*/
-#define TEX_CMD_1 7
-#define TEX_PP_TXOFFSET 8 /*2d00 */
-#define TEX_STATE_SIZE 9
-
-#define CUBE_CMD_0 0 /* 1 register follows */
-#define CUBE_PP_CUBIC_FACES 1 /* 0x2c18 */
+#define TEX_CMD_1_OLDDRM 7
+#define TEX_PP_TXOFFSET_OLDDRM 8 /*2d00 */
+#define TEX_STATE_SIZE_OLDDRM 9
+#define TEX_PP_CUBIC_FACES 7
+#define TEX_PP_TXMULTI_CTL 8
+#define TEX_CMD_1_NEWDRM 9
+#define TEX_PP_TXOFFSET_NEWDRM 10
+#define TEX_STATE_SIZE_NEWDRM 11
+
+#define CUBE_CMD_0 0 /* 1 register follows */ /* this command unnecessary */
+#define CUBE_PP_CUBIC_FACES 1 /* 0x2c18 */ /* with new enough drm */
#define CUBE_CMD_1 2 /* 5 registers follow */
#define CUBE_PP_CUBIC_OFFSET_F1 3 /* 0x2d04 */
#define CUBE_PP_CUBIC_OFFSET_F2 4 /* 0x2d08 */
#define TF_TFACTOR_5 6
#define TF_STATE_SIZE 7
+#define ATF_CMD_0 0
+#define ATF_TFACTOR_0 1
+#define ATF_TFACTOR_1 2
+#define ATF_TFACTOR_2 3
+#define ATF_TFACTOR_3 4
+#define ATF_TFACTOR_4 5
+#define ATF_TFACTOR_5 6
+#define ATF_TFACTOR_6 7
+#define ATF_TFACTOR_7 8
+#define ATF_STATE_SIZE 9
+
+/* ATI_FRAGMENT_SHADER */
+#define AFS_CMD_0 0
+#define AFS_IC0 1 /* 2f00 */
+#define AFS_IC1 2 /* 2f04 */
+#define AFS_IA0 3 /* 2f08 */
+#define AFS_IA1 4 /* 2f0c */
+#define AFS_STATE_SIZE 33
+
#define TCL_CMD_0 0
#define TCL_LIGHT_MODEL_CTL_0 1
#define TCL_LIGHT_MODEL_CTL_1 2
#define VTX_STATE_CNTL 8
#define VTX_STATE_SIZE 9
+/* SPR - point sprite state
+ */
+#define SPR_CMD_0 0
+#define SPR_POINT_SPRITE_CNTL 1
+#define SPR_STATE_SIZE 2
#define VTX_COLOR(v,n) (((v)>>(R200_VTX_COLOR_0_SHIFT+(n)*2))&\
R200_VTX_COLOR_MASK)
#define CST_SE_TCL_INPUT_VTX_3 17
#define CST_STATE_SIZE 18
-
+#define PRF_CMD_0 0
+#define PRF_PP_TRI_PERF 1
+#define PRF_PP_PERF_CNTL 2
+#define PRF_STATE_SIZE 3
struct r200_hw_state {
struct r200_state_atom tex[6];
struct r200_state_atom cube[6];
struct r200_state_atom zbs;
- struct r200_state_atom mtl[2];
- struct r200_state_atom mat[9];
+ struct r200_state_atom mtl[2];
+ struct r200_state_atom mat[9];
struct r200_state_atom lit[8]; /* includes vec, scl commands */
struct r200_state_atom ucp[6];
struct r200_state_atom pix[6]; /* pixshader stages */
struct r200_state_atom eye; /* eye pos */
struct r200_state_atom grd; /* guard band clipping */
- struct r200_state_atom fog;
- struct r200_state_atom glt;
+ struct r200_state_atom fog;
+ struct r200_state_atom glt;
+ struct r200_state_atom prf;
+ struct r200_state_atom afs[2];
+ struct r200_state_atom atf;
+ struct r200_state_atom spr;
int max_state_size; /* Number of bytes necessary for a full state emit. */
GLboolean is_dirty, all_dirty;
*/
struct r200_colorbuffer_state color;
struct r200_depthbuffer_state depth;
+#if 00
struct r200_pixel_state pixel;
+#endif
struct r200_scissor_state scissor;
struct r200_stencilbuffer_state stencil;
struct r200_stipple_state stipple;
struct r200_texture_state texture;
+ GLuint envneeded;
};
/* Need refcounting on dma buffers:
GLint last_offset;
GLuint hw_primitive;
- struct r200_dma_region *aos_components[8];
+/* FIXME: what's the maximum number of components? */
+ struct r200_dma_region *aos_components[11];
GLuint nr_aos_components;
GLuint *Elts;
struct dynfn MultiTexCoord2fvARB;
struct dynfn MultiTexCoord1fARB;
struct dynfn MultiTexCoord1fvARB;
+ struct dynfn FogCoordfEXT;
+ struct dynfn FogCoordfvEXT;
};
struct dfn_generators {
struct dynfn *(*MultiTexCoord2fvARB)( GLcontext *, const int * );
struct dynfn *(*MultiTexCoord1fARB)( GLcontext *, const int * );
struct dynfn *(*MultiTexCoord1fvARB)( GLcontext *, const int * );
+ struct dynfn *(*FogCoordfEXT)( GLcontext *, const int * );
+ struct dynfn *(*FogCoordfvEXT)( GLcontext *, const int * );
};
GLfloat *normalptr;
GLfloat *floatcolorptr;
+ GLfloat *fogptr;
r200_color_t *colorptr;
GLfloat *floatspecptr;
r200_color_t *specptr;
GLuint TclFallback;
GLuint Fallback;
GLuint NewGLState;
+ GLuint tnl_index; /* index of bits for last tnl_install_attrs */
/* Vertex buffers
*/
GLuint TexMatEnabled;
GLuint TexMatCompSel;
GLuint TexGenEnabled;
- GLuint TexGenInputs;
GLuint TexGenCompSel;
GLmatrix tmpmat;
GLuint swap_count;
GLuint swap_missed_count;
- PFNGLXGETUSTPROC get_ust;
/* r200_tcl.c
*/
/* Configuration cache
*/
driOptionCache optionCache;
+
+ GLboolean using_hyperz;
+ GLboolean texmicrotile;
+
+ struct ati_fragment_shader *afs_loaded;
};
#define R200_CONTEXT(ctx) ((r200ContextPtr)(ctx->DriverCtx))
#define DEBUG_PIXEL 0x2000
#define DEBUG_MEMORY 0x4000
-#endif
#endif /* __R200_CONTEXT_H__ */