#include "main/config.h"
#include "glapi/glapi.h"
#include "math/m_matrix.h" /* GLmatrix */
-#include "util/simple_list.h" /* struct simple_node */
+#include "glsl/shader_enums.h"
#include "main/formats.h" /* MESA_FORMAT_COUNT */
#define VARYING_BIT_VAR(V) BITFIELD64_BIT(VARYING_SLOT_VAR0 + (V))
/*@}*/
-/**
- * Bitflags for system values.
- */
-#define SYSTEM_BIT_SAMPLE_ID BITFIELD64_BIT(SYSTEM_VALUE_SAMPLE_ID)
-#define SYSTEM_BIT_SAMPLE_POS BITFIELD64_BIT(SYSTEM_VALUE_SAMPLE_POS)
-#define SYSTEM_BIT_SAMPLE_MASK_IN BITFIELD64_BIT(SYSTEM_VALUE_SAMPLE_MASK_IN)
-
/**
* Determine if the given gl_varying_slot appears in the fragment shader.
*/
BUFFER_BIT_COLOR6 | \
BUFFER_BIT_COLOR7)
-
-/**
- * Shader stages. Note that these will become 5 with tessellation.
- *
- * The order must match how shaders are ordered in the pipeline.
- * The GLSL linker assumes that if i<j, then the j-th shader is
- * executed later than the i-th shader.
- */
-typedef enum
-{
- MESA_SHADER_VERTEX = 0,
- MESA_SHADER_GEOMETRY = 1,
- MESA_SHADER_FRAGMENT = 2,
- MESA_SHADER_COMPUTE = 3,
-} gl_shader_stage;
-
-#define MESA_SHADER_STAGES (MESA_SHADER_COMPUTE + 1)
-
-
/**
* Framebuffer configuration (aka visual / pixelformat)
* Note: some of these fields should be boolean, but it appears that
{
GLboolean rgbMode;
GLboolean floatMode;
- GLboolean colorIndexMode; /* XXX is this used anywhere? */
GLuint doubleBufferMode;
GLuint stereoMode;
* \name Logic op
*/
/*@{*/
- GLenum LogicOp; /**< Logic operator */
GLboolean IndexLogicOpEnabled; /**< Color index logic op enabled flag */
GLboolean ColorLogicOpEnabled; /**< RGBA logic op enabled flag */
+ GLenum LogicOp; /**< Logic operator */
+
/*@}*/
GLboolean DitherFlag; /**< Dither enable flag */
- GLenum ClampFragmentColor; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */
GLboolean _ClampFragmentColor; /** < with GL_FIXED_ONLY_ARB resolved */
+ GLenum ClampFragmentColor; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */
GLenum ClampReadColor; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */
GLboolean sRGBEnabled; /**< Framebuffer sRGB blending/updating requested */
* \note Index and Edgeflag current values are stored as floats in the
* SIX and SEVEN attribute slots.
*/
- GLfloat Attrib[VERT_ATTRIB_MAX][4]; /**< Position, color, texcoords, etc */
+ /* we need double storage for this for vertex attrib 64bit */
+ GLfloat Attrib[VERT_ATTRIB_MAX][4*2]; /**< Position, color, texcoords, etc */
/**
* \name Current raster position attributes (always valid).
struct gl_fog_attrib
{
GLboolean Enabled; /**< Fog enabled flag */
+ GLboolean ColorSumEnabled;
GLfloat ColorUnclamped[4]; /**< Fog color */
GLfloat Color[4]; /**< Fog color */
GLfloat Density; /**< Density >= 0.0 */
GLfloat End; /**< End distance in eye coords */
GLfloat Index; /**< Fog index */
GLenum Mode; /**< Fog mode */
- GLboolean ColorSumEnabled;
GLenum FogCoordinateSource; /**< GL_EXT_fog_coord */
GLfloat _Scale; /**< (End == Start) ? 1.0 : 1.0 / (End - Start) */
GLenum FogDistanceMode; /**< GL_NV_fog_distance */
struct gl_material Material;
GLboolean Enabled; /**< Lighting enabled flag */
+ GLboolean ColorMaterialEnabled;
+
GLenum ShadeModel; /**< GL_FLAT or GL_SMOOTH */
GLenum ProvokingVertex; /**< GL_EXT_provoking_vertex */
GLenum ColorMaterialFace; /**< GL_FRONT, BACK or FRONT_AND_BACK */
GLenum ColorMaterialMode; /**< GL_AMBIENT, GL_DIFFUSE, etc */
GLbitfield _ColorMaterialBitmask; /**< bitmask formed from Face and Mode */
- GLboolean ColorMaterialEnabled;
- GLenum ClampVertexColor; /**< GL_TRUE, GL_FALSE, GL_FIXED_ONLY */
- GLboolean _ClampVertexColor;
- struct gl_light EnabledList; /**< List sentinel */
+
+ GLboolean _ClampVertexColor;
+ GLenum ClampVertexColor; /**< GL_TRUE, GL_FALSE, GL_FIXED_ONLY */
/**
* Derived state for optimizations:
/*@{*/
GLboolean _NeedEyeCoords;
GLboolean _NeedVertices; /**< Use fast shader? */
+ struct gl_light EnabledList; /**< List sentinel */
+
GLfloat _BaseColor[2][3];
/*@}*/
};
GLboolean SampleAlphaToCoverage;
GLboolean SampleAlphaToOne;
GLboolean SampleCoverage;
- GLfloat SampleCoverageValue;
GLboolean SampleCoverageInvert;
GLboolean SampleShading;
- GLfloat MinSampleShadingValue;
/* ARB_texture_multisample / GL3.2 additions */
GLboolean SampleMask;
+
+ GLfloat SampleCoverageValue;
+ GLfloat MinSampleShadingValue;
+
/** The GL spec defines this as an array but >32x MSAA is madness */
GLbitfield SampleMaskValue;
};
*/
struct gl_point_attrib
{
- GLboolean SmoothFlag; /**< True if GL_POINT_SMOOTH is enabled */
GLfloat Size; /**< User-specified point size */
GLfloat Params[3]; /**< GL_EXT_point_parameters */
GLfloat MinSize, MaxSize; /**< GL_EXT_point_parameters */
GLfloat Threshold; /**< GL_EXT_point_parameters */
+ GLboolean SmoothFlag; /**< True if GL_POINT_SMOOTH is enabled */
GLboolean _Attenuated; /**< True if Params != [1, 0, 0] */
GLboolean PointSprite; /**< GL_NV/ARB_point_sprite */
GLboolean CoordReplace[MAX_TEXTURE_COORD_UNITS]; /**< GL_ARB_point_sprite*/
GLfloat LodBias; /**< for biasing mipmap levels */
+ /** Texture targets that have a non-default texture bound */
+ GLbitfield _BoundTextures;
+
/** Current sampler object (GL_ARB_sampler_objects) */
struct gl_sampler_object *Sampler;
/** Points to highest priority, complete and enabled texture object */
struct gl_texture_object *_Current;
- /** Texture targets that have a non-default texture bound */
- GLbitfield _BoundTextures;
};
struct gl_texture_attrib
{
GLuint CurrentUnit; /**< GL_ACTIVE_TEXTURE */
- struct gl_texture_unit Unit[MAX_COMBINED_TEXTURE_IMAGE_UNITS];
+
+ /** GL_ARB_seamless_cubemap */
+ GLboolean CubeMapSeamless;
struct gl_texture_object *ProxyTex[NUM_TEXTURE_TARGETS];
/** GL_ARB_texture_buffer_object */
struct gl_buffer_object *BufferObject;
- /** GL_ARB_seamless_cubemap */
- GLboolean CubeMapSeamless;
-
/** Texture coord units/sets used for fragment texturing */
GLbitfield _EnabledCoordUnits;
/** Largest index + 1 of texture units that have had any CurrentTex set. */
GLint NumCurrentTexUsed;
+
+ struct gl_texture_unit Unit[MAX_COMBINED_TEXTURE_IMAGE_UNITS];
};
GLfloat X, Y; /**< position */
GLfloat Width, Height; /**< size */
GLdouble Near, Far; /**< Depth buffer range */
- GLmatrix _WindowMap; /**< Mapping transformation as a matrix. */
};
GLenum Format; /**< default: GL_RGBA, but may be GL_BGRA */
GLsizei Stride; /**< user-specified stride */
GLsizei StrideB; /**< actual stride in bytes */
+ GLuint _ElementSize; /**< size of each element in bytes */
const GLubyte *Ptr; /**< Points to array data */
GLboolean Enabled; /**< Enabled flag is a boolean */
GLboolean Normalized; /**< GL_ARB_vertex_program */
GLboolean Integer; /**< Integer-valued? */
+ GLboolean Doubles; /**< double precision values are not converted to floats */
GLuint InstanceDivisor; /**< GL_ARB_instanced_arrays */
- GLuint _ElementSize; /**< size of each element in bytes */
struct gl_buffer_object *BufferObj;/**< GL_ARB_vertex_buffer_object */
};
GLboolean Enabled; /**< Whether the array is enabled */
GLboolean Normalized; /**< Fixed-point values are normalized when converted to floats */
GLboolean Integer; /**< Fixed-point values are not converted to floats */
+ GLboolean Doubles; /**< double precision values are not converted to floats */
GLuint _ElementSize; /**< Size of each element in bytes */
GLuint VertexBinding; /**< Vertex buffer binding */
};
{
/** Name of the VAO as received from glGenVertexArray. */
GLuint Name;
- GLchar *Label; /**< GL_KHR_debug */
GLint RefCount;
+
+ GLchar *Label; /**< GL_KHR_debug */
+
mtx_t Mutex;
/**
/** The default vertex array object */
struct gl_vertex_array_object *DefaultVAO;
+ /** The last VAO accessed by a DSA function */
+ struct gl_vertex_array_object *LastLookedUpVAO;
+
/** Array objects (GL_ARB/APPLE_vertex_array_object) */
struct _mesa_HashTable *Objects;
GLuint RestartIndex;
/*@}*/
+ /** One of the DRAW_xxx flags, not consumed by drivers */
+ gl_draw_method DrawMethod;
+
/* GL_ARB_vertex_buffer_object */
struct gl_buffer_object *ArrayBufferObj;
*/
const struct gl_client_array **_DrawArrays; /**< 0..VERT_ATTRIB_MAX-1 */
- /** One of the DRAW_xxx flags, not consumed by drivers */
- gl_draw_method DrawMethod;
-
/** Legal array datatypes and the API for which they have been computed */
GLbitfield LegalTypesMask;
gl_api LegalTypesMaskAPI;
struct gl_transform_feedback_object
{
GLuint Name; /**< AKA the object ID */
- GLchar *Label; /**< GL_KHR_debug */
GLint RefCount;
+ GLchar *Label; /**< GL_KHR_debug */
GLboolean Active; /**< Is transform feedback enabled? */
GLboolean Paused; /**< Is transform feedback paused? */
GLboolean EndedAnytime; /**< Has EndTransformFeedback been called
at least once? */
GLboolean EverBound; /**< Has this object been bound? */
- /**
- * The shader program active when BeginTransformFeedback() was called.
- * When active and unpaused, this equals ctx->Shader.CurrentProgram[stage],
- * where stage is the pipeline stage that is the source of data for
- * transform feedback.
- */
- struct gl_shader_program *shader_program;
-
/**
* GLES: if Active is true, remaining number of primitives which can be
* rendered without overflow. This is necessary to track because GLES
*/
unsigned GlesRemainingPrims;
+ /**
+ * The shader program active when BeginTransformFeedback() was called.
+ * When active and unpaused, this equals ctx->Shader.CurrentProgram[stage],
+ * where stage is the pipeline stage that is the source of data for
+ * transform feedback.
+ */
+ struct gl_shader_program *shader_program;
+
/** The feedback buffers */
GLuint BufferNames[MAX_FEEDBACK_BUFFERS];
struct gl_buffer_object *Buffers[MAX_FEEDBACK_BUFFERS];
} gl_register_file;
-/**
- * If the register file is PROGRAM_SYSTEM_VALUE, the register index will be
- * one of these values.
- */
-typedef enum
-{
- /**
- * \name Vertex shader system values
- */
- /*@{*/
- /**
- * OpenGL-style vertex ID.
- *
- * Section 2.11.7 (Shader Execution), subsection Shader Inputs, of the
- * OpenGL 3.3 core profile spec says:
- *
- * "gl_VertexID holds the integer index i implicitly passed by
- * DrawArrays or one of the other drawing commands defined in section
- * 2.8.3."
- *
- * Section 2.8.3 (Drawing Commands) of the same spec says:
- *
- * "The commands....are equivalent to the commands with the same base
- * name (without the BaseVertex suffix), except that the ith element
- * transferred by the corresponding draw call will be taken from
- * element indices[i] + basevertex of each enabled array."
- *
- * Additionally, the overview in the GL_ARB_shader_draw_parameters spec
- * says:
- *
- * "In unextended GL, vertex shaders have inputs named gl_VertexID and
- * gl_InstanceID, which contain, respectively the index of the vertex
- * and instance. The value of gl_VertexID is the implicitly passed
- * index of the vertex being processed, which includes the value of
- * baseVertex, for those commands that accept it."
- *
- * gl_VertexID gets basevertex added in. This differs from DirectX where
- * SV_VertexID does \b not get basevertex added in.
- *
- * \note
- * If all system values are available, \c SYSTEM_VALUE_VERTEX_ID will be
- * equal to \c SYSTEM_VALUE_VERTEX_ID_ZERO_BASE plus
- * \c SYSTEM_VALUE_BASE_VERTEX.
- *
- * \sa SYSTEM_VALUE_VERTEX_ID_ZERO_BASE, SYSTEM_VALUE_BASE_VERTEX
- */
- SYSTEM_VALUE_VERTEX_ID,
-
- /**
- * Instanced ID as supplied to gl_InstanceID
- *
- * Values assigned to gl_InstanceID always begin with zero, regardless of
- * the value of baseinstance.
- *
- * Section 11.1.3.9 (Shader Inputs) of the OpenGL 4.4 core profile spec
- * says:
- *
- * "gl_InstanceID holds the integer instance number of the current
- * primitive in an instanced draw call (see section 10.5)."
- *
- * Through a big chain of pseudocode, section 10.5 describes that
- * baseinstance is not counted by gl_InstanceID. In that section, notice
- *
- * "If an enabled vertex attribute array is instanced (it has a
- * non-zero divisor as specified by VertexAttribDivisor), the element
- * index that is transferred to the GL, for all vertices, is given by
- *
- * floor(instance/divisor) + baseinstance
- *
- * If an array corresponding to an attribute required by a vertex
- * shader is not enabled, then the corresponding element is taken from
- * the current attribute state (see section 10.2)."
- *
- * Note that baseinstance is \b not included in the value of instance.
- */
- SYSTEM_VALUE_INSTANCE_ID,
-
- /**
- * DirectX-style vertex ID.
- *
- * Unlike \c SYSTEM_VALUE_VERTEX_ID, this system value does \b not include
- * the value of basevertex.
- *
- * \sa SYSTEM_VALUE_VERTEX_ID, SYSTEM_VALUE_BASE_VERTEX
- */
- SYSTEM_VALUE_VERTEX_ID_ZERO_BASE,
-
- /**
- * Value of \c basevertex passed to \c glDrawElementsBaseVertex and similar
- * functions.
- *
- * \sa SYSTEM_VALUE_VERTEX_ID, SYSTEM_VALUE_VERTEX_ID_ZERO_BASE
- */
- SYSTEM_VALUE_BASE_VERTEX,
- /*@}*/
-
- /**
- * \name Geometry shader system values
- */
- /*@{*/
- SYSTEM_VALUE_INVOCATION_ID,
- /*@}*/
-
- /**
- * \name Fragment shader system values
- */
- /*@{*/
- SYSTEM_VALUE_FRONT_FACE, /**< (not done yet) */
- SYSTEM_VALUE_SAMPLE_ID,
- SYSTEM_VALUE_SAMPLE_POS,
- SYSTEM_VALUE_SAMPLE_MASK_IN,
- /*@}*/
-
- SYSTEM_VALUE_MAX /**< Number of values */
-} gl_system_value;
-
-
-/**
- * The possible interpolation qualifiers that can be applied to a fragment
- * shader input in GLSL.
- *
- * Note: INTERP_QUALIFIER_NONE must be 0 so that memsetting the
- * gl_fragment_program data structure to 0 causes the default behavior.
- */
-enum glsl_interp_qualifier
-{
- INTERP_QUALIFIER_NONE = 0,
- INTERP_QUALIFIER_SMOOTH,
- INTERP_QUALIFIER_FLAT,
- INTERP_QUALIFIER_NOPERSPECTIVE,
- INTERP_QUALIFIER_COUNT /**< Number of interpolation qualifiers */
-};
-
-
/**
* \brief Layout qualifiers for gl_FragDepth.
*
struct gl_program
{
GLuint Id;
- GLubyte *String; /**< Null-terminated program text */
GLint RefCount;
+ GLubyte *String; /**< Null-terminated program text */
+
GLenum Target; /**< GL_VERTEX/FRAGMENT_PROGRAM_ARB, GL_GEOMETRY_PROGRAM_NV */
GLenum Format; /**< String encoding format */
struct prog_instruction *Instructions;
+ struct nir_shader *nir;
+
GLbitfield64 InputsRead; /**< Bitmask of which input regs are read */
+ GLbitfield64 DoubleInputsRead; /**< Bitmask of which input regs are read and are doubles */
GLbitfield64 OutputsWritten; /**< Bitmask of which output regs are written */
GLbitfield SystemValuesRead; /**< Bitmask of SYSTEM_VALUE_x inputs used */
- GLbitfield InputFlags[MAX_PROGRAM_INPUTS]; /**< PROG_PARAM_BIT_x flags */
- GLbitfield OutputFlags[MAX_PROGRAM_OUTPUTS]; /**< PROG_PARAM_BIT_x flags */
GLbitfield TexturesUsed[MAX_COMBINED_TEXTURE_IMAGE_UNITS]; /**< TEXTURE_x_BIT bitmask */
GLbitfield SamplersUsed; /**< Bitfield of which samplers are used */
GLbitfield ShadowSamplers; /**< Texture units used for shadow sampling. */
*/
struct gl_geometry_program_state
{
- GLboolean Enabled; /**< GL_ARB_GEOMETRY_SHADER4 */
- GLboolean _Enabled; /**< Enabled and valid program? */
- struct gl_geometry_program *Current; /**< user-bound geometry program */
-
/** Currently enabled and valid program (including internal programs
* and compiled shader programs).
*/
struct gl_geometry_program *_Current;
-
- GLfloat Parameters[MAX_PROGRAM_ENV_PARAMS][4]; /**< Env params */
};
/**
*/
struct gl_compute_program_state
{
- struct gl_compute_program *Current; /**< user-bound compute program */
-
/** Currently enabled and valid program (including internal programs
* and compiled shader programs).
*/
};
-/** Set by #pragma directives */
-struct gl_sl_pragmas
-{
- GLboolean IgnoreOptimize; /**< ignore #pragma optimize(on/off) ? */
- GLboolean IgnoreDebug; /**< ignore #pragma debug(on/off) ? */
- GLboolean Optimize; /**< defaults on */
- GLboolean Debug; /**< defaults off */
-};
-
-
/**
* A GLSL vertex or fragment shader object.
*/
GLenum Type;
gl_shader_stage Stage;
GLuint Name; /**< AKA the handle */
- GLchar *Label; /**< GL_KHR_debug */
GLint RefCount; /**< Reference count */
+ GLchar *Label; /**< GL_KHR_debug */
GLboolean DeletePending;
GLboolean CompileStatus;
- const GLchar *Source; /**< Source code string */
+ bool IsES; /**< True if this shader uses GLSL ES */
+
GLuint SourceChecksum; /**< for debug/logging purposes */
+ const GLchar *Source; /**< Source code string */
+
struct gl_program *Program; /**< Post-compile assembly code */
GLchar *InfoLog;
- struct gl_sl_pragmas Pragmas;
unsigned Version; /**< GLSL version used for linking */
- GLboolean IsES; /**< True if this shader uses GLSL ES */
/**
* \name Sampler tracking
*
* These fields are only set post-linking.
*/
- struct gl_uniform_block *UniformBlocks;
unsigned NumUniformBlocks;
+ struct gl_uniform_block *UniformBlocks;
struct exec_list *ir;
struct glsl_symbol_table *symbols;
*/
GLuint NumImages;
+ /**
+ * Whether early fragment tests are enabled as defined by
+ * ARB_shader_image_load_store.
+ */
+ bool EarlyFragmentTests;
+
/**
* Compute shader state from ARB_compute_shader layout qualifiers.
*/
GLboolean StageReferences[MESA_SHADER_STAGES];
};
+/**
+ * Active resource in a gl_shader_program
+ */
+struct gl_program_resource
+{
+ GLenum Type; /** Program interface type. */
+ const void *Data; /** Pointer to resource associated data structure. */
+ uint8_t StageReferences; /** Bitmask of shader stage references. */
+};
+
/**
* A GLSL program object.
* Basically a linked collection of vertex and fragment shaders.
} Comp;
/* post-link info: */
- unsigned NumUserUniformStorage;
+ unsigned NumUniformStorage;
unsigned NumHiddenUniforms;
struct gl_uniform_storage *UniformStorage;
*/
unsigned LastClipDistanceArraySize;
- struct gl_uniform_block *UniformBlocks;
unsigned NumUniformBlocks;
+ struct gl_uniform_block *UniformBlocks;
/**
* Indices into the _LinkedShaders's UniformBlocks[] array for each stage
GLchar *InfoLog;
unsigned Version; /**< GLSL version used for linking */
- GLboolean IsES; /**< True if this program uses GLSL ES */
+ bool IsES; /**< True if this program uses GLSL ES */
/**
* Per-stage shaders resulting from the first stage of linking.
*/
struct gl_shader *_LinkedShaders[MESA_SHADER_STAGES];
+ /** List of all active resources after linking. */
+ struct gl_program_resource *ProgramResourceList;
+ unsigned NumProgramResourceList;
+
/* True if any of the fragment shaders attached to this program use:
* #extension ARB_fragment_coord_conventions: enable
*/
mtx_t Mutex;
+ GLchar *Label; /**< GL_KHR_debug */
+
/**
* Programs used for rendering
*
GLboolean EmitNoIndirectOutput; /**< No indirect addressing of outputs */
GLboolean EmitNoIndirectTemp; /**< No indirect addressing of temps */
GLboolean EmitNoIndirectUniform; /**< No indirect addressing of constants */
+ GLboolean EmitNoIndirectSampler; /**< No indirect addressing of samplers */
/*@}*/
GLuint MaxIfDepth; /**< Maximum nested IF blocks */
*/
GLboolean OptimizeForAOS;
- struct gl_sl_pragmas DefaultPragmas; /**< Default #pragma settings */
-
- struct nir_shader_compiler_options *NirOptions;
+ const struct nir_shader_compiler_options *NirOptions;
};
struct _mesa_HashTable *Programs; /**< All vertex/fragment programs */
struct gl_vertex_program *DefaultVertexProgram;
struct gl_fragment_program *DefaultFragmentProgram;
- struct gl_geometry_program *DefaultGeometryProgram;
/*@}*/
/* GL_ATI_fragment_shader */
* polygon face orientation, and polygon stipple will have to be inverted.
*/
GLuint Name;
+ GLint RefCount;
+
GLchar *Label; /**< GL_KHR_debug */
- GLint RefCount;
GLboolean DeletePending;
/**
*/
struct gl_config Visual;
- GLuint Width, Height; /**< size of frame buffer in pixels */
+ /**
+ * Size of frame buffer in pixels. If there are no attachments, then both
+ * of these are 0.
+ */
+ GLuint Width, Height;
+
+ /**
+ * In the case that the framebuffer has no attachment (i.e.
+ * GL_ARB_framebuffer_no_attachments) then the geometry of
+ * the framebuffer is specified by the default values.
+ */
+ struct {
+ GLuint Width, Height, Layers, NumSamples;
+ GLboolean FixedSampleLocations;
+ } DefaultGeometry;
- /** \name Drawing bounds (Intersection of buffer size and scissor box) */
+ /** \name Drawing bounds (Intersection of buffer size and scissor box)
+ * The drawing region is given by [_Xmin, _Xmax) x [_Ymin, _Ymax),
+ * (inclusive for _Xmin and _Ymin while exclusive for _Xmax and _Ymax)
+ */
/*@{*/
- GLint _Xmin, _Xmax; /**< inclusive */
- GLint _Ymin, _Ymax; /**< exclusive */
+ GLint _Xmin, _Xmax;
+ GLint _Ymin, _Ymax;
/*@}*/
/** \name Derived Z buffer stuff */
/** One of the GL_FRAMEBUFFER_(IN)COMPLETE_* tokens */
GLenum _Status;
+ /** Whether one of Attachment has Type != GL_NONE
+ * NOTE: the values for Width and Height are set to 0 in case of having
+ * no attachments, a backend driver supporting the extension
+ * GL_ARB_framebuffer_no_attachments must check for the flag _HasAttachments
+ * and if GL_FALSE, must then use the values in DefaultGeometry to initialize
+ * its viewport, scissor and so on (in particular _Xmin, _Xmax, _Ymin and
+ * _Ymax do NOT take into account _HasAttachments being false). To get the
+ * geometry of the framebuffer, the helper functions
+ * _mesa_geometric_width(),
+ * _mesa_geometric_height(),
+ * _mesa_geometric_samples() and
+ * _mesa_geometric_layers()
+ * are available that check _HasAttachments.
+ */
+ bool _HasAttachments;
+
/** Integer color values */
GLboolean _IntegerColor;
GLboolean _AllColorBuffersFixedPoint; /* no integer, no float */
GLboolean _HasSNormOrFloatColorBuffer;
+ /**
+ * The maximum number of layers in the framebuffer, or 0 if the framebuffer
+ * is not layered. For cube maps and cube map arrays, each cube face
+ * counts as a layer. As the case for Width, Height a backend driver
+ * supporting GL_ARB_framebuffer_no_attachments must use DefaultGeometry
+ * in the case that _HasAttachments is false
+ */
+ GLuint MaxNumLayers;
+
/** Array of all renderbuffer attachments, indexed by BUFFER_* tokens. */
struct gl_renderbuffer_attachment Attachment[BUFFER_COUNT];
struct gl_renderbuffer *_ColorDrawBuffers[MAX_DRAW_BUFFERS];
struct gl_renderbuffer *_ColorReadBuffer;
- /**
- * The maximum number of layers in the framebuffer, or 0 if the framebuffer
- * is not layered. For cube maps and cube map arrays, each cube face
- * counts as a layer.
- */
- GLuint MaxNumLayers;
-
/** Delete this framebuffer */
void (*Delete)(struct gl_framebuffer *fb);
};
GLuint MaxRenderbufferSize; /**< GL_EXT_framebuffer_object */
GLuint MaxSamples; /**< GL_ARB_framebuffer_object */
+ /**
+ * GL_ARB_framebuffer_no_attachments
+ */
+ GLuint MaxFramebufferWidth;
+ GLuint MaxFramebufferHeight;
+ GLuint MaxFramebufferLayers;
+ GLuint MaxFramebufferSamples;
+
/** Number of varying vectors between any two shader stages. */
GLuint MaxVarying;
GLboolean ForceGLSLExtensionsWarn;
/**
- * If non-zero, forces GLSL shaders without the #version directive to behave
- * as if they began with "#version ForceGLSLVersion".
+ * If non-zero, forces GLSL shaders to behave as if they began
+ * with "#version ForceGLSLVersion".
*/
GLuint ForceGLSLVersion;
GLboolean ARB_fragment_program;
GLboolean ARB_fragment_program_shadow;
GLboolean ARB_fragment_shader;
+ GLboolean ARB_framebuffer_no_attachments;
GLboolean ARB_framebuffer_object;
GLboolean ARB_explicit_attrib_location;
GLboolean ARB_explicit_uniform_location;
GLboolean ARB_shader_image_load_store;
GLboolean ARB_shader_precision;
GLboolean ARB_shader_stencil_export;
+ GLboolean ARB_shader_storage_buffer_object;
GLboolean ARB_shader_texture_lod;
GLboolean ARB_shading_language_packing;
GLboolean ARB_shading_language_420pack;
GLboolean ARB_transform_feedback3;
GLboolean ARB_transform_feedback_instanced;
GLboolean ARB_uniform_buffer_object;
+ GLboolean ARB_vertex_attrib_64bit;
GLboolean ARB_vertex_program;
GLboolean ARB_vertex_shader;
GLboolean ARB_vertex_type_10f_11f_11f_rev;
*/
GLboolean Layered;
+ /**
+ * GL_TRUE if the state of this image unit is valid and access from
+ * the shader is allowed. Otherwise loads from this unit should
+ * return zero and stores should have no effect.
+ */
+ GLboolean _Valid;
+
/**
* Layer of the texture object bound to this unit, or zero if the
* whole level is bound.
*/
mesa_format _ActualFormat;
- /**
- * GL_TRUE if the state of this image unit is valid and access from
- * the shader is allowed. Otherwise loads from this unit should
- * return zero and stores should have no effect.
- */
- GLboolean _Valid;
};
/**
#ifdef DEBUG
extern int MESA_VERBOSE;
extern int MESA_DEBUG_FLAGS;
-# define MESA_FUNCTION __FUNCTION__
+# define MESA_FUNCTION __func__
#else
# define MESA_VERBOSE 0
# define MESA_DEBUG_FLAGS 0
DEBUG_INCOMPLETE_FBO = (1 << 3)
};
-
+static inline bool
+_mesa_active_fragment_shader_has_atomic_ops(const struct gl_context *ctx)
+{
+ return ctx->Shader._CurrentFragmentProgram != NULL &&
+ ctx->Shader._CurrentFragmentProgram->NumAtomicBuffers > 0;
+}
#ifdef __cplusplus
}