浏览代码

i965: Add tessellation shader push constant support.

Based on a patch by Chris Forbes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
tags/11.2-branchpoint
Kenneth Graunke 10 年前
父节点
当前提交
86a6eda9bc

+ 1
- 1
src/mesa/drivers/dri/i965/brw_context.h 查看文件

@@ -1236,7 +1236,7 @@ struct brw_context
} perfmon;

int num_atoms[BRW_NUM_PIPELINES];
const struct brw_tracked_state render_atoms[74];
const struct brw_tracked_state render_atoms[76];
const struct brw_tracked_state compute_atoms[10];

/* If (INTEL_DEBUG & DEBUG_BATCH) */

+ 2
- 0
src/mesa/drivers/dri/i965/brw_state.h 查看文件

@@ -143,6 +143,7 @@ extern const struct brw_tracked_state gen7_depthbuffer;
extern const struct brw_tracked_state gen7_clip_state;
extern const struct brw_tracked_state gen7_ds_state;
extern const struct brw_tracked_state gen7_gs_state;
extern const struct brw_tracked_state gen7_tcs_push_constants;
extern const struct brw_tracked_state gen7_hs_state;
extern const struct brw_tracked_state gen7_l3_state;
extern const struct brw_tracked_state gen7_ps_state;
@@ -152,6 +153,7 @@ extern const struct brw_tracked_state gen7_sf_clip_viewport;
extern const struct brw_tracked_state gen7_sf_state;
extern const struct brw_tracked_state gen7_sol_state;
extern const struct brw_tracked_state gen7_te_state;
extern const struct brw_tracked_state gen7_tes_push_constants;
extern const struct brw_tracked_state gen7_urb;
extern const struct brw_tracked_state gen7_vs_state;
extern const struct brw_tracked_state gen7_wm_state;

+ 2
- 0
src/mesa/drivers/dri/i965/brw_state_upload.c 查看文件

@@ -294,6 +294,8 @@ static const struct brw_tracked_state *gen8_render_atoms[] =
&brw_wm_image_surfaces, /* Before wm push/pull constants and binding table */

&gen6_vs_push_constants, /* Before vs_state */
&gen7_tcs_push_constants,
&gen7_tes_push_constants,
&gen6_gs_push_constants, /* Before gs_state */
&gen6_wm_push_constants, /* Before wm_surfaces and constant_buffer */


+ 29
- 0
src/mesa/drivers/dri/i965/gen7_ds_state.c 查看文件

@@ -26,6 +26,35 @@
#include "brw_defines.h"
#include "intel_batchbuffer.h"

static void
gen7_upload_tes_push_constants(struct brw_context *brw)
{
struct brw_stage_state *stage_state = &brw->tes.base;
/* BRW_NEW_TESS_EVAL_PROGRAM */
const struct brw_tess_eval_program *tep =
(struct brw_tess_eval_program *) brw->tess_eval_program;

if (tep) {
/* BRW_NEW_TES_PROG_DATA */
const struct brw_stage_prog_data *prog_data = &brw->tes.prog_data->base.base;
gen6_upload_push_constants(brw, &tep->program.Base, prog_data,
stage_state, AUB_TRACE_VS_CONSTANTS);
}

gen7_upload_constant_state(brw, stage_state, tep, _3DSTATE_CONSTANT_DS);
}

const struct brw_tracked_state gen7_tes_push_constants = {
.dirty = {
.mesa = _NEW_PROGRAM_CONSTANTS,
.brw = BRW_NEW_BATCH |
BRW_NEW_PUSH_CONSTANT_ALLOCATION |
BRW_NEW_TESS_EVAL_PROGRAM |
BRW_NEW_TES_PROG_DATA,
},
.emit = gen7_upload_tes_push_constants,
};

static void
gen7_upload_ds_state(struct brw_context *brw)
{

+ 29
- 0
src/mesa/drivers/dri/i965/gen7_hs_state.c 查看文件

@@ -26,6 +26,35 @@
#include "brw_defines.h"
#include "intel_batchbuffer.h"

static void
gen7_upload_tcs_push_constants(struct brw_context *brw)
{
struct brw_stage_state *stage_state = &brw->tcs.base;
/* BRW_NEW_TESS_CTRL_PROGRAM */
const struct brw_tess_ctrl_program *tcp =
(struct brw_tess_ctrl_program *) brw->tess_ctrl_program;

if (tcp) {
/* BRW_NEW_TCS_PROG_DATA */
const struct brw_stage_prog_data *prog_data = &brw->tcs.prog_data->base.base;
gen6_upload_push_constants(brw, &tcp->program.Base, prog_data,
stage_state, AUB_TRACE_VS_CONSTANTS);
}

gen7_upload_constant_state(brw, stage_state, tcp, _3DSTATE_CONSTANT_HS);
}

const struct brw_tracked_state gen7_tcs_push_constants = {
.dirty = {
.mesa = _NEW_PROGRAM_CONSTANTS,
.brw = BRW_NEW_BATCH |
BRW_NEW_PUSH_CONSTANT_ALLOCATION |
BRW_NEW_TESS_CTRL_PROGRAM |
BRW_NEW_TCS_PROG_DATA,
},
.emit = gen7_upload_tcs_push_constants,
};

static void
gen7_upload_hs_state(struct brw_context *brw)
{

+ 0
- 14
src/mesa/drivers/dri/i965/gen8_ds_state.c 查看文件

@@ -30,20 +30,6 @@ static void
gen8_upload_ds_state(struct brw_context *brw)
{
/* Disable the DS Unit */
BEGIN_BATCH(11);
OUT_BATCH(_3DSTATE_CONSTANT_DS << 16 | (11 - 2));
OUT_BATCH(0);
OUT_BATCH(0);
OUT_BATCH(0);
OUT_BATCH(0);
OUT_BATCH(0);
OUT_BATCH(0);
OUT_BATCH(0);
OUT_BATCH(0);
OUT_BATCH(0);
OUT_BATCH(0);
ADVANCE_BATCH();

int ds_pkt_len = brw->gen >= 9 ? 11 : 9;
BEGIN_BATCH(ds_pkt_len);
OUT_BATCH(_3DSTATE_DS << 16 | (ds_pkt_len - 2));

+ 0
- 14
src/mesa/drivers/dri/i965/gen8_hs_state.c 查看文件

@@ -30,20 +30,6 @@ static void
gen8_upload_hs_state(struct brw_context *brw)
{
/* Disable the HS Unit */
BEGIN_BATCH(11);
OUT_BATCH(_3DSTATE_CONSTANT_HS << 16 | (11 - 2));
OUT_BATCH(0);
OUT_BATCH(0);
OUT_BATCH(0);
OUT_BATCH(0);
OUT_BATCH(0);
OUT_BATCH(0);
OUT_BATCH(0);
OUT_BATCH(0);
OUT_BATCH(0);
OUT_BATCH(0);
ADVANCE_BATCH();

BEGIN_BATCH(9);
OUT_BATCH(_3DSTATE_HS << 16 | (9 - 2));
OUT_BATCH(0);

正在加载...
取消
保存