[Mesa-dev] [PATCH 1/5] i965: Remove special clip plane code from VS push constant uploads.
Kenneth Graunke
kenneth at whitecape.org
Thu Feb 7 23:31:16 PST 2013
The brw_vec4 vertex shader backend doesn't treat clip planes specially,
so this code is unnecessary. It was used for the brw_vs_emit backend.
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
src/mesa/drivers/dri/i965/gen6_vs_state.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c
index d293482..39c5a20 100644
--- a/src/mesa/drivers/dri/i965/gen6_vs_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c
@@ -49,8 +49,8 @@ gen6_upload_vs_push_constants(struct brw_context *brw)
/* XXX: Should this happen somewhere before to get our state flag set? */
_mesa_load_state_parameters(ctx, vp->program.Base.Parameters);
- /* CACHE_NEW_VS_PROG | _NEW_TRANSFORM */
- if (brw->vs.prog_data->nr_params == 0 && !ctx->Transform.ClipPlanesEnabled) {
+ /* CACHE_NEW_VS_PROG */
+ if (brw->vs.prog_data->nr_params == 0) {
brw->vs.push_const_size = 0;
} else {
int params_uploaded = 0;
@@ -58,8 +58,7 @@ gen6_upload_vs_push_constants(struct brw_context *brw)
int i;
param = brw_state_batch(brw, AUB_TRACE_VS_CONSTANTS,
- (MAX_CLIP_PLANES + nr_params) *
- 4 * sizeof(float),
+ nr_params * 4 * sizeof(float),
32, &brw->vs.push_const_offset);
for (i = 0; i < brw->vs.prog_data->nr_params; i++) {
@@ -84,7 +83,7 @@ gen6_upload_vs_push_constants(struct brw_context *brw)
const struct brw_tracked_state gen6_vs_push_constants = {
.dirty = {
- .mesa = _NEW_TRANSFORM | _NEW_PROGRAM_CONSTANTS,
+ .mesa = _NEW_PROGRAM_CONSTANTS,
.brw = (BRW_NEW_BATCH |
BRW_NEW_VERTEX_PROGRAM),
.cache = CACHE_NEW_VS_PROG,
--
1.8.1.2
More information about the mesa-dev
mailing list