summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/tests/varyings_test.cpp
diff options
context:
space:
mode:
authorTobias Klausmann <[email protected]>2016-05-08 22:44:06 +0200
committerDave Airlie <[email protected]>2016-05-14 08:28:08 +1000
commitd656736bbf926c219b6bcbc0ad59132fc82a7382 (patch)
treea23cf6a705eec5b42acb4218ee9e7387e7b818a4 /src/compiler/glsl/tests/varyings_test.cpp
parentad355652c20b245f5f2faa8622e71461e3121a7f (diff)
glsl: Add arb_cull_distance support (v3)
v2: make too large array a compile error v3: squash mesa/prog patch to avoid static compiler errors in bisect Signed-off-by: Tobias Klausmann <[email protected]> Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
Diffstat (limited to 'src/compiler/glsl/tests/varyings_test.cpp')
-rw-r--r--src/compiler/glsl/tests/varyings_test.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/compiler/glsl/tests/varyings_test.cpp b/src/compiler/glsl/tests/varyings_test.cpp
index 9be5e8344b4..936f49581d7 100644
--- a/src/compiler/glsl/tests/varyings_test.cpp
+++ b/src/compiler/glsl/tests/varyings_test.cpp
@@ -194,6 +194,33 @@ TEST_F(link_varyings, gl_ClipDistance)
EXPECT_TRUE(is_empty(consumer_interface_inputs));
}
+TEST_F(link_varyings, gl_CullDistance)
+{
+ const glsl_type *const array_8_of_float =
+ glsl_type::get_array_instance(glsl_type::vec(1), 8);
+
+ ir_variable *const culldistance =
+ new(mem_ctx) ir_variable(array_8_of_float,
+ "gl_CullDistance",
+ ir_var_shader_in);
+
+ culldistance->data.explicit_location = true;
+ culldistance->data.location = VARYING_SLOT_CULL_DIST0;
+ culldistance->data.explicit_index = 0;
+
+ ir.push_tail(culldistance);
+
+ ASSERT_TRUE(linker::populate_consumer_input_sets(mem_ctx,
+ &ir,
+ consumer_inputs,
+ consumer_interface_inputs,
+ junk));
+
+ EXPECT_EQ(culldistance, junk[VARYING_SLOT_CULL_DIST0]);
+ EXPECT_TRUE(is_empty(consumer_inputs));
+ EXPECT_TRUE(is_empty(consumer_interface_inputs));
+}
+
TEST_F(link_varyings, single_interface_input)
{
ir_variable *const v =