#include "main/config.h"
#include "glapi/glapi.h"
#include "math/m_matrix.h" /* GLmatrix */
-#include "glsl/nir/shader_enums.h"
+#include "compiler/shader_enums.h"
#include "main/formats.h" /* MESA_FORMAT_COUNT */
+#include "compiler/glsl/list.h"
#ifdef __cplusplus
struct gl_multisample_attrib
{
GLboolean Enabled;
- GLboolean _Enabled; /**< true if Enabled and multisample buffer */
GLboolean SampleAlphaToCoverage;
GLboolean SampleAlphaToOne;
GLboolean SampleCoverage;
USAGE_TEXTURE_BUFFER = 0x2,
USAGE_ATOMIC_COUNTER_BUFFER = 0x4,
USAGE_SHADER_STORAGE_BUFFER = 0x8,
+ USAGE_TRANSFORM_FEEDBACK_BUFFER = 0x10,
+ USAGE_PIXEL_PACK_BUFFER = 0x20,
+ USAGE_DISABLE_MINMAX_CACHE = 0x40,
} gl_buffer_usage;
GLuint NumMapBufferWriteCalls;
struct gl_buffer_mapping Mappings[MAP_COUNT];
+
+ /** Memoization of min/max index computations for static index buffers */
+ struct hash_table *MinMaxCache;
+ unsigned MinMaxCacheHitIndices;
+ unsigned MinMaxCacheMissIndices;
+ bool MinMaxCacheDirty;
};
{
char *Name;
GLenum Type;
+ GLint BufferIndex;
GLint Size;
+ GLint Offset;
};
};
+struct gl_transform_feedback_buffer
+{
+ unsigned Binding;
+
+ unsigned NumVaryings;
+
+ /**
+ * Total number of components stored in each buffer. This may be used by
+ * hardware back-ends to determine the correct stride when interleaving
+ * multiple transform feedback outputs in the same buffer.
+ */
+ unsigned Stride;
+
+ /**
+ * Which transform feedback stream this buffer binding is associated with.
+ */
+ unsigned Stream;
+};
+
+
/** Post-link transform feedback info. */
struct gl_transform_feedback_info
{
unsigned NumOutputs;
- /**
- * Number of transform feedback buffers in use by this program.
- */
- unsigned NumBuffers;
+ /* Bitmask of active buffer indices. */
+ unsigned ActiveBuffers;
struct gl_transform_feedback_output *Outputs;
struct gl_transform_feedback_varying_info *Varyings;
GLint NumVarying;
- /**
- * Total number of components stored in each buffer. This may be used by
- * hardware back-ends to determine the correct stride when interleaving
- * multiple transform feedback outputs in the same buffer.
- */
- unsigned BufferStride[MAX_FEEDBACK_BUFFERS];
-
- /**
- * Which transform feedback stream this buffer binding is associated with.
- */
- unsigned BufferStream[MAX_FEEDBACK_BUFFERS];
+ struct gl_transform_feedback_buffer Buffers[MAX_FEEDBACK_BUFFERS];
};
PROGRAM_SAMPLER, /**< for shader samplers, compile-time only */
PROGRAM_SYSTEM_VALUE,/**< InstanceId, PrimitiveID, etc. */
PROGRAM_UNDEFINED, /**< Invalid/TBD value */
+ PROGRAM_IMMEDIATE, /**< Immediate value, used by TGSI */
+ PROGRAM_BUFFER, /**< for shader buffers, compile-time only */
+ PROGRAM_MEMORY, /**< for shared, global and local memory */
+ PROGRAM_IMAGE, /**< for shader images, compile-time only */
PROGRAM_FILE_MAX
} gl_register_file;
* Size specified using local_size_{x,y,z}.
*/
unsigned LocalSize[3];
+
+ /**
+ * Size of shared variables accessed by the compute shader.
+ */
+ unsigned SharedSize;
};
GLboolean interpinp1;
GLboolean isValid;
GLuint swizzlerq;
+ struct gl_program *Program;
};
/**
*/
unsigned num_combined_uniform_components;
- /**
- * This shader's uniform/ssbo block information.
- *
- * These fields are only set post-linking.
- *
- * BufferInterfaceBlocks is a list containing both UBOs and SSBOs. This is
- * useful during the linking process so that we don't have to handle SSBOs
- * specifically.
- *
- * UniformBlocks is a list of UBOs. This is useful for backends that need
- * or prefer to see separate index spaces for UBOS and SSBOs like the GL
- * API specifies.
- *
- * ShaderStorageBlocks is a list of SSBOs. This is useful for backends that
- * need or prefer to see separate index spaces for UBOS and SSBOs like the
- * GL API specifies.
- *
- * UniformBlocks and ShaderStorageBlocks only have pointers into
- * BufferInterfaceBlocks so the actual resource information is not
- * duplicated.
- */
- unsigned NumBufferInterfaceBlocks;
- struct gl_uniform_block *BufferInterfaceBlocks;
-
unsigned NumUniformBlocks;
struct gl_uniform_block **UniformBlocks;
bool origin_upper_left;
bool pixel_center_integer;
+ struct {
+ /** Global xfb_stride out qualifier if any */
+ GLuint BufferStride[MAX_FEEDBACK_BUFFERS];
+ } TransformFeedback;
+
/**
* Tessellation Control shader state from layout qualifiers.
*/
*/
GLuint Binding;
- /**
- * Vulkan descriptor set qualifier for this block.
- */
- GLuint Set;
-
/**
* Minimum size (in bytes) of a buffer object to back this uniform buffer
* (GL_UNIFORM_BLOCK_DATA_SIZE).
*/
GLuint UniformBufferSize;
- /**
- * Is this actually an interface block for a shader storage buffer?
- */
- bool IsShaderStorage;
+ /** Stages that reference this block */
+ uint8_t stageref;
/**
* Layout specified in the shader
*/
struct {
GLenum BufferMode;
+ /** Global xfb_stride out qualifier if any */
+ GLuint BufferStride[MAX_FEEDBACK_BUFFERS];
GLuint NumVarying;
GLchar **VaryingNames; /**< Array [NumVarying] of char * */
} TransformFeedback;
struct gl_uniform_storage **UniformRemapTable;
/**
- * Size of the gl_ClipDistance array that is output from the last pipeline
- * stage before the fragment shader.
+ * Sometimes there are empty slots left over in UniformRemapTable after we
+ * allocate slots to explicit locations. This list stores the blocks of
+ * continuous empty slots inside UniformRemapTable.
*/
- unsigned LastClipDistanceArraySize;
+ struct exec_list EmptyUniformLocations;
/**
- * This shader's uniform/ssbo block information.
- *
- * BufferInterfaceBlocks is a list containing both UBOs and SSBOs. This is
- * useful during the linking process so that we don't have to handle SSBOs
- * specifically.
- *
- * UniformBlocks is a list of UBOs. This is useful for backends that need
- * or prefer to see separate index spaces for UBOS and SSBOs like the GL
- * API specifies.
- *
- * ShaderStorageBlocks is a list of SSBOs. This is useful for backends that
- * need or prefer to see separate index spaces for UBOS and SSBOs like the
- * GL API specifies.
- *
- * UniformBlocks and ShaderStorageBlocks only have pointers into
- * BufferInterfaceBlocks so the actual resource information is not
- * duplicated and are only set after linking.
+ * Size of the gl_ClipDistance array that is output from the last pipeline
+ * stage before the fragment shader.
*/
- unsigned NumBufferInterfaceBlocks;
- struct gl_uniform_block *BufferInterfaceBlocks;
+ unsigned LastClipDistanceArraySize;
unsigned NumUniformBlocks;
- struct gl_uniform_block **UniformBlocks;
+ struct gl_uniform_block *UniformBlocks;
unsigned NumShaderStorageBlocks;
- struct gl_uniform_block **ShaderStorageBlocks;
-
- /**
- * Indices into the BufferInterfaceBlocks[] array for each stage they're
- * used in, or -1.
- *
- * This is used to maintain the Binding values of the stage's
- * BufferInterfaceBlocks[] and to answer the
- * GL_UNIFORM_BLOCK_REFERENCED_BY_*_SHADER queries.
- */
- int *InterfaceBlockStageIndex[MESA_SHADER_STAGES];
-
- /**
- * Indices into the BufferInterfaceBlocks[] array for Uniform Buffer
- * Objects and Shader Storage Buffer Objects.
- */
- unsigned *UboInterfaceBlockIndex;
- unsigned *SsboInterfaceBlockIndex;
+ struct gl_uniform_block *ShaderStorageBlocks;
/**
* Map of active uniform names to locations
struct gl_shader_compiler_options
{
/** Driver-selectable options: */
- GLboolean EmitCondCodes; /**< Use condition codes? */
GLboolean EmitNoLoops;
GLboolean EmitNoFunctions;
GLboolean EmitNoCont; /**< Emit CONT opcode? */
mtx_t Mutex; /**< for thread safety */
GLint RefCount; /**< Reference count */
struct _mesa_HashTable *DisplayList; /**< Display lists hash table */
+ struct _mesa_HashTable *BitmapAtlas; /**< For optimized glBitmap text */
struct _mesa_HashTable *TexObjects; /**< Texture objects hash table */
/** Default texture objects (shared by all texture units) */
struct {
GLuint Width, Height, Layers, NumSamples;
GLboolean FixedSampleLocations;
+ /* Derived from NumSamples by the driver so that it can choose a valid
+ * value for the hardware.
+ */
+ GLuint _NumSamples;
} DefaultGeometry;
/** \name Drawing bounds (Intersection of buffer size and scissor box)
GLuint MaxComputeWorkGroupCount[3]; /* Array of x, y, z dimensions */
GLuint MaxComputeWorkGroupSize[3]; /* Array of x, y, z dimensions */
GLuint MaxComputeWorkGroupInvocations;
+ GLuint MaxComputeSharedMemorySize;
/** GL_ARB_gpu_shader5 */
GLfloat MinFragmentInterpolationOffset;
GLboolean ANGLE_texture_compression_dxt;
GLboolean ARB_ES2_compatibility;
GLboolean ARB_ES3_compatibility;
+ GLboolean ARB_ES3_1_compatibility;
GLboolean ARB_arrays_of_arrays;
GLboolean ARB_base_instance;
GLboolean ARB_blend_func_extended;
GLboolean ARB_indirect_parameters;
GLboolean ARB_instanced_arrays;
GLboolean ARB_internalformat_query;
+ GLboolean ARB_internalformat_query2;
GLboolean ARB_map_buffer_range;
GLboolean ARB_occlusion_query;
GLboolean ARB_occlusion_query2;
GLboolean ARB_pipeline_statistics_query;
GLboolean ARB_point_sprite;
+ GLboolean ARB_query_buffer_object;
+ GLboolean ARB_robust_buffer_access_behavior;
GLboolean ARB_sample_shading;
GLboolean ARB_seamless_cube_map;
+ GLboolean ARB_shader_atomic_counter_ops;
GLboolean ARB_shader_atomic_counters;
GLboolean ARB_shader_bit_encoding;
GLboolean ARB_shader_clock;
GLboolean EXT_transform_feedback;
GLboolean EXT_timer_query;
GLboolean EXT_vertex_array_bgra;
+ GLboolean OES_copy_image;
+ GLboolean OES_sample_variables;
GLboolean OES_standard_derivatives;
+ GLboolean OES_texture_buffer;
/* vendor extensions */
GLboolean AMD_performance_monitor;
GLboolean AMD_pinned_memory;
GLboolean AMD_vertex_shader_layer;
GLboolean AMD_vertex_shader_viewport_index;
GLboolean APPLE_object_purgeable;
+ GLboolean ATI_meminfo;
GLboolean ATI_texture_compression_3dc;
GLboolean ATI_texture_mirror_once;
GLboolean ATI_texture_env_combine3;
GLboolean MESA_ycbcr_texture;
GLboolean NV_conditional_render;
GLboolean NV_fog_distance;
- GLboolean NV_fragment_program_option;
GLboolean NV_point_sprite;
GLboolean NV_primitive_restart;
GLboolean NV_texture_barrier;
GLboolean NV_texture_env_combine4;
GLboolean NV_texture_rectangle;
GLboolean NV_vdpau_interop;
+ GLboolean NVX_gpu_memory_info;
GLboolean TDFX_texture_compression_FXT1;
GLboolean OES_EGL_image;
GLboolean OES_draw_texture;
GLboolean OES_texture_half_float;
GLboolean OES_texture_half_float_linear;
GLboolean OES_compressed_ETC1_RGB8_texture;
+ GLboolean OES_geometry_shader;
GLboolean extension_sentinel;
/** The extension string */
const GLubyte *String;
struct gl_buffer_object *CopyReadBuffer; /**< GL_ARB_copy_buffer */
struct gl_buffer_object *CopyWriteBuffer; /**< GL_ARB_copy_buffer */
+ struct gl_buffer_object *QueryBuffer; /**< GL_ARB_query_buffer_object */
+
/**
* Current GL_ARB_uniform_buffer_object binding referenced by
* GL_UNIFORM_BUFFER target for glBufferData, glMapBuffer, etc.
GLboolean ShareGroupReset;
};
+/**
+ * Information about memory usage. All sizes are in kilobytes.
+ */
+struct gl_memory_info
+{
+ unsigned total_device_memory; /**< size of device memory, e.g. VRAM */
+ unsigned avail_device_memory; /**< free device memory at the moment */
+ unsigned total_staging_memory; /**< size of staging memory, e.g. GART */
+ unsigned avail_staging_memory; /**< free staging memory at the moment */
+ unsigned device_memory_evicted; /**< size of memory evicted (monotonic counter) */
+ unsigned nr_device_memory_evictions; /**< # of evictions (monotonic counter) */
+};
#ifdef DEBUG
extern int MESA_VERBOSE;