[Mesa-dev] [PATCH 04/14] i965: Store a clip_distance_mask field similar to cull_distance_mask.
Kenneth Graunke
kenneth at whitecape.org
Tue Nov 15 01:41:28 UTC 2016
This isn't useful for legacy GL, but will be used in Vulkan.
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
src/mesa/drivers/dri/i965/brw_compiler.h | 1 +
src/mesa/drivers/dri/i965/brw_shader.cpp | 2 ++
src/mesa/drivers/dri/i965/brw_vec4.cpp | 2 ++
src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp | 2 ++
4 files changed, 7 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_compiler.h b/src/mesa/drivers/dri/i965/brw_compiler.h
index c2400f9..65a7478 100644
--- a/src/mesa/drivers/dri/i965/brw_compiler.h
+++ b/src/mesa/drivers/dri/i965/brw_compiler.h
@@ -626,6 +626,7 @@ struct brw_vue_prog_data {
GLuint urb_read_length;
GLuint total_grf;
+ uint32_t clip_distance_mask;
uint32_t cull_distance_mask;
/* Used for calculating urb partitions. In the VS, this is the size of the
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
index e44a845..e367900 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -1376,6 +1376,8 @@ brw_compile_tes(const struct brw_compiler *compiler,
return NULL;
}
+ prog_data->base.clip_distance_mask =
+ ((1 << nir->info->clip_distance_array_size) - 1);
prog_data->base.cull_distance_mask =
((1 << nir->info->cull_distance_array_size) - 1) <<
nir->info->clip_distance_array_size;
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index 4da8f6e..b9e592f 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -2121,6 +2121,8 @@ brw_compile_vs(const struct brw_compiler *compiler, void *log_data,
const unsigned *assembly = NULL;
+ prog_data->base.clip_distance_mask =
+ ((1 << shader->info->clip_distance_array_size) - 1);
prog_data->base.cull_distance_mask =
((1 << shader->info->cull_distance_array_size) - 1) <<
shader->info->clip_distance_array_size;
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
index 5e2dcc0..900d9d3 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
@@ -621,6 +621,8 @@ brw_compile_gs(const struct brw_compiler *compiler, void *log_data,
brw_nir_lower_vue_outputs(shader, is_scalar);
shader = brw_postprocess_nir(shader, compiler->devinfo, is_scalar);
+ prog_data->base.clip_distance_mask =
+ ((1 << shader->info->clip_distance_array_size) - 1);
prog_data->base.cull_distance_mask =
((1 << shader->info->cull_distance_array_size) - 1) <<
shader->info->clip_distance_array_size;
--
2.10.2
More information about the mesa-dev
mailing list