* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "main/glheader.h"
#include "main/config.h"
-#include "main/mfeatures.h"
#include "glapi/glapi.h"
#include "math/m_matrix.h" /* GLmatrix */
#include "main/simple_list.h" /* struct simple_node */
* VERT_ATTRIB_TEX
* include the classic texture coordinate attributes.
* Is a subset of VERT_ATTRIB_FF.
- * VERT_ATTRIB_GENERIC_NV
- * include the NV shader attributes.
- * Is a subset of VERT_ATTRIB_FF.
* VERT_ATTRIB_GENERIC
* include the OpenGL 2.0+ GLSL generic shader attributes.
* These alias the generic GL_ARB_vertex_shader attributes.
#define VERT_ATTRIB_TEX(i) (VERT_ATTRIB_TEX0 + (i))
#define VERT_ATTRIB_TEX_MAX MAX_TEXTURE_COORD_UNITS
-#define VERT_ATTRIB_GENERIC_NV(i) (VERT_ATTRIB_POS + (i))
-#define VERT_ATTRIB_GENERIC_NV_MAX MAX_VERTEX_GENERIC_ATTRIBS
-
#define VERT_ATTRIB_GENERIC(i) (VERT_ATTRIB_GENERIC0 + (i))
#define VERT_ATTRIB_GENERIC_MAX MAX_VERTEX_GENERIC_ATTRIBS
#define VERT_BIT_TEX_ALL \
BITFIELD64_RANGE(VERT_ATTRIB_TEX(0), VERT_ATTRIB_TEX_MAX)
-#define VERT_BIT_GENERIC_NV(i) VERT_BIT(VERT_ATTRIB_GENERIC_NV(i))
-#define VERT_BIT_GENERIC_NV_ALL \
- BITFIELD64_RANGE(VERT_ATTRIB_GENERIC_NV(0), VERT_ATTRIB_GENERIC_NV_MAX)
-
#define VERT_BIT_GENERIC(i) VERT_BIT(VERT_ATTRIB_GENERIC(i))
#define VERT_BIT_GENERIC_ALL \
BITFIELD64_RANGE(VERT_ATTRIB_GENERIC(0), VERT_ATTRIB_GENERIC_MAX)
/*********************************************/
-/**
- * Indexes for fragment program input attributes.
- */
-typedef enum
-{
- FRAG_ATTRIB_WPOS = VARYING_SLOT_POS,
- FRAG_ATTRIB_COL0 = VARYING_SLOT_COL0,
- FRAG_ATTRIB_COL1 = VARYING_SLOT_COL1,
- FRAG_ATTRIB_FOGC = VARYING_SLOT_FOGC,
- FRAG_ATTRIB_TEX0 = VARYING_SLOT_TEX0,
- FRAG_ATTRIB_TEX1 = VARYING_SLOT_TEX1,
- FRAG_ATTRIB_TEX2 = VARYING_SLOT_TEX2,
- FRAG_ATTRIB_TEX3 = VARYING_SLOT_TEX3,
- FRAG_ATTRIB_TEX4 = VARYING_SLOT_TEX4,
- FRAG_ATTRIB_TEX5 = VARYING_SLOT_TEX5,
- FRAG_ATTRIB_TEX6 = VARYING_SLOT_TEX6,
- FRAG_ATTRIB_TEX7 = VARYING_SLOT_TEX7,
- FRAG_ATTRIB_FACE = VARYING_SLOT_FACE, /**< front/back face */
- FRAG_ATTRIB_PNTC = VARYING_SLOT_PNTC, /**< sprite/point coord */
- FRAG_ATTRIB_CLIP_DIST0 = VARYING_SLOT_CLIP_DIST0,
- FRAG_ATTRIB_CLIP_DIST1 = VARYING_SLOT_CLIP_DIST1,
- FRAG_ATTRIB_VAR0 = VARYING_SLOT_VAR0, /**< shader varying */
- FRAG_ATTRIB_MAX = VARYING_SLOT_MAX
-} gl_frag_attrib;
-
-
/**
* Determine if the given gl_varying_slot appears in the fragment shader.
*/
}
-/**
- * Bitflags for fragment program input attributes.
- */
-/*@{*/
-#define FRAG_BIT_WPOS (1 << FRAG_ATTRIB_WPOS)
-#define FRAG_BIT_COL0 (1 << FRAG_ATTRIB_COL0)
-#define FRAG_BIT_COL1 (1 << FRAG_ATTRIB_COL1)
-#define FRAG_BIT_FOGC (1 << FRAG_ATTRIB_FOGC)
-#define FRAG_BIT_FACE (1 << FRAG_ATTRIB_FACE)
-#define FRAG_BIT_PNTC (1 << FRAG_ATTRIB_PNTC)
-#define FRAG_BIT_TEX0 (1 << FRAG_ATTRIB_TEX0)
-#define FRAG_BIT_TEX1 (1 << FRAG_ATTRIB_TEX1)
-#define FRAG_BIT_TEX2 (1 << FRAG_ATTRIB_TEX2)
-#define FRAG_BIT_TEX3 (1 << FRAG_ATTRIB_TEX3)
-#define FRAG_BIT_TEX4 (1 << FRAG_ATTRIB_TEX4)
-#define FRAG_BIT_TEX5 (1 << FRAG_ATTRIB_TEX5)
-#define FRAG_BIT_TEX6 (1 << FRAG_ATTRIB_TEX6)
-#define FRAG_BIT_TEX7 (1 << FRAG_ATTRIB_TEX7)
-#define FRAG_BIT_VAR0 (1 << FRAG_ATTRIB_VAR0)
-
-#define FRAG_BIT_TEX(U) (FRAG_BIT_TEX0 << (U))
-#define FRAG_BIT_VAR(V) (FRAG_BIT_VAR0 << (V))
-
-#define FRAG_BITS_TEX_ANY (FRAG_BIT_TEX0| \
- FRAG_BIT_TEX1| \
- FRAG_BIT_TEX2| \
- FRAG_BIT_TEX3| \
- FRAG_BIT_TEX4| \
- FRAG_BIT_TEX5| \
- FRAG_BIT_TEX6| \
- FRAG_BIT_TEX7)
-/*@}*/
-
-
/**
* Fragment program results
*/
GLenum ClampFragmentColor; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */
GLboolean _ClampFragmentColor; /** < with GL_FIXED_ONLY_ARB resolved */
GLenum ClampReadColor; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */
- GLboolean _ClampReadColor; /** < with GL_FIXED_ONLY_ARB resolved */
GLboolean sRGBEnabled; /**< Framebuffer sRGB blending/updating requested */
};
GLboolean TestTwoSide; /**< GL_EXT_stencil_two_side */
GLubyte ActiveFace; /**< GL_EXT_stencil_two_side (0 or 2) */
GLboolean _Enabled; /**< Enabled and stencil buffer present */
+ GLboolean _WriteEnabled; /**< _Enabled and non-zero writemasks */
GLboolean _TestTwoSide;
GLubyte _BackFace; /**< Current back stencil state (1 or 2) */
GLenum Function[3]; /**< Stencil function */
GLfloat Priority; /**< in [0,1] */
GLint BaseLevel; /**< min mipmap level, OpenGL 1.2 */
GLint MaxLevel; /**< max mipmap level, OpenGL 1.2 */
+ GLint ImmutableLevels; /**< ES 3.0 / ARB_texture_view */
GLint _MaxLevel; /**< actual max mipmap level (q in the spec) */
GLfloat _MaxLambda; /**< = _MaxLevel - BaseLevel (q - b in spec) */
GLint CropRect[4]; /**< GL_OES_draw_texture */
typedef enum
{
PROGRAM_TEMPORARY, /**< machine->Temporary[] */
+ PROGRAM_ARRAY, /**< Arrays & Matrixes */
PROGRAM_INPUT, /**< machine->Inputs[] */
PROGRAM_OUTPUT, /**< machine->Outputs[] */
PROGRAM_LOCAL_PARAM, /**< gl_program->LocalParams[] */
INTERP_QUALIFIER_NONE = 0,
INTERP_QUALIFIER_SMOOTH,
INTERP_QUALIFIER_FLAT,
- INTERP_QUALIFIER_NOPERSPECTIVE
+ INTERP_QUALIFIER_NOPERSPECTIVE,
+ INTERP_QUALIFIER_COUNT /**< Number of interpolation qualifiers */
};
* For inputs that do not have an interpolation qualifier specified in
* GLSL, the value is INTERP_QUALIFIER_NONE.
*/
- enum glsl_interp_qualifier InterpQualifier[FRAG_ATTRIB_MAX];
+ enum glsl_interp_qualifier InterpQualifier[VARYING_SLOT_MAX];
/**
* Bitfield indicating, for each fragment shader input, 1 if that input
/** Integer color values */
GLboolean _IntegerColor;
+ /* ARB_color_buffer_float */
+ GLboolean _AllColorBuffersFixedPoint; /* no integer, no float */
+ GLboolean _HasSNormOrFloatColorBuffer;
+
/** Array of all renderbuffer attachments, indexed by BUFFER_* tokens. */
struct gl_renderbuffer_attachment Attachment[BUFFER_COUNT];
GLboolean ARB_texture_float;
GLboolean ARB_texture_multisample;
GLboolean ARB_texture_non_power_of_two;
+ GLboolean ARB_texture_query_lod;
GLboolean ARB_texture_rg;
GLboolean ARB_texture_rgb10_a2ui;
GLboolean ARB_texture_storage;
+ GLboolean ARB_texture_storage_multisample;
GLboolean ARB_timer_query;
GLboolean ARB_transform_feedback2;
GLboolean ARB_transform_feedback3;
#define _NEW_TEXTURE (1 << 16) /**< gl_context::Texture */
#define _NEW_TRANSFORM (1 << 17) /**< gl_context::Transform */
#define _NEW_VIEWPORT (1 << 18) /**< gl_context::Viewport */
-#define _NEW_PACKUNPACK (1 << 19) /**< gl_context::Pack, Unpack */
+/* gap, re-use for core Mesa state only; use ctx->DriverFlags otherwise */
#define _NEW_ARRAY (1 << 20) /**< gl_context::Array */
#define _NEW_RENDERMODE (1 << 21) /**< gl_context::RenderMode, etc */
#define _NEW_BUFFERS (1 << 22) /**< gl_context::Visual, DrawBuffer, */
#define _NEW_PROGRAM_CONSTANTS (1 << 27)
#define _NEW_BUFFER_OBJECT (1 << 28)
#define _NEW_FRAG_CLAMP (1 << 29)
-#define _NEW_TRANSFORM_FEEDBACK (1 << 30) /**< gl_context::TransformFeedback */
+/* gap, re-use for core Mesa state only; use ctx->DriverFlags otherwise */
#define _NEW_VARYING_VP_INPUTS (1 << 31) /**< gl_context::varying_vp_inputs */
#define _NEW_ALL ~0
-
-/**
- * We use _NEW_TRANSFORM for GL_RASTERIZER_DISCARD. This #define is for
- * clarity.
- */
-#define _NEW_RASTERIZER_DISCARD _NEW_TRANSFORM
-/*@}*/
-
-
-/**
- * \name A bunch of flags that we think might be useful to drivers.
- *
- * Set in the __struct gl_contextRec::_TriangleCaps bitfield.
- */
-/*@{*/
-#define DD_SEPARATE_SPECULAR (1 << 0)
-#define DD_TRI_LIGHT_TWOSIDE (1 << 1)
-#define DD_TRI_UNFILLED (1 << 2)
-#define DD_TRI_SMOOTH (1 << 3)
-#define DD_TRI_STIPPLE (1 << 4)
-#define DD_TRI_OFFSET (1 << 5)
-#define DD_LINE_SMOOTH (1 << 6)
-#define DD_LINE_STIPPLE (1 << 7)
-#define DD_POINT_SMOOTH (1 << 8)
-#define DD_POINT_ATTEN (1 << 9)
/*@}*/
*/
struct gl_driver_flags
{
- GLbitfield NewArray; /**< Vertex array state */
+ /** gl_context::Array::_DrawArrays (vertex array state) */
+ GLbitfield NewArray;
+
+ /** gl_context::TransformFeedback::CurrentObject */
+ GLbitfield NewTransformFeedback;
+
+ /** gl_context::RasterDiscard */
+ GLbitfield NewRasterizerDiscard;
};
struct gl_uniform_buffer_binding
GLbitfield64 varying_vp_inputs; /**< mask of VERT_BIT_* flags */
/** \name Derived state */
- /*@{*/
- /** Bitwise-or of DD_* flags. Note that this bitfield may be used before
- * state validation so they need to always be current.
- */
- GLbitfield _TriangleCaps;
GLbitfield _ImageTransferState;/**< bitwise-or of IMAGE_*_BIT flags */
GLfloat _EyeZDir[3];
GLfloat _ModelViewInvScale;