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 <airlied@redhat.com>
Acked-by: Andres Gomez <agomez@igalia.com>
This commit is contained in:
Dave Airlie 2016-06-07 15:25:57 +10:00
parent ea783667e4
commit 4adad99cfb
11 changed files with 25 additions and 0 deletions

View 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);

View 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);

View 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);

View 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);

View 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);

View 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);
}

View 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);

View 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);

View 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);

View 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);
}

View 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);
}