summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_program.c
diff options
context:
space:
mode:
authorTobias Klausmann <[email protected]>2016-05-08 22:44:08 +0200
committerDave Airlie <[email protected]>2016-05-14 08:28:23 +1000
commit8f45f4f3cafa678292a87f316d2729da7800bab5 (patch)
tree72db5dd20f7dff87552fa10c78119955fe92402b /src/mesa/state_tracker/st_program.c
parent2be258ea1826b2bee2173efafa98af9874cfddfa (diff)
mesa/st: Add support for GL_ARB_cull_distance (v2)
v2: don't bother with cull dist varyings except to assert. Signed-off-by: Tobias Klausmann <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_program.c')
-rw-r--r--src/mesa/state_tracker/st_program.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 444e5aac7bd..4e37a1707c2 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -310,6 +310,11 @@ st_translate_vertex_program(struct st_context *st,
output_semantic_name[slot] = TGSI_SEMANTIC_CLIPDIST;
output_semantic_index[slot] = 1;
break;
+ case VARYING_SLOT_CULL_DIST0:
+ case VARYING_SLOT_CULL_DIST1:
+ /* these should have been lowered by GLSL */
+ assert(0);
+ break;
case VARYING_SLOT_EDGE:
assert(0);
break;
@@ -366,6 +371,9 @@ st_translate_vertex_program(struct st_context *st,
if (stvp->Base.Base.ClipDistanceArraySize)
ureg_property(ureg, TGSI_PROPERTY_NUM_CLIPDIST_ENABLED,
stvp->Base.Base.ClipDistanceArraySize);
+ if (stvp->Base.Base.CullDistanceArraySize)
+ ureg_property(ureg, TGSI_PROPERTY_NUM_CULLDIST_ENABLED,
+ stvp->Base.Base.CullDistanceArraySize);
if (ST_DEBUG & DEBUG_MESA) {
_mesa_print_program(&stvp->Base.Base);
@@ -627,6 +635,11 @@ st_translate_fragment_program(struct st_context *st,
input_semantic_index[slot] = 1;
interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE;
break;
+ case VARYING_SLOT_CULL_DIST0:
+ case VARYING_SLOT_CULL_DIST1:
+ /* these should have been lowered by GLSL */
+ assert(0);
+ break;
/* In most cases, there is nothing special about these
* inputs, so adopt a convention to use the generic
* semantic name and the mesa VARYING_SLOT_ number as the
@@ -1044,6 +1057,9 @@ st_translate_program_common(struct st_context *st,
if (prog->ClipDistanceArraySize)
ureg_property(ureg, TGSI_PROPERTY_NUM_CLIPDIST_ENABLED,
prog->ClipDistanceArraySize);
+ if (prog->CullDistanceArraySize)
+ ureg_property(ureg, TGSI_PROPERTY_NUM_CULLDIST_ENABLED,
+ prog->CullDistanceArraySize);
/*
* Convert Mesa program inputs to TGSI input register semantics.
@@ -1089,6 +1105,11 @@ st_translate_program_common(struct st_context *st,
input_semantic_name[slot] = TGSI_SEMANTIC_CLIPDIST;
input_semantic_index[slot] = 1;
break;
+ case VARYING_SLOT_CULL_DIST0:
+ case VARYING_SLOT_CULL_DIST1:
+ /* these should have been lowered by GLSL */
+ assert(0);
+ break;
case VARYING_SLOT_PSIZ:
input_semantic_name[slot] = TGSI_SEMANTIC_PSIZE;
input_semantic_index[slot] = 0;
@@ -1191,6 +1212,11 @@ st_translate_program_common(struct st_context *st,
output_semantic_name[slot] = TGSI_SEMANTIC_CLIPDIST;
output_semantic_index[slot] = 1;
break;
+ case VARYING_SLOT_CULL_DIST0:
+ case VARYING_SLOT_CULL_DIST1:
+ /* these should have been lowered by GLSL */
+ assert(0);
+ break;
case VARYING_SLOT_LAYER:
output_semantic_name[slot] = TGSI_SEMANTIC_LAYER;
output_semantic_index[slot] = 0;