#include "compiler/glsl/list.h"
#include "util/simple_mtx.h"
#include "util/u_dynarray.h"
+#include "vbo/vbo.h"
#ifdef __cplusplus
struct gl_shader_spirv_data;
struct set;
struct shader_includes;
-struct vbo_context;
/*@}*/
*/
GLboolean EverBound;
+ /**
+ * Whether the VAO is changed by the application so often that some of
+ * the derived fields are not updated at all to decrease overhead.
+ * Also, interleaved arrays are not detected, because it's too expensive
+ * to do that before every draw call.
+ */
+ bool IsDynamic;
+
/**
* Marked to true if the object is shared between contexts and immutable.
* Then reference counting is done using atomics and thread safe.
*/
bool SharedAndImmutable;
+ /**
+ * Number of updates that were done by the application. This is used to
+ * decide whether the VAO is static or dynamic.
+ */
+ unsigned NumUpdates;
+
/** Vertex attribute arrays */
struct gl_array_attributes VertexAttrib[VERT_ATTRIB_MAX];
};
-/**
- * Current vertex processing mode: fixed function vs. shader.
- * In reality, fixed function is probably implemented by a shader but that's
- * not what we care about here.
- */
-typedef enum
-{
- VP_MODE_FF, /**< legacy / fixed function */
- VP_MODE_SHADER, /**< ARB vertex program or GLSL vertex shader */
- VP_MODE_MAX /**< for sizing arrays */
-} gl_vertex_processing_mode;
-
-
/**
* Base class for any kind of program object
*/
*/
GLenum16 ImageAccess[MAX_IMAGE_UNIFORMS];
+ GLuint NumUniformBlocks;
struct gl_uniform_block **UniformBlocks;
struct gl_uniform_block **ShaderStorageBlocks;
GLboolean TwoSideEnabled; /**< GL_VERTEX_PROGRAM_TWO_SIDE_ARB/NV */
/** Should fixed-function T&L be implemented with a vertex prog? */
GLboolean _MaintainTnlProgram;
+ /** Whether the fixed-func program is being used right now. */
+ GLboolean _UsesTnlProgram;
struct gl_program *Current; /**< User-bound vertex program */
GLboolean Enabled; /**< User-set fragment program enable flag */
/** Should fixed-function texturing be implemented with a fragment prog? */
GLboolean _MaintainTexEnvProgram;
+ /** Whether the fixed-func program is being used right now. */
+ GLboolean _UsesTexEnvProgram;
struct gl_program *Current; /**< User-bound fragment program */
GLboolean ForceGLSLAbsSqrt;
/**
- * Force uninitialized variables to default to zero.
+ * Types of variable to default initialized to zero.
*/
- GLboolean GLSLZeroInit;
+ GLuint GLSLZeroInit;
+
+ /**
+ * Treat integer textures using GL_LINEAR filters as GL_NEAREST.
+ */
+ GLboolean ForceIntegerTexNearest;
/**
* Does the driver support real 32-bit integers? (Otherwise, integers are
/** Whether out-of-order draw (Begin/End) optimizations are allowed. */
bool AllowDrawOutOfOrder;
+ /** Whether to allow the fast path for frequently updated VAOs. */
+ bool AllowDynamicVAOFastPath;
+
/** GL_ARB_gl_spirv */
struct spirv_supported_capabilities SpirVCapabilities;
struct gl_pixelstore_attrib Unpack;
};
+/**
+ * The VBO module implemented in src/vbo.
+ */
+struct vbo_context {
+ struct gl_vertex_buffer_binding binding;
+ struct gl_array_attributes current[VBO_ATTRIB_MAX];
+
+ struct gl_vertex_array_object *VAO;
+
+ struct vbo_exec_context exec;
+ struct vbo_save_context save;
+};
+
/**
* Mesa rendering context.
*
void *swrast_context;
void *swsetup_context;
void *swtnl_context;
- struct vbo_context *vbo_context;
+ struct vbo_context vbo_context;
struct st_context *st;
/*@}*/