summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/extensions_table.h1
-rw-r--r--src/mesa/main/get.c1
-rw-r--r--src/mesa/main/get_hash_params.py4
-rw-r--r--src/mesa/main/mtypes.h14
-rw-r--r--src/mesa/main/shaderapi.c3
5 files changed, 22 insertions, 1 deletions
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index 18a55059532..471b19f66a1 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -44,6 +44,7 @@ EXT(ARB_conditional_render_inverted , ARB_conditional_render_inverted
EXT(ARB_conservative_depth , ARB_conservative_depth , GLL, GLC, x , x , 2011)
EXT(ARB_copy_buffer , dummy_true , GLL, GLC, x , x , 2008)
EXT(ARB_copy_image , ARB_copy_image , GLL, GLC, x , x , 2012)
+EXT(ARB_cull_distance , ARB_cull_distance , GLL, GLC, x , x , 2014)
EXT(ARB_debug_output , dummy_true , GLL, GLC, x , x , 2009)
EXT(ARB_depth_buffer_float , ARB_depth_buffer_float , GLL, GLC, x , x , 2008)
EXT(ARB_depth_clamp , ARB_depth_clamp , GLL, GLC, x , x , 2003)
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 6829c33254c..e3a0a11a80f 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -465,6 +465,7 @@ EXTRA_EXT(ARB_shader_storage_buffer_object);
EXTRA_EXT(ARB_indirect_parameters);
EXTRA_EXT(ATI_meminfo);
EXTRA_EXT(NVX_gpu_memory_info);
+EXTRA_EXT(ARB_cull_distance);
static const int
extra_ARB_color_buffer_float_or_glcore[] = {
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 33ec60d9ce0..8f693acdc7c 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -878,6 +878,10 @@ descriptor=[
[ "GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX", "LOC_CUSTOM, TYPE_INT, NO_OFFSET, extra_NVX_gpu_memory_info" ],
[ "GPU_MEMORY_INFO_EVICTION_COUNT_NVX", "LOC_CUSTOM, TYPE_INT, NO_OFFSET, extra_NVX_gpu_memory_info" ],
[ "GPU_MEMORY_INFO_EVICTED_MEMORY_NVX", "LOC_CUSTOM, TYPE_INT, NO_OFFSET, extra_NVX_gpu_memory_info" ],
+
+# GL_ARB_cull_distance
+ [ "MAX_CULL_DISTANCES", "CONTEXT_INT(Const.MaxClipPlanes), extra_ARB_cull_distance" ],
+ [ "MAX_COMBINED_CLIP_AND_CULL_DISTANCES", "CONTEXT_INT(Const.MaxClipPlanes), extra_ARB_cull_distance" ],
]},
# Enums restricted to OpenGL Core profile
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index d8adf5c2b57..569e0acc1ec 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1922,6 +1922,7 @@ struct gl_program
* gl_ClipDistance output. Ignored for fragment shaders.
*/
unsigned ClipDistanceArraySize;
+ unsigned CullDistanceArraySize;
/** Named parameters, constants, etc. from program text */
@@ -2703,6 +2704,8 @@ struct gl_shader_program
*/
GLuint ClipDistanceArraySize; /**< Size of the gl_ClipDistance array, or
0 if not present. */
+ GLuint CullDistanceArraySize; /**< Size of the gl_CullDistance array, or
+ 0 if not present. */
} TessEval;
/**
@@ -2725,6 +2728,8 @@ struct gl_shader_program
*/
GLuint ClipDistanceArraySize; /**< Size of the gl_ClipDistance array, or
0 if not present. */
+ GLuint CullDistanceArraySize; /**< Size of the gl_CullDistance array, or
+ 0 if not present. */
bool UsesEndPrimitive;
bool UsesStreams;
} Geom;
@@ -2737,6 +2742,8 @@ struct gl_shader_program
*/
GLuint ClipDistanceArraySize; /**< Size of the gl_ClipDistance array, or
0 if not present. */
+ GLuint CullDistanceArraySize; /**< Size of the gl_CullDistance array, or
+ 0 if not present. */
} Vert;
/**
@@ -2780,6 +2787,7 @@ struct gl_shader_program
* stage before the fragment shader.
*/
unsigned LastClipDistanceArraySize;
+ unsigned LastCullDistanceArraySize;
unsigned NumUniformBlocks;
struct gl_uniform_block *UniformBlocks;
@@ -2911,7 +2919,10 @@ struct gl_shader_compiler_options
GLboolean EmitNoNoise; /**< Emit NOISE opcodes? */
GLboolean EmitNoPow; /**< Emit POW opcodes? */
GLboolean EmitNoSat; /**< Emit SAT opcodes? */
- GLboolean LowerClipDistance; /**< Lower gl_ClipDistance from float[8] to vec4[2]? */
+ GLboolean LowerCombinedClipCullDistance; /** Lower gl_ClipDistance and
+ * gl_CullDistance together from
+ * float[8] to vec4[2]
+ **/
/**
* \name Forms of indirect addressing the driver cannot do.
@@ -3742,6 +3753,7 @@ struct gl_extensions
GLboolean ARB_conditional_render_inverted;
GLboolean ARB_conservative_depth;
GLboolean ARB_copy_image;
+ GLboolean ARB_cull_distance;
GLboolean ARB_depth_buffer_float;
GLboolean ARB_depth_clamp;
GLboolean ARB_depth_texture;
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 8c1fba8b26f..ae37e94f3a8 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -2080,6 +2080,7 @@ _mesa_copy_linked_program_data(gl_shader_stage type,
switch (type) {
case MESA_SHADER_VERTEX:
dst->ClipDistanceArraySize = src->Vert.ClipDistanceArraySize;
+ dst->CullDistanceArraySize = src->Vert.CullDistanceArraySize;
break;
case MESA_SHADER_TESS_CTRL: {
struct gl_tess_ctrl_program *dst_tcp =
@@ -2095,6 +2096,7 @@ _mesa_copy_linked_program_data(gl_shader_stage type,
dst_tep->VertexOrder = src->TessEval.VertexOrder;
dst_tep->PointMode = src->TessEval.PointMode;
dst->ClipDistanceArraySize = src->TessEval.ClipDistanceArraySize;
+ dst->CullDistanceArraySize = src->TessEval.CullDistanceArraySize;
break;
}
case MESA_SHADER_GEOMETRY: {
@@ -2105,6 +2107,7 @@ _mesa_copy_linked_program_data(gl_shader_stage type,
dst_gp->InputType = src->Geom.InputType;
dst_gp->OutputType = src->Geom.OutputType;
dst->ClipDistanceArraySize = src->Geom.ClipDistanceArraySize;
+ dst->CullDistanceArraySize = src->Geom.CullDistanceArraySize;
dst_gp->UsesEndPrimitive = src->Geom.UsesEndPrimitive;
dst_gp->UsesStreams = src->Geom.UsesStreams;
break;