{
/* 3DSTATE_SF */
if (DIRTY(RASTERIZER) || DIRTY(VS) || DIRTY(GS) || DIRTY(FS)) {
- const struct ilo_shader *fs = (ilo->fs)? ilo->fs->shader : NULL;
- const struct ilo_shader *last_sh =
- (ilo->gs)? ilo->gs->shader :
- (ilo->vs)? ilo->vs->shader : NULL;
-
- p->gen6_3DSTATE_SF(p->dev, ilo->rasterizer, fs, last_sh, p->cp);
+ p->gen6_3DSTATE_SF(p->dev, ilo->rasterizer, ilo->fs,
+ (ilo->gs) ? ilo->gs : ilo->vs, p->cp);
}
}
/* 3DSTATE_CONSTANT_HS and 3DSTATE_HS */
if (session->hw_ctx_changed) {
p->gen7_3DSTATE_CONSTANT_HS(p->dev, 0, 0, 0, p->cp);
- p->gen7_3DSTATE_HS(p->dev, NULL, 0, 0, p->cp);
+ p->gen7_3DSTATE_HS(p->dev, NULL, 0, p->cp);
}
/* 3DSTATE_BINDING_TABLE_POINTERS_HS */
/* 3DSTATE_CONSTANT_DS and 3DSTATE_DS */
if (session->hw_ctx_changed) {
p->gen7_3DSTATE_CONSTANT_DS(p->dev, 0, 0, 0, p->cp);
- p->gen7_3DSTATE_DS(p->dev, NULL, 0, 0, p->cp);
+ p->gen7_3DSTATE_DS(p->dev, NULL, 0, p->cp);
}
/* 3DSTATE_BINDING_TABLE_POINTERS_DS */
{
/* 3DSTATE_SBE */
if (DIRTY(RASTERIZER) || DIRTY(VS) || DIRTY(GS) || DIRTY(FS)) {
- const struct ilo_shader *fs = (ilo->fs)? ilo->fs->shader : NULL;
- const struct ilo_shader *last_sh =
- (ilo->gs)? ilo->gs->shader :
- (ilo->vs)? ilo->vs->shader : NULL;
-
- p->gen7_3DSTATE_SBE(p->dev, ilo->rasterizer, fs, last_sh, p->cp);
+ p->gen7_3DSTATE_SBE(p->dev, ilo->rasterizer, ilo->fs,
+ (ilo->gs) ? ilo->gs : ilo->vs, ilo->cp);
}
/* 3DSTATE_SF */
void
ilo_gpe_gen6_fill_3dstate_sf_sbe(const struct ilo_dev_info *dev,
const struct ilo_rasterizer_state *rasterizer,
- const struct ilo_shader *fs,
- const struct ilo_shader *last_sh,
+ const struct ilo_shader_state *fs_state,
+ const struct ilo_shader_state *last_sh_state,
uint32_t *dw, int num_dwords)
{
+ const struct ilo_shader *fs = fs_state->shader;
+ const struct ilo_shader *last_sh = last_sh_state->shader;
uint32_t point_sprite_enable, const_interp_enable;
uint16_t attr_ctrl[PIPE_MAX_SHADER_INPUTS];
int vue_offset, vue_len;
static void
gen6_emit_3DSTATE_SF(const struct ilo_dev_info *dev,
const struct ilo_rasterizer_state *rasterizer,
- const struct ilo_shader *fs,
- const struct ilo_shader *last_sh,
+ const struct ilo_shader_state *fs,
+ const struct ilo_shader_state *last_sh,
struct ilo_cp *cp)
{
const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x13);
static uint32_t
gen6_emit_INTERFACE_DESCRIPTOR_DATA(const struct ilo_dev_info *dev,
- const struct ilo_shader **cs,
+ const struct ilo_shader_state **cs,
uint32_t *sampler_state,
int *num_samplers,
uint32_t *binding_table_state,
state_len, state_align, &state_offset);
for (i = 0; i < num_ids; i++) {
- int curbe_read_len;
-
- curbe_read_len = (cs[i]->pcb.clip_state_size + 31) / 32;
-
- dw[0] = cs[i]->cache_offset;
+ dw[0] = ilo_shader_get_kernel_offset(cs[i]);
dw[1] = 1 << 18; /* SPF */
dw[2] = sampler_state[i] |
(num_samplers[i] + 3) / 4 << 2;
dw[3] = binding_table_state[i] |
num_surfaces[i];
- dw[4] = curbe_read_len << 16 | /* CURBE Read Length */
- 0; /* CURBE Read Offset */
+ dw[4] = 0 << 16 | /* CURBE Read Length */
+ 0; /* CURBE Read Offset */
dw[5] = 0; /* Barrier ID */
dw[6] = 0;
dw[7] = 0;
typedef void
(*ilo_gpe_gen6_3DSTATE_SF)(const struct ilo_dev_info *dev,
const struct ilo_rasterizer_state *rasterizer,
- const struct ilo_shader *fs,
- const struct ilo_shader *last_sh,
+ const struct ilo_shader_state *fs,
+ const struct ilo_shader_state *last_sh,
struct ilo_cp *cp);
typedef void
typedef uint32_t
(*ilo_gpe_gen6_INTERFACE_DESCRIPTOR_DATA)(const struct ilo_dev_info *dev,
- const struct ilo_shader **cs,
+ const struct ilo_shader_state **cs,
uint32_t *sampler_state,
int *num_samplers,
uint32_t *binding_table_state,
void
ilo_gpe_gen6_fill_3dstate_sf_sbe(const struct ilo_dev_info *dev,
const struct ilo_rasterizer_state *rasterizer,
- const struct ilo_shader *fs,
- const struct ilo_shader *last_sh,
+ const struct ilo_shader_state *fs,
+ const struct ilo_shader_state *last_sh,
uint32_t *dw, int num_dwords);
#endif /* ILO_GPE_GEN6_H */
#include "brw_defines.h"
#include "intel_reg.h"
-#include "shader/ilo_shader_internal.h"
#include "ilo_cp.h"
#include "ilo_format.h"
#include "ilo_resource.h"
static void
gen7_emit_3DSTATE_HS(const struct ilo_dev_info *dev,
- const struct ilo_shader *hs,
- int max_threads, int num_samplers,
+ const struct ilo_shader_state *hs,
+ int num_samplers,
struct ilo_cp *cp)
{
const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x1b);
const uint8_t cmd_len = 7;
- uint32_t dw1, dw2, dw5;
ILO_GPE_VALID_GEN(dev, 7, 7);
- if (!hs) {
- ilo_cp_begin(cp, cmd_len);
- ilo_cp_write(cp, cmd | (cmd_len - 2));
- ilo_cp_write(cp, 0);
- ilo_cp_write(cp, 0);
- ilo_cp_write(cp, 0);
- ilo_cp_write(cp, 0);
- ilo_cp_write(cp, 0);
- ilo_cp_write(cp, 0);
- ilo_cp_end(cp);
-
- return;
- }
-
- dw1 = (num_samplers + 3) / 4 << 27 |
- 0 << 18 |
- (max_threads - 1);
- if (false)
- dw1 |= 1 << 16;
-
- dw2 = 1 << 31 | /* HS Enable */
- 1 << 29 | /* HS Statistics Enable */
- 0; /* Instance Count */
-
- dw5 = hs->in.start_grf << 19 |
- 0 << 11 |
- 0 << 4;
+ assert(!hs);
ilo_cp_begin(cp, cmd_len);
ilo_cp_write(cp, cmd | (cmd_len - 2));
- ilo_cp_write(cp, dw1);
- ilo_cp_write(cp, dw2);
- ilo_cp_write(cp, hs->cache_offset);
ilo_cp_write(cp, 0);
- ilo_cp_write(cp, dw5);
+ ilo_cp_write(cp, 0);
+ ilo_cp_write(cp, 0);
+ ilo_cp_write(cp, 0);
+ ilo_cp_write(cp, 0);
ilo_cp_write(cp, 0);
ilo_cp_end(cp);
}
static void
gen7_emit_3DSTATE_DS(const struct ilo_dev_info *dev,
- const struct ilo_shader *ds,
- int max_threads, int num_samplers,
+ const struct ilo_shader_state *ds,
+ int num_samplers,
struct ilo_cp *cp)
{
const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x1d);
const uint8_t cmd_len = 6;
- uint32_t dw2, dw4, dw5;
ILO_GPE_VALID_GEN(dev, 7, 7);
- if (!ds) {
- ilo_cp_begin(cp, cmd_len);
- ilo_cp_write(cp, cmd | (cmd_len - 2));
- ilo_cp_write(cp, 0);
- ilo_cp_write(cp, 0);
- ilo_cp_write(cp, 0);
- ilo_cp_write(cp, 0);
- ilo_cp_write(cp, 0);
- ilo_cp_end(cp);
-
- return;
- }
-
- dw2 = (num_samplers + 3) / 4 << 27 |
- 0 << 18 |
- (max_threads - 1);
- if (false)
- dw2 |= 1 << 16;
-
- dw4 = ds->in.start_grf << 20 |
- 0 << 11 |
- 0 << 4;
-
- dw5 = (max_threads - 1) << 25 |
- 1 << 10 |
- 1;
+ assert(!ds);
ilo_cp_begin(cp, cmd_len);
ilo_cp_write(cp, cmd | (cmd_len - 2));
- ilo_cp_write(cp, ds->cache_offset);
- ilo_cp_write(cp, dw2);
ilo_cp_write(cp, 0);
- ilo_cp_write(cp, dw4);
- ilo_cp_write(cp, dw5);
+ ilo_cp_write(cp, 0);
+ ilo_cp_write(cp, 0);
+ ilo_cp_write(cp, 0);
+ ilo_cp_write(cp, 0);
ilo_cp_end(cp);
+
}
static void
static void
gen7_emit_3DSTATE_SBE(const struct ilo_dev_info *dev,
const struct ilo_rasterizer_state *rasterizer,
- const struct ilo_shader *fs,
- const struct ilo_shader *last_sh,
+ const struct ilo_shader_state *fs,
+ const struct ilo_shader_state *last_sh,
struct ilo_cp *cp)
{
const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x1f);
typedef void
(*ilo_gpe_gen7_3DSTATE_HS)(const struct ilo_dev_info *dev,
- const struct ilo_shader *hs,
- int max_threads, int num_samplers,
+ const struct ilo_shader_state *hs,
+ int num_samplers,
struct ilo_cp *cp);
typedef void
typedef void
(*ilo_gpe_gen7_3DSTATE_DS)(const struct ilo_dev_info *dev,
- const struct ilo_shader *ds,
- int max_threads, int num_samplers,
+ const struct ilo_shader_state *ds,
+ int num_samplers,
struct ilo_cp *cp);
typedef void
typedef void
(*ilo_gpe_gen7_3DSTATE_SBE)(const struct ilo_dev_info *dev,
const struct ilo_rasterizer_state *rasterizer,
- const struct ilo_shader *fs,
- const struct ilo_shader *last_sh,
+ const struct ilo_shader_state *fs,
+ const struct ilo_shader_state *last_sh,
struct ilo_cp *cp);
typedef void