i965: use new subroutine index uploader.
authorDave Airlie <airlied@redhat.com>
Tue, 7 Jun 2016 05:25:57 +0000 (15:25 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 23 Aug 2016 01:03:45 +0000 (11:03 +1000)
This plugs the subroutine index updates into the i965 backend,
where it loads constants.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Acked-by: Andres Gomez <agomez@igalia.com>
src/mesa/drivers/dri/i965/brw_gs_surface_state.c
src/mesa/drivers/dri/i965/brw_tcs_surface_state.c
src/mesa/drivers/dri/i965/brw_tes_surface_state.c
src/mesa/drivers/dri/i965/brw_vs_surface_state.c
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/i965/gen6_gs_state.c
src/mesa/drivers/dri/i965/gen6_vs_state.c
src/mesa/drivers/dri/i965/gen6_wm_state.c
src/mesa/drivers/dri/i965/gen7_cs_state.c
src/mesa/drivers/dri/i965/gen7_ds_state.c
src/mesa/drivers/dri/i965/gen7_hs_state.c

index 63b40d135b6f19dbeafd7253c070b57fa7e9c9c5..f41b449428c9b55f78e83710e5dd6b4a559d49f8 100644 (file)
@@ -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);
index 164f05f023c361a0df85b2670fb01229efb4c012..4f7759e855cfc871d032ff732298956cc572c57a 100644 (file)
@@ -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);
index 2fa954d1d8cf2215cdc525f0712363c93d3facce..13a55e119c7c02d9c4c87d2883fcd2bfc6979aa8 100644 (file)
@@ -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);
index 1036cdab054ca058af91de8af32d6a9a3b9d530d..387a54bdb0b4fc346ca0a0887e7fa0b71377d361 100644 (file)
@@ -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);
index 9f340ef92de1c2dd90242635f902ea9b97e1074d..38701d04eeae923361518560b42a9da0ad482369 100644 (file)
@@ -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);
index da7322ebe9e6da162e7ea240728cac3083cb11e9..67a3e18b8bec23651bb45243eef087f3b32e04eb 100644 (file)
@@ -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);
    }
index 0ad74c4fd3801ac8285b9cdd6d4ee23a1df6dcac..5446ef90509a9d8eb24eefd9244bad79e165fb43 100644 (file)
@@ -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);
 
index 34aa1218b9674ca303253a34a4291cee2a69e306..b5198b16260f79e0feb5e9d8210c79608292ba14 100644 (file)
@@ -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);
 
index d8b0fe0833258b45c047756f07c2709a6a751831..e7c72b6514f50781a8dbfc0ba6bb9da1f5afd210 100644 (file)
@@ -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);
index 3e1a03b230d34b5f803dbabda705b254e433ed51..a31949c8128765bc52c38dd2869725063b82e232 100644 (file)
@@ -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);
    }
index 297d61b36f08eb16770c4c19af75580497b36a49..7cde0300710037c4a6ddc7ca58ded0e9fb03394e 100644 (file)
@@ -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);
    }