unsigned GlesRemainingPrims;
/**
- * The shader program active when BeginTransformFeedback() was called.
+ * The 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;
+ struct gl_program *program;
/** The feedback buffers */
GLuint BufferNames[MAX_FEEDBACK_BUFFERS];
GLenum Target; /**< GL_VERTEX/FRAGMENT_PROGRAM_ARB, GL_GEOMETRY_PROGRAM_NV */
GLenum Format; /**< String encoding format */
+ GLboolean _Used; /**< Ever used for drawing? Used for debugging */
+
struct nir_shader *nir;
+ bool is_arb_asm; /** Is this an ARB assembly-style program */
+
GLbitfield64 SecondaryOutputsWritten; /**< Subset of OutputsWritten outputs written with non-zero index. */
GLbitfield TexturesUsed[MAX_COMBINED_TEXTURE_IMAGE_UNITS]; /**< TEXTURE_x_BIT bitmask */
GLbitfield SamplersUsed; /**< Bitfield of which samplers are used */
/** Map from sampler unit to texture unit (set by glUniform1i()) */
GLubyte SamplerUnits[MAX_SAMPLERS];
- union {
+ /* FIXME: We should be able to make this struct a union. However some
+ * drivers (i915/fragment_programs, swrast/prog_execute) mix the use of
+ * these fields, we should fix this.
+ */
+ struct {
/** Fields used by GLSL programs */
struct {
+ /** Data shared by gl_program and gl_shader_program */
+ struct gl_shader_program_data *data;
+
struct gl_active_atomic_buffer **AtomicBuffers;
+
+ /** Post-link transform feedback info. */
+ struct gl_transform_feedback_info *LinkedTransformFeedback;
+
+ /**
+ * Number of types for subroutine uniforms.
+ */
+ GLuint NumSubroutineUniformTypes;
+
+ /**
+ * Subroutine uniform remap table
+ * based on the program level uniform remap table.
+ */
+ GLuint NumSubroutineUniforms; /* non-sparse total */
+ GLuint NumSubroutineUniformRemapTable;
+ struct gl_uniform_storage **SubroutineUniformRemapTable;
+
+ /**
+ * Num of subroutine functions for this stage and storage for them.
+ */
+ GLuint NumSubroutineFunctions;
+ GLuint MaxSubroutineFunctionIndex;
+ struct gl_subroutine_function *SubroutineFunctions;
+
+ /**
+ * Map from image uniform index to image unit (set by glUniform1i())
+ *
+ * An image uniform index is associated with each image uniform by
+ * the linker. The image index associated with each uniform is
+ * stored in the \c gl_uniform_storage::image field.
+ */
+ GLubyte ImageUnits[MAX_IMAGE_UNIFORMS];
+
+ /**
+ * Access qualifier specified in the shader for each image uniform
+ * index. Either \c GL_READ_ONLY, \c GL_WRITE_ONLY or \c
+ * GL_READ_WRITE.
+ *
+ * It may be different, though only more strict than the value of
+ * \c gl_image_unit::Access for the corresponding image unit.
+ */
+ GLenum ImageAccess[MAX_IMAGE_UNIFORMS];
+
+ struct gl_uniform_block **UniformBlocks;
+ struct gl_uniform_block **ShaderStorageBlocks;
+
+ union {
+ struct {
+ /**
+ * A bitmask of gl_advanced_blend_mode values
+ */
+ GLbitfield BlendSupport;
+ } fs;
+ };
} sh;
/** ARB assembly-style program fields */
*/
bool EarlyFragmentTests;
- /**
- * A bitmask of gl_advanced_blend_mode values
- */
- GLbitfield BlendSupport;
-
/**
* Compute shader state from ARB_compute_shader and
* ARB_compute_variable_group_size layout qualifiers.
* \note Each of these fields is only set post-linking.
*/
/*@{*/
- unsigned num_samplers; /**< Number of samplers used by this shader. */
GLbitfield active_samplers; /**< Bitfield of which samplers are used */
GLbitfield shadow_samplers; /**< Samplers used for shadow sampling. */
/*@}*/
*/
unsigned num_combined_uniform_components;
- unsigned NumUniformBlocks;
- struct gl_uniform_block **UniformBlocks;
-
- unsigned NumShaderStorageBlocks;
- struct gl_uniform_block **ShaderStorageBlocks;
-
struct exec_list *ir;
struct exec_list *packed_varyings;
struct exec_list *fragdata_arrays;
struct glsl_symbol_table *symbols;
- /**
- * Map from image uniform index to image unit (set by glUniform1i())
- *
- * An image uniform index is associated with each image uniform by
- * the linker. The image index associated with each uniform is
- * stored in the \c gl_uniform_storage::image field.
- */
- GLubyte ImageUnits[MAX_IMAGE_UNIFORMS];
-
- /**
- * Access qualifier specified in the shader for each image uniform
- * index. Either \c GL_READ_ONLY, \c GL_WRITE_ONLY or \c
- * GL_READ_WRITE.
- *
- * It may be different, though only more strict than the value of
- * \c gl_image_unit::Access for the corresponding image unit.
- */
- GLenum ImageAccess[MAX_IMAGE_UNIFORMS];
-
/**
* Number of image uniforms defined in the shader. It specifies
* the number of valid elements in the \c ImageUnits and \c
- * ImageAccess arrays above.
+ * ImageAccess arrays.
*/
GLuint NumImages;
- /**
- * Number of types for subroutine uniforms.
- */
- GLuint NumSubroutineUniformTypes;
-
- /**
- * Subroutine uniform remap table
- * based on the program level uniform remap table.
- */
- GLuint NumSubroutineUniforms; /* non-sparse total */
- GLuint NumSubroutineUniformRemapTable;
- struct gl_uniform_storage **SubroutineUniformRemapTable;
-
- /**
- * Num of subroutine functions for this stage
- * and storage for them.
- */
- GLuint NumSubroutineFunctions;
- GLuint MaxSubroutineFunctionIndex;
- struct gl_subroutine_function *SubroutineFunctions;
-
struct gl_shader_info info;
};
struct exec_list *ir;
struct glsl_symbol_table *symbols;
+ /**
+ * A bitmask of gl_advanced_blend_mode values
+ */
+ GLbitfield BlendSupport;
+
struct gl_shader_info info;
};
/** Stages that reference this block */
uint8_t stageref;
+ /**
+ * Linearized array index for uniform block instance arrays
+ *
+ * Given a uniform block instance array declared with size
+ * blk[s_0][s_1]..[s_m], the block referenced by blk[i_0][i_1]..[i_m] will
+ * have the linearized array index
+ *
+ * m-1 m
+ * i_m + ∑ i_j * ∏ s_k
+ * j=0 k=j+1
+ *
+ * For a uniform block instance that is not an array, this is always 0.
+ */
+ uint8_t linearized_array_index;
+
/**
* Layout specified in the shader
*
GLchar **VaryingNames; /**< Array [NumVarying] of char * */
} TransformFeedback;
- /** Post-link transform feedback info. */
- struct gl_transform_feedback_info LinkedTransformFeedback;
+ struct gl_program *xfb_program;
/** Post-link gl_FragDepth layout for ARB_conservative_depth. */
enum gl_frag_depth_layout FragDepthLayout;
*/
struct string_to_uint_map *UniformHash;
- GLboolean _Used; /**< Ever used for drawing? */
GLboolean SamplersValidated; /**< Samplers validated against texture units? */
bool IsES; /**< True if this program uses GLSL ES */
*/
struct gl_shader_program *CurrentProgram[MESA_SHADER_STAGES];
- struct gl_shader_program *_CurrentFragmentProgram;
+ struct gl_program *_CurrentFragmentProgram;
/**
* Program used by glUniform calls.
bool GLSLFragCoordIsSysVal;
bool GLSLFrontFacingIsSysVal;
+ /**
+ * Run the minimum amount of GLSL optimizations to be able to link
+ * shaders optimally (eliminate dead varyings and uniforms) and just do
+ * all the necessary lowering.
+ */
+ bool GLSLOptimizeConservatively;
+
/**
* Always use the GetTransformFeedbackVertexCount() driver hook, rather
* than passing the transform feedback object to the drawing function.
* gl_context::TessCtrlProgram::patch_default_*
*/
uint64_t NewDefaultTessLevels;
+
+ /**
+ * gl_context::IntelConservativeRasterization
+ */
+ uint64_t NewIntelConservativeRasterization;
};
struct gl_uniform_buffer_binding