/*@}*/
GLboolean DitherFlag; /**< Dither enable flag */
+
+ GLenum ClampFragmentColor; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */
+ GLenum ClampReadColor; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */
};
/** GL_EXT_histogram */
GLboolean HistogramEnabled;
GLboolean MinMaxEnabled;
- /** GL_SGIS_pixel_texture */
- GLboolean PixelTextureEnabled;
- GLenum FragmentRgbSource;
- GLenum FragmentAlphaSource;
/** GL_SGI_color_matrix */
GLfloat PostColorMatrixScale[4]; /**< RGBA */
GLfloat PostColorMatrixBias[4]; /**< RGBA */
/**
- * NV_fragment_program runtime state
+ * State used during execution of fragment programs.
*/
struct fp_machine
{
GLuint CondCodes[4];
};
-/**
- * ATI_fragment_shader runtime state
- */
-#define ATI_FS_INPUT_PRIMARY 0
-#define ATI_FS_INPUT_SECONDARY 1
-
-/* 6 register sets - 2 inputs (primary, secondary) */
-struct atifs_machine
-{
- GLfloat Registers[6][4];
- GLfloat PrevPassRegisters[6][4];
- GLfloat Inputs[2][4];
- GLuint pass;
-};
-
/**
* Names of the various vertex/fragment program register files, etc.
/** Vertex and fragment instructions */
-struct vp_instruction;
-struct fp_instruction;
-struct atifs_instruction;
-struct atifs_setupinst;
+struct prog_instruction;
struct program_parameter_list;
GLenum Target;
GLenum Format; /**< String encoding format */
GLboolean Resident;
+
+ struct prog_instruction *Instructions;
+
+ GLbitfield InputsRead; /* Bitmask of which input regs are read */
+ GLbitfield OutputsWritten; /* Bitmask of which output regs are written to */
+
+ /** Named parameters, constants, etc. from program text */
+ struct program_parameter_list *Parameters;
+ /** Numbered local parameters */
GLfloat LocalParams[MAX_PROGRAM_LOCAL_PARAMS][4];
- GLuint NumInstructions; /* GL_ARB_vertex/fragment_program */
+
+ /** Logical counts */
+ /*@{*/
+ GLuint NumInstructions;
GLuint NumTemporaries;
GLuint NumParameters;
GLuint NumAttributes;
GLuint NumAddressRegs;
- /* native, h/w counts */
+ /*@}*/
+ /** Native, actual h/w counts */
+ /*@{*/
GLuint NumNativeInstructions;
GLuint NumNativeTemporaries;
GLuint NumNativeParameters;
GLuint NumNativeAttributes;
GLuint NumNativeAddressRegs;
+ /*@}*/
};
struct vertex_program
{
struct program Base; /* base class */
- struct vp_instruction *Instructions; /* Compiled instructions */
GLboolean IsNVProgram; /* GL_NV_vertex_program ? */
GLboolean IsPositionInvariant; /* GL_NV_vertex_program1_1 */
- GLbitfield InputsRead; /* Bitmask of which input regs are read */
- GLbitfield OutputsWritten; /* Bitmask of which output regs are written to */
- struct program_parameter_list *Parameters; /**< array [NumParameters] */
void *TnlData; /* should probably use Base.DriverData */
};
struct fragment_program
{
struct program Base; /**< base class */
- struct fp_instruction *Instructions; /**< Compiled instructions */
- GLbitfield InputsRead; /**< Bitmask of which input regs are read */
- GLbitfield OutputsWritten; /**< Bitmask of which output regs are written to */
- GLbitfield TexturesUsed[MAX_TEXTURE_IMAGE_UNITS]; /**< TEXTURE_x_INDEX bitmask */
+ GLbitfield TexturesUsed[MAX_TEXTURE_IMAGE_UNITS]; /**< TEXTURE_x_BIT bitmask */
GLuint NumAluInstructions; /**< GL_ARB_fragment_program */
GLuint NumTexInstructions;
GLuint NumTexIndirections;
GLuint NumNativeTexInstructions;
GLuint NumNativeTexIndirections;
GLenum FogOption;
- struct program_parameter_list *Parameters; /**< array [NumParameters] */
GLboolean UsesKill;
-
-#ifdef USE_TCC
- char c_str[4096]; /* experimental... */
- int c_strlen;
-#endif
};
-struct ati_fragment_shader
-{
- struct program Base;
- struct atifs_instruction *Instructions[2];
- struct atifs_setupinst *SetupInst[2];
- GLfloat Constants[8][4];
- GLuint localConstDef;
- GLubyte numArithInstr[2];
- GLubyte regsAssigned[2];
- GLubyte NumPasses;
- GLubyte cur_pass;
- GLubyte last_optype;
- GLboolean interpinp1;
- GLboolean isValid;
- GLuint swizzlerq;
-};
/**
* State common to vertex and fragment programs.
struct gl_vertex_program_state
{
GLboolean Enabled; /**< GL_VERTEX_PROGRAM_NV */
- GLboolean _Enabled; /**< Really enabled? */
+ GLboolean _Enabled; /**< Enabled and valid program? */
GLboolean PointSizeEnabled; /**< GL_VERTEX_PROGRAM_POINT_SIZE_NV */
GLboolean TwoSideEnabled; /**< GL_VERTEX_PROGRAM_TWO_SIDE_NV */
struct vertex_program *Current; /**< ptr to currently bound program */
/**
- * State for GL_ARB/NV_fragment_program
+ * Context state for GL_ARB/NV_fragment_program
*/
struct gl_fragment_program_state
{
GLboolean Enabled; /* GL_VERTEX_PROGRAM_NV */
- GLboolean _Enabled; /* Really enabled? */
- GLboolean _Active; /* Really really enabled? */
+ GLboolean _Enabled; /* Enabled and valid program? */
+ GLboolean _Active;
struct fragment_program *Current; /* ptr to currently bound program */
struct fragment_program *_Current; /* ptr to currently active program
(including internal programs) */
/**
- * State for GL_ATI_fragment_shader
+ * ATI_fragment_shader runtime state
+ */
+#define ATI_FS_INPUT_PRIMARY 0
+#define ATI_FS_INPUT_SECONDARY 1
+
+struct atifs_instruction;
+struct atifs_setupinst;
+
+/**
+ * State for executing ATI fragment shader.
+ */
+struct atifs_machine
+{
+ GLfloat Registers[6][4]; /** six temporary registers */
+ GLfloat PrevPassRegisters[6][4];
+ GLfloat Inputs[2][4]; /** Primary, secondary input colors */
+};
+
+
+/**
+ * ATI fragment shader
+ */
+struct ati_fragment_shader
+{
+ GLuint Id;
+ GLint RefCount;
+ struct atifs_instruction *Instructions[2];
+ struct atifs_setupinst *SetupInst[2];
+ GLfloat Constants[8][4];
+ GLbitfield LocalConstDef; /** Indicates which constants have been set */
+ GLubyte numArithInstr[2];
+ GLubyte regsAssigned[2];
+ GLubyte NumPasses; /** 1 or 2 */
+ GLubyte cur_pass;
+ GLubyte last_optype;
+ GLboolean interpinp1;
+ GLboolean isValid;
+ GLuint swizzlerq;
+};
+
+/**
+ * Context state for GL_ATI_fragment_shader
*/
struct gl_ati_fragment_shader_state
{
GLboolean Enabled;
- GLboolean _Enabled;
+ GLboolean _Enabled; /** enabled and valid shader? */
GLboolean Compiling;
- GLfloat globalConstants[8][4];
+ GLfloat GlobalConstants[8][4];
struct atifs_machine Machine; /* machine state */
struct ati_fragment_shader *Current;
};
+/**
+ * Occlusion/timer query object.
+ */
struct gl_query_object
{
GLuint Id;
- GLuint Result; /* the counter */
+ GLuint64EXT Result; /* the counter */
GLboolean Active; /* inside Begin/EndQuery */
GLboolean Ready; /* result is ready */
};
+/**
+ * Context state for query objects.
+ */
struct gl_query_state
{
struct _mesa_HashTable *QueryObjects;
/**
- ** XXX do these gl2 structs really neeed to be here?
- **/
-
-/**
- * gl2 unique interface identifier.
- * Each gl2 interface has its own interface id used for object queries.
+ * Context state for vertex/fragment shaders.
*/
-enum gl2_uiid
-{
- UIID_UNKNOWN, /* supported by all objects */
- UIID_GENERIC, /* generic object */
- UIID_CONTAINER, /* contains generic objects */
- UIID_SHADER, /* shader object */
- UIID_FRAGMENT_SHADER, /* fragment shader */
- UIID_VERTEX_SHADER, /* vertex shader */
- UIID_PROGRAM, /* program object */
- UIID_3DLABS_SHHANDLE /* encapsulates 3dlabs' ShHandle */
-};
-
-struct gl2_unknown_intf
-{
- GLvoid (* AddRef) (struct gl2_unknown_intf **);
- GLvoid (* Release) (struct gl2_unknown_intf **);
- struct gl2_unknown_intf **(* QueryInterface) (struct gl2_unknown_intf **, enum gl2_uiid uiid);
-};
-
-struct gl2_generic_intf
-{
- struct gl2_unknown_intf _unknown;
- GLvoid (* Delete) (struct gl2_generic_intf **);
- GLenum (* GetType) (struct gl2_generic_intf **);
- GLhandleARB (* GetName) (struct gl2_generic_intf **);
- GLboolean (* GetDeleteStatus) (struct gl2_generic_intf **);
- const GLcharARB *(* GetInfoLog) (struct gl2_generic_intf **);
-};
-
-struct gl2_container_intf
-{
- struct gl2_generic_intf _generic;
- GLboolean (* Attach) (struct gl2_container_intf **, struct gl2_generic_intf **);
- GLboolean (* Detach) (struct gl2_container_intf **, struct gl2_generic_intf **);
- GLsizei (* GetAttachedCount) (struct gl2_container_intf **);
- struct gl2_generic_intf **(* GetAttached) (struct gl2_container_intf **, GLuint);
-};
-
-struct gl2_shader_intf
-{
- struct gl2_generic_intf _generic;
- GLenum (* GetSubType) (struct gl2_shader_intf **);
- GLboolean (* GetCompileStatus) (struct gl2_shader_intf **);
- GLvoid (* SetSource) (struct gl2_shader_intf **, GLcharARB *, GLint *, GLsizei);
- const GLcharARB *(* GetSource) (struct gl2_shader_intf **);
- GLvoid (* Compile) (struct gl2_shader_intf **);
-};
-
-struct gl2_program_intf
-{
- struct gl2_container_intf _container;
- GLboolean (* GetLinkStatus) (struct gl2_program_intf **);
- GLboolean (* GetValidateStatus) (struct gl2_program_intf **);
- GLvoid (* Link) (struct gl2_program_intf **);
- GLvoid (* Validate) (struct gl2_program_intf **);
-};
-
-struct gl2_fragment_shader_intf
-{
- struct gl2_shader_intf _shader;
-};
-
-struct gl2_vertex_shader_intf
-{
- struct gl2_shader_intf _shader;
-};
-
-struct gl2_3dlabs_shhandle_intf
-{
- struct gl2_unknown_intf _unknown;
- GLvoid *(* GetShHandle) (struct gl2_3dlabs_shhandle_intf **);
-};
-
struct gl_shader_objects_state
{
struct gl2_program_intf **current_program;
#if FEATURE_ARB_fragment_program
struct program *DefaultFragmentProgram;
#endif
+ /*@}*/
+
#if FEATURE_ATI_fragment_shader
- struct program *DefaultFragmentShader;
+ struct _mesa_HashTable *ATIShaders;
+ struct ati_fragment_shader *DefaultFragmentShader;
#endif
- /*@}*/
#if FEATURE_ARB_vertex_buffer_object || FEATURE_ARB_pixel_buffer_object
struct _mesa_HashTable *BufferObjects;
struct gl_renderbuffer *_ColorDrawBuffers[MAX_DRAW_BUFFERS][4];
struct gl_renderbuffer *_ColorReadBuffer;
+ /** The Actual depth/stencil buffers to use. May be wrappers around the
+ * depth/stencil buffers attached above. */
+ struct gl_renderbuffer *_DepthBuffer;
+ struct gl_renderbuffer *_StencilBuffer;
+
/** Delete this framebuffer */
void (*Delete)(struct gl_framebuffer *fb);
};
GLboolean EXT_draw_range_elements;
GLboolean EXT_framebuffer_object;
GLboolean EXT_fog_coord;
+ GLboolean EXT_framebuffer_blit;
GLboolean EXT_histogram;
GLboolean EXT_multi_draw_arrays;
GLboolean EXT_paletted_texture;
GLboolean SGI_color_table;
GLboolean SGI_texture_color_table;
GLboolean SGIS_generate_mipmap;
- GLboolean SGIS_pixel_texture;
GLboolean SGIS_texture_edge_clamp;
GLboolean SGIS_texture_lod;
GLboolean SGIX_depth_texture;
- GLboolean SGIX_pixel_texture;
GLboolean SGIX_shadow;
GLboolean SGIX_shadow_ambient; /* or GL_ARB_shadow_ambient */
GLboolean TDFX_texture_compression_FXT1;
struct fragment_program *_TexEnvProgram; /**< Texture state as fragment program */
struct vertex_program *_TnlProgram; /**< Fixed func TNL state as vertex program */
- GLboolean _MaintainTexEnvProgram;
GLboolean _MaintainTnlProgram;
+ GLboolean _MaintainTexEnvProgram;
+ GLboolean _UseTexEnvProgram;
struct gl_query_state Query; /**< GL_ARB_occlusion_query */
* We don't have a better way to communicate this value from
* swrast_setup to swrast. */
- /** \name Color clamping (tentative part of GL_ARB_color_clamp_control) */
- /*@{*/
- GLboolean ClampFragmentColors;
- GLboolean ClampVertexColors;
- /*@}*/
-
/** \name For debugging/development only */
/*@{*/
GLboolean FirstTimeCurrent;
extern const char *_mesa_prim_name[GL_POLYGON+4];
-#ifdef MESA_DEBUG
+#ifdef DEBUG
extern int MESA_VERBOSE;
extern int MESA_DEBUG_FLAGS;
# define MESA_FUNCTION __FUNCTION__