summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2017-10-20 15:50:28 -0700
committerKenneth Graunke <[email protected]>2017-10-24 16:13:59 -0700
commit90ed2a10bb3b3c3560a9c6874663ab2026993b02 (patch)
tree700e3ef430146ad9c068f51fdf49ad0f945f7e24 /src/mesa/drivers
parenta5499b639c96716ff7ce62502115c0fd453a078e (diff)
i965: Move _mesa_shader_write_subroutine_indices down a level.
Now we call it in one place instead of making every caller do it. Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/gen6_constant_state.c3
-rw-r--r--src/mesa/drivers/dri/i965/genX_state_upload.c6
2 files changed, 3 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_constant_state.c b/src/mesa/drivers/dri/i965/gen6_constant_state.c
index 121ba672575..6b5d2e66cc9 100644
--- a/src/mesa/drivers/dri/i965/gen6_constant_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_constant_state.c
@@ -28,6 +28,7 @@
#include "intel_batchbuffer.h"
#include "intel_buffer_objects.h"
#include "program/prog_parameter.h"
+#include "main/shaderapi.h"
static uint32_t
f_as_u32(float f)
@@ -129,6 +130,8 @@ gen6_upload_push_constants(struct brw_context *brw,
const struct gen_device_info *devinfo = &brw->screen->devinfo;
struct gl_context *ctx = &brw->ctx;
+ _mesa_shader_write_subroutine_indices(ctx, stage_state->stage);
+
if (prog_data->nr_params == 0) {
stage_state->push_const_size = 0;
} else {
diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c b/src/mesa/drivers/dri/i965/genX_state_upload.c
index 63ad02ff499..66b1ad9dbda 100644
--- a/src/mesa/drivers/dri/i965/genX_state_upload.c
+++ b/src/mesa/drivers/dri/i965/genX_state_upload.c
@@ -3143,7 +3143,6 @@ genX(upload_vs_push_constants)(struct brw_context *brw)
/* BRW_NEW_VS_PROG_DATA */
const struct brw_stage_prog_data *prog_data = brw->vs.base.prog_data;
- _mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_VERTEX);
gen6_upload_push_constants(brw, &vp->program, prog_data, stage_state);
}
@@ -3172,7 +3171,6 @@ genX(upload_gs_push_constants)(struct brw_context *brw)
/* BRW_NEW_GS_PROG_DATA */
struct brw_stage_prog_data *prog_data = brw->gs.base.prog_data;
- _mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_GEOMETRY);
gen6_upload_push_constants(brw, &gp->program, prog_data, stage_state);
}
}
@@ -3199,8 +3197,6 @@ genX(upload_wm_push_constants)(struct brw_context *brw)
/* BRW_NEW_FS_PROG_DATA */
const struct brw_stage_prog_data *prog_data = brw->wm.base.prog_data;
- _mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_FRAGMENT);
-
gen6_upload_push_constants(brw, &fp->program, prog_data, stage_state);
}
@@ -4038,7 +4034,6 @@ genX(upload_tes_push_constants)(struct brw_context *brw)
if (tep) {
/* BRW_NEW_TES_PROG_DATA */
const struct brw_stage_prog_data *prog_data = brw->tes.base.prog_data;
- _mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_TESS_EVAL);
gen6_upload_push_constants(brw, &tep->program, prog_data, stage_state);
}
}
@@ -4067,7 +4062,6 @@ genX(upload_tcs_push_constants)(struct brw_context *brw)
/* BRW_NEW_TCS_PROG_DATA */
const struct brw_stage_prog_data *prog_data = brw->tcs.base.prog_data;
- _mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_TESS_CTRL);
gen6_upload_push_constants(brw, &tcp->program, prog_data, stage_state);
}
}