From 4adad99cfbefc66ddfc65c2143c2bf402fc3426c Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 7 Jun 2016 15:25:57 +1000 Subject: [PATCH] i965: use new subroutine index uploader. This plugs the subroutine index updates into the i965 backend, where it loads constants. Signed-off-by: Dave Airlie Acked-by: Andres Gomez --- src/mesa/drivers/dri/i965/brw_gs_surface_state.c | 2 ++ src/mesa/drivers/dri/i965/brw_tcs_surface_state.c | 2 ++ src/mesa/drivers/dri/i965/brw_tes_surface_state.c | 2 ++ src/mesa/drivers/dri/i965/brw_vs_surface_state.c | 2 ++ src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 2 ++ src/mesa/drivers/dri/i965/gen6_gs_state.c | 2 ++ src/mesa/drivers/dri/i965/gen6_vs_state.c | 2 ++ src/mesa/drivers/dri/i965/gen6_wm_state.c | 3 +++ src/mesa/drivers/dri/i965/gen7_cs_state.c | 3 +++ src/mesa/drivers/dri/i965/gen7_ds_state.c | 2 ++ src/mesa/drivers/dri/i965/gen7_hs_state.c | 3 +++ 11 files changed, 25 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_gs_surface_state.c b/src/mesa/drivers/dri/i965/brw_gs_surface_state.c index 63b40d135b6..f41b449428c 100644 --- a/src/mesa/drivers/dri/i965/brw_gs_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_gs_surface_state.c @@ -23,6 +23,7 @@ #include "main/mtypes.h" #include "program/prog_parameter.h" +#include "main/shaderapi.h" #include "brw_context.h" #include "brw_state.h" @@ -49,6 +50,7 @@ brw_upload_gs_pull_constants(struct brw_context *brw) /* BRW_NEW_GS_PROG_DATA */ const struct brw_vue_prog_data *prog_data = &brw->gs.prog_data->base; + _mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_GEOMETRY); /* _NEW_PROGRAM_CONSTANTS */ brw_upload_pull_constants(brw, BRW_NEW_GS_CONSTBUF, &gp->program.Base, stage_state, &prog_data->base); diff --git a/src/mesa/drivers/dri/i965/brw_tcs_surface_state.c b/src/mesa/drivers/dri/i965/brw_tcs_surface_state.c index 164f05f023c..4f7759e855c 100644 --- a/src/mesa/drivers/dri/i965/brw_tcs_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_tcs_surface_state.c @@ -23,6 +23,7 @@ #include "main/mtypes.h" #include "program/prog_parameter.h" +#include "main/shaderapi.h" #include "brw_context.h" #include "brw_state.h" @@ -49,6 +50,7 @@ brw_upload_tcs_pull_constants(struct brw_context *brw) /* BRW_NEW_TCS_PROG_DATA */ const struct brw_stage_prog_data *prog_data = &brw->tcs.prog_data->base.base; + _mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_TESS_CTRL); /* _NEW_PROGRAM_CONSTANTS */ brw_upload_pull_constants(brw, BRW_NEW_TCS_CONSTBUF, &tcp->program.Base, stage_state, prog_data); diff --git a/src/mesa/drivers/dri/i965/brw_tes_surface_state.c b/src/mesa/drivers/dri/i965/brw_tes_surface_state.c index 2fa954d1d8c..13a55e119c7 100644 --- a/src/mesa/drivers/dri/i965/brw_tes_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_tes_surface_state.c @@ -23,6 +23,7 @@ #include "main/mtypes.h" #include "program/prog_parameter.h" +#include "main/shaderapi.h" #include "brw_context.h" #include "brw_state.h" @@ -49,6 +50,7 @@ brw_upload_tes_pull_constants(struct brw_context *brw) /* BRW_NEW_TES_PROG_DATA */ const struct brw_stage_prog_data *prog_data = &brw->tes.prog_data->base.base; + _mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_TESS_EVAL); /* _NEW_PROGRAM_CONSTANTS */ brw_upload_pull_constants(brw, BRW_NEW_TES_CONSTBUF, &dp->program.Base, stage_state, prog_data); diff --git a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c index 1036cdab054..387a54bdb0b 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c @@ -31,6 +31,7 @@ #include "main/mtypes.h" #include "program/prog_parameter.h" +#include "main/shaderapi.h" #include "brw_context.h" #include "brw_state.h" @@ -118,6 +119,7 @@ brw_upload_vs_pull_constants(struct brw_context *brw) /* BRW_NEW_VS_PROG_DATA */ const struct brw_stage_prog_data *prog_data = &brw->vs.prog_data->base.base; + _mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_VERTEX); /* _NEW_PROGRAM_CONSTANTS */ brw_upload_pull_constants(brw, BRW_NEW_VS_CONSTBUF, &vp->program.Base, stage_state, prog_data); diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 9f340ef92de..38701d04eea 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -39,6 +39,7 @@ #include "program/prog_parameter.h" #include "program/prog_instruction.h" #include "main/framebuffer.h" +#include "main/shaderapi.h" #include "isl/isl.h" @@ -689,6 +690,7 @@ brw_upload_wm_pull_constants(struct brw_context *brw) /* BRW_NEW_FS_PROG_DATA */ struct brw_stage_prog_data *prog_data = &brw->wm.prog_data->base; + _mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_FRAGMENT); /* _NEW_PROGRAM_CONSTANTS */ brw_upload_pull_constants(brw, BRW_NEW_SURFACES, &fp->program.Base, stage_state, prog_data); diff --git a/src/mesa/drivers/dri/i965/gen6_gs_state.c b/src/mesa/drivers/dri/i965/gen6_gs_state.c index da7322ebe9e..67a3e18b8be 100644 --- a/src/mesa/drivers/dri/i965/gen6_gs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_gs_state.c @@ -29,6 +29,7 @@ #include "brw_state.h" #include "brw_defines.h" #include "intel_batchbuffer.h" +#include "main/shaderapi.h" static void gen6_upload_gs_push_constants(struct brw_context *brw) @@ -43,6 +44,7 @@ gen6_upload_gs_push_constants(struct brw_context *brw) /* BRW_NEW_GS_PROG_DATA */ struct brw_stage_prog_data *prog_data = &brw->gs.prog_data->base.base; + _mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_GEOMETRY); gen6_upload_push_constants(brw, &gp->program.Base, prog_data, stage_state, AUB_TRACE_VS_CONSTANTS); } diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c index 0ad74c4fd38..5446ef90509 100644 --- a/src/mesa/drivers/dri/i965/gen6_vs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c @@ -31,6 +31,7 @@ #include "brw_util.h" #include "program/prog_parameter.h" #include "program/prog_statevars.h" +#include "main/shaderapi.h" #include "intel_batchbuffer.h" static void @@ -44,6 +45,7 @@ gen6_upload_vs_push_constants(struct brw_context *brw) /* BRW_NEW_VS_PROG_DATA */ const struct brw_stage_prog_data *prog_data = &brw->vs.prog_data->base.base; + _mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_VERTEX); gen6_upload_push_constants(brw, &vp->program.Base, prog_data, stage_state, AUB_TRACE_VS_CONSTANTS); diff --git a/src/mesa/drivers/dri/i965/gen6_wm_state.c b/src/mesa/drivers/dri/i965/gen6_wm_state.c index 34aa1218b96..b5198b16260 100644 --- a/src/mesa/drivers/dri/i965/gen6_wm_state.c +++ b/src/mesa/drivers/dri/i965/gen6_wm_state.c @@ -33,6 +33,7 @@ #include "program/program.h" #include "program/prog_parameter.h" #include "program/prog_statevars.h" +#include "main/shaderapi.h" #include "main/framebuffer.h" #include "intel_batchbuffer.h" @@ -46,6 +47,8 @@ gen6_upload_wm_push_constants(struct brw_context *brw) /* BRW_NEW_FS_PROG_DATA */ const struct brw_wm_prog_data *prog_data = brw->wm.prog_data; + _mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_FRAGMENT); + gen6_upload_push_constants(brw, &fp->program.Base, &prog_data->base, stage_state, AUB_TRACE_WM_CONSTANTS); diff --git a/src/mesa/drivers/dri/i965/gen7_cs_state.c b/src/mesa/drivers/dri/i965/gen7_cs_state.c index d8b0fe08332..e7c72b6514f 100644 --- a/src/mesa/drivers/dri/i965/gen7_cs_state.c +++ b/src/mesa/drivers/dri/i965/gen7_cs_state.c @@ -32,6 +32,7 @@ #include "brw_state.h" #include "program/prog_statevars.h" #include "compiler/glsl/ir_uniform.h" +#include "main/shaderapi.h" static void brw_upload_cs_state(struct brw_context *brw) @@ -286,6 +287,7 @@ gen7_upload_cs_push_constants(struct brw_context *brw) /* CACHE_NEW_CS_PROG */ struct brw_cs_prog_data *cs_prog_data = brw->cs.prog_data; + _mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_COMPUTE); brw_upload_cs_push_constants(brw, &cp->program.Base, cs_prog_data, stage_state, AUB_TRACE_WM_CONSTANTS); } @@ -318,6 +320,7 @@ brw_upload_cs_pull_constants(struct brw_context *brw) /* BRW_NEW_CS_PROG_DATA */ const struct brw_stage_prog_data *prog_data = &brw->cs.prog_data->base; + _mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_COMPUTE); /* _NEW_PROGRAM_CONSTANTS */ brw_upload_pull_constants(brw, BRW_NEW_SURFACES, &cp->program.Base, stage_state, prog_data); diff --git a/src/mesa/drivers/dri/i965/gen7_ds_state.c b/src/mesa/drivers/dri/i965/gen7_ds_state.c index 3e1a03b230d..a31949c8128 100644 --- a/src/mesa/drivers/dri/i965/gen7_ds_state.c +++ b/src/mesa/drivers/dri/i965/gen7_ds_state.c @@ -25,6 +25,7 @@ #include "brw_state.h" #include "brw_defines.h" #include "intel_batchbuffer.h" +#include "main/shaderapi.h" static void gen7_upload_tes_push_constants(struct brw_context *brw) @@ -37,6 +38,7 @@ gen7_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.prog_data->base.base; + _mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_TESS_EVAL); gen6_upload_push_constants(brw, &tep->program.Base, prog_data, stage_state, AUB_TRACE_VS_CONSTANTS); } diff --git a/src/mesa/drivers/dri/i965/gen7_hs_state.c b/src/mesa/drivers/dri/i965/gen7_hs_state.c index 297d61b36f0..7cde0300710 100644 --- a/src/mesa/drivers/dri/i965/gen7_hs_state.c +++ b/src/mesa/drivers/dri/i965/gen7_hs_state.c @@ -25,6 +25,7 @@ #include "brw_state.h" #include "brw_defines.h" #include "intel_batchbuffer.h" +#include "main/shaderapi.h" static void gen7_upload_tcs_push_constants(struct brw_context *brw) @@ -38,6 +39,8 @@ gen7_upload_tcs_push_constants(struct brw_context *brw) if (active) { /* BRW_NEW_TCS_PROG_DATA */ const struct brw_stage_prog_data *prog_data = &brw->tcs.prog_data->base.base; + + _mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_TESS_CTRL); gen6_upload_push_constants(brw, &tcp->program.Base, prog_data, stage_state, AUB_TRACE_VS_CONSTANTS); } -- 2.30.2