📄 mtypes.h
字号:
struct gl_2d_map Map2Texture2;
struct gl_2d_map Map2Texture3;
struct gl_2d_map Map2Texture4;
struct gl_2d_map Map2Attrib[16]; /**< GL_NV_vertex_program */
/*@}*/
};
/**
* NV_fragment_program runtime state
*/
struct fp_machine
{
GLfloat Temporaries[MAX_NV_FRAGMENT_PROGRAM_TEMPS][4];
GLfloat Inputs[MAX_NV_FRAGMENT_PROGRAM_INPUTS][4];
GLfloat Outputs[MAX_NV_FRAGMENT_PROGRAM_OUTPUTS][4];
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 register files
*/
enum register_file
{
PROGRAM_TEMPORARY,
PROGRAM_INPUT,
PROGRAM_OUTPUT,
PROGRAM_LOCAL_PARAM,
PROGRAM_ENV_PARAM,
PROGRAM_NAMED_PARAM,
PROGRAM_STATE_VAR,
PROGRAM_WRITE_ONLY,
PROGRAM_ADDRESS,
PROGRAM_UNDEFINED /* invalid value */
};
/** Vertex and fragment instructions */
struct vp_instruction;
struct fp_instruction;
struct atifs_instruction;
struct program_parameter_list;
/**
* Base class for any kind of program object
*/
struct program
{
GLuint Id;
GLubyte *String; /**< Null-terminated program text */
GLint RefCount;
GLenum Target;
GLenum Format; /**< String encoding format */
GLboolean Resident;
GLfloat LocalParams[MAX_PROGRAM_LOCAL_PARAMS][4];
GLuint NumInstructions; /* GL_ARB_vertex/fragment_program */
GLuint NumTemporaries;
GLuint NumParameters;
GLuint NumAttributes;
GLuint NumAddressRegs;
};
/** Vertex program object */
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 */
GLuint InputsRead; /* Bitmask of which input regs are read */
GLuint OutputsWritten; /* Bitmask of which output regs are written to */
struct program_parameter_list *Parameters; /**< array [NumParameters] */
void *TnlData; /* should probably use Base.DriverData */
};
/** Fragment program object */
struct fragment_program
{
struct program Base; /**< base class */
struct fp_instruction *Instructions; /**< Compiled instructions */
GLuint InputsRead; /**< Bitmask of which input regs are read */
GLuint OutputsWritten; /**< Bitmask of which output regs are written to */
GLuint TexturesUsed[MAX_TEXTURE_IMAGE_UNITS]; /**< TEXTURE_x_INDEX bitmask */
GLuint NumAluInstructions; /**< GL_ARB_fragment_program */
GLuint NumTexInstructions;
GLuint NumTexIndirections;
GLenum FogOption;
struct program_parameter_list *Parameters; /**< array [NumParameters] */
#ifdef USE_TCC
char c_str[4096]; /* experimental... */
int c_strlen;
#endif
};
struct ati_fragment_shader
{
struct program Base;
struct atifs_instruction *Instructions;
GLfloat Constants[8][4];
GLint NumPasses;
GLint cur_pass;
};
/**
* State common to vertex and fragment programs.
*/
struct gl_program_state
{
GLint ErrorPos; /* GL_PROGRAM_ERROR_POSITION_NV */
const char *ErrorString; /* GL_PROGRAM_ERROR_STRING_NV */
};
/**
* State vars for GL_ARB/GL_NV_vertex_program
*/
struct gl_vertex_program_state
{
GLboolean Enabled; /**< GL_VERTEX_PROGRAM_NV */
GLboolean _Enabled; /**< Really enabled? */
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 */
GLenum TrackMatrix[MAX_NV_VERTEX_PROGRAM_PARAMS / 4];
GLenum TrackMatrixTransform[MAX_NV_VERTEX_PROGRAM_PARAMS / 4];
GLfloat Parameters[MAX_NV_VERTEX_PROGRAM_PARAMS][4]; /* Env params */
/* Only used during program execution (may be moved someday): */
GLfloat Temporaries[MAX_NV_VERTEX_PROGRAM_TEMPS][4];
GLfloat Inputs[MAX_NV_VERTEX_PROGRAM_INPUTS][4];
GLuint InputsSize[MAX_NV_VERTEX_PROGRAM_INPUTS];
GLfloat Outputs[MAX_NV_VERTEX_PROGRAM_OUTPUTS][4];
GLint AddressReg[4];
#if FEATURE_MESA_program_debug
GLprogramcallbackMESA Callback;
GLvoid *CallbackData;
GLboolean CallbackEnabled;
GLuint CurrentPosition;
#endif
};
/*
* 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? */
struct fragment_program *Current; /* ptr to currently bound program */
struct fragment_program *_Current; /* ptr to currently active program */
struct fp_machine Machine; /* machine state */
GLfloat Parameters[MAX_NV_FRAGMENT_PROGRAM_PARAMS][4]; /* Env params */
#if FEATURE_MESA_program_debug
GLprogramcallbackMESA Callback;
GLvoid *CallbackData;
GLboolean CallbackEnabled;
GLuint CurrentPosition;
#endif
};
/*
* State for GL_fragment_shader
*/
struct gl_ati_fragment_shader_state
{
GLboolean Enabled;
GLboolean _Enabled;
GLboolean Compiling;
struct atifs_machine Machine; /* machine state */
struct ati_fragment_shader *Current;
};
/*
* State for GL_ARB_occlusion_query
*/
struct gl_occlusion_state
{
GLboolean Active;
GLuint CurrentQueryObject;
GLuint PassedCounter;
struct _mesa_HashTable *QueryObjects;
};
/**
* gl2 unique interface identifier.
* Each gl2 interface has its own interface id used for object queries.
*/
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;
};
/**
* State which can be shared by multiple contexts:
*/
struct gl_shared_state
{
_glthread_Mutex Mutex; /**< for thread safety */
GLint RefCount; /**< Reference count */
struct _mesa_HashTable *DisplayList; /**< Display lists hash table */
struct _mesa_HashTable *TexObjects; /**< Texture objects hash table */
/**
* \name Default texture objects (shared by all multi-texture units)
*/
/*@{*/
struct gl_texture_object *Default1D;
struct gl_texture_object *Default2D;
struct gl_texture_object *Default3D;
struct gl_texture_object *DefaultCubeMap;
struct gl_texture_object *DefaultRect;
/*@}*/
/**
* \name Vertex/fragment programs
*/
/*@{*/
struct _mesa_HashTable *Programs;
#if FEATURE_ARB_vertex_program
struct program *DefaultVertexProgram;
#endif
#if FEATURE_ARB_fragment_program
struct program *DefaultFragmentProgram;
#endif
#if FEATURE_ATI_fragment_shader
struct program *DefaultFragmentShader;
#endif
/*@}*/
#if FEATURE_ARB_vertex_buffer_object || FEATURE_ARB_pixel_buffer_object
struct _mesa_HashTable *BufferObjects;
#endif
struct _mesa_HashTable *GL2Objects;
#if FEATURE_EXT_framebuffer_object
struct _mesa_HashTable *RenderBuffers;
struct _mesa_HashTable *FrameBuffers;
#endif
void *DriverData; /**< Device driver shared state */
};
/**
* A renderbuffer stores colors or depth values or stencil values.
* A framebuffer object will have a collection of these.
* Data are read/written to the buffer with a handful of Get/Put functions.
*
* Instances of this object are allocated with the Driver's NewRenderbuffer
* hook. Drivers will likely wrap this class inside a driver-specific
* class to simulate inheritance.
*/
struct gl_renderbuffer
{
GLuint Name;
GLint RefCount;
GLuint Width, Height;
GLenum InternalFormat; /* The user-specified value */
GLenum _BaseFormat; /* Either GL_RGB, GL_RGBA, GL_DEPTH_COMPONENT or */
/* GL_STENCIL_INDEX. */
GLenum DataType; /* Type of values passed to the Get/Put functions */
GLubyte ComponentSizes[4]; /* bits per component or channel */
GLvoid *Data;
/* Used to wrap one renderbuffer around another: */
struct gl_renderbuffer *Wrapped;
/* Delete this renderbuffer */
void (*Delete)(struct gl_renderbuffer *rb);
/* Allocate new storage for this renderbuffer */
GLboolean (*AllocStorage)(GLcontext *ctx, struct gl_renderbuffer *rb,
GLenum internalFormat,
GLuint width, GLuint height);
/* Lock/Unlock are called before/after calling the Get/Put functions.
* Not sure this is the right place for these yet.
void (*Lock)(GLcontext *ctx, struct gl_renderbuffer *rb);
void (*Unlock)(GLcontext *ctx, struct gl_renderbuffer *rb);
*/
/* Return a pointer to the element/pixel at (x,y).
* Should return NULL if the buffer memory can't be directly addressed.
*/
void *(*GetPointer)(GLcontext *ctx, struct gl_renderbuffer *rb,
GLint x, GLint y);
/* Get/Read a row of values.
* The values will be of format _BaseFormat and type DataType.
*/
void (*GetRow)(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
GLint x, GLint y, void *values);
/* Get/Read values at arbitrary locations.
* The values will be of format _BaseFormat and type DataType.
*/
void (*GetValues)(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
const GLint x[], const GLint y[], void *values);
/* Put/Write a row of values.
* The values will be of format _BaseFormat and type DataType.
*/
void (*PutRow)(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
GLint x, GLint y, const void *values, const GLubyte *mask);
/* Put/Write a row of RGB values. This is a special-case routine that's
* only used for RGBA renderbuffers when the source data is GL_RGB. That's
* a common case for glDrawPixels and some triangle routines.
* The values will be of format GL_RGB and type DataType.
*/
void (*PutRowRGB)(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
GLint x, GLint y, const void *values, const GLubyte *mask);
/* Put/Write a row of identical values.
* The values will be of format _BaseFormat and type DataType.
*/
void (*PutMonoRow)(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
GLint x, GLint y, const void *value, const GLubyte *mask);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -