r600g: fix pointsprite & resource unbinding
When asking to bind NULL resource assume it's unbinding so free resource and unreference assoicated buffer. Also fix pointsprite parameter. Fix glsl-fs-pointcoord & fp-fragment-position Signed-off-by: Jerome Glisse <jglisse@redhat.com>
This commit is contained in:
parent
99c422ef5a
commit
1617daaf49
|
@ -1524,7 +1524,8 @@ void evergreen_pipe_shader_ps(struct pipe_context *ctx, struct r600_pipe_shader
|
|||
}
|
||||
if (rshader->input[i].name == TGSI_SEMANTIC_FACE)
|
||||
have_face = TRUE;
|
||||
if (rctx->sprite_coord_enable & (1 << i)) {
|
||||
if (rshader->input[i].name == TGSI_SEMANTIC_GENERIC &&
|
||||
rctx->sprite_coord_enable & (1 << rshader->input[i].sid)) {
|
||||
tmp |= S_028644_PT_SPRITE_TEX(1);
|
||||
}
|
||||
r600_pipe_state_add_reg(rstate, EVERGREEN_GROUP_CONTEXT, R_028644_SPI_PS_INPUT_CNTL_0 + i * 4, tmp, 0xFFFFFFFF, NULL);
|
||||
|
|
|
@ -127,7 +127,8 @@ static void r600_pipe_shader_ps(struct pipe_context *ctx, struct r600_pipe_shade
|
|||
}
|
||||
if (rshader->input[i].name == TGSI_SEMANTIC_FACE)
|
||||
have_face = TRUE;
|
||||
if (rctx->sprite_coord_enable & (1 << i)) {
|
||||
if (rshader->input[i].name == TGSI_SEMANTIC_GENERIC &&
|
||||
rctx->sprite_coord_enable & (1 << rshader->input[i].sid)) {
|
||||
tmp |= S_028644_PT_SPRITE_TEX(1);
|
||||
}
|
||||
r600_pipe_state_add_reg(rstate, R600_GROUP_CONTEXT, R_028644_SPI_PS_INPUT_CNTL_0 + i * 4, tmp, 0xFFFFFFFF, NULL);
|
||||
|
|
|
@ -625,6 +625,12 @@ static inline void evergreen_context_pipe_state_set_resource(struct r600_context
|
|||
offset -= ctx->groups[EVERGREEN_GROUP_RESOURCE].start_offset;
|
||||
id = ctx->groups[EVERGREEN_GROUP_RESOURCE].offset_block_id[offset >> 2];
|
||||
block = &ctx->groups[EVERGREEN_GROUP_RESOURCE].blocks[id];
|
||||
if (state == NULL) {
|
||||
block->status &= ~(R600_BLOCK_STATUS_ENABLED | R600_BLOCK_STATUS_DIRTY);
|
||||
radeon_ws_bo_reference(ctx->radeon, &block->reloc[1].bo, NULL);
|
||||
radeon_ws_bo_reference(ctx->radeon , &block->reloc[2].bo, NULL);
|
||||
return;
|
||||
}
|
||||
block->reg[0] = state->regs[0].value;
|
||||
block->reg[1] = state->regs[1].value;
|
||||
block->reg[2] = state->regs[2].value;
|
||||
|
@ -673,6 +679,10 @@ static inline void evergreen_context_pipe_state_set_sampler(struct r600_context
|
|||
offset -= ctx->groups[EVERGREEN_GROUP_SAMPLER].start_offset;
|
||||
id = ctx->groups[EVERGREEN_GROUP_SAMPLER].offset_block_id[offset >> 2];
|
||||
block = &ctx->groups[EVERGREEN_GROUP_SAMPLER].blocks[id];
|
||||
if (state == NULL) {
|
||||
block->status &= ~(R600_BLOCK_STATUS_ENABLED | R600_BLOCK_STATUS_DIRTY);
|
||||
return;
|
||||
}
|
||||
block->reg[0] = state->regs[0].value;
|
||||
block->reg[1] = state->regs[1].value;
|
||||
block->reg[2] = state->regs[2].value;
|
||||
|
@ -689,6 +699,13 @@ static inline void evergreen_context_pipe_state_set_sampler_border(struct r600_c
|
|||
fake_offset -= ctx->groups[EVERGREEN_GROUP_SAMPLER_BORDER].start_offset;
|
||||
id = ctx->groups[EVERGREEN_GROUP_SAMPLER_BORDER].offset_block_id[fake_offset >> 2];
|
||||
block = &ctx->groups[EVERGREEN_GROUP_SAMPLER_BORDER].blocks[id];
|
||||
if (state == NULL) {
|
||||
block->status &= ~(R600_BLOCK_STATUS_ENABLED | R600_BLOCK_STATUS_DIRTY);
|
||||
return;
|
||||
}
|
||||
if (state->nregs <= 3) {
|
||||
return;
|
||||
}
|
||||
block->reg[0] = id;
|
||||
block->reg[1] = state->regs[3].value;
|
||||
block->reg[2] = state->regs[4].value;
|
||||
|
@ -704,9 +721,7 @@ void evergreen_context_pipe_state_set_ps_sampler(struct r600_context *ctx, struc
|
|||
|
||||
offset = 0x0003C000 + id * 0xc;
|
||||
evergreen_context_pipe_state_set_sampler(ctx, state, offset);
|
||||
if (state->nregs > 3) {
|
||||
evergreen_context_pipe_state_set_sampler_border(ctx, state, R_00A400_TD_PS_SAMPLER0_BORDER_INDEX, id);
|
||||
}
|
||||
evergreen_context_pipe_state_set_sampler_border(ctx, state, R_00A400_TD_PS_SAMPLER0_BORDER_INDEX, id);
|
||||
}
|
||||
|
||||
void evergreen_context_pipe_state_set_vs_sampler(struct r600_context *ctx, struct r600_pipe_state *state, unsigned id)
|
||||
|
@ -715,9 +730,7 @@ void evergreen_context_pipe_state_set_vs_sampler(struct r600_context *ctx, struc
|
|||
|
||||
offset = 0x0003C0D8 + id * 0xc;
|
||||
evergreen_context_pipe_state_set_sampler(ctx, state, offset);
|
||||
if (state->nregs > 3) {
|
||||
evergreen_context_pipe_state_set_sampler_border(ctx, state, R_00A414_TD_VS_SAMPLER0_BORDER_INDEX, id);
|
||||
}
|
||||
evergreen_context_pipe_state_set_sampler_border(ctx, state, R_00A414_TD_VS_SAMPLER0_BORDER_INDEX, id);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -802,6 +802,12 @@ static inline void r600_context_pipe_state_set_resource(struct r600_context *ctx
|
|||
offset -= ctx->groups[R600_GROUP_RESOURCE].start_offset;
|
||||
id = ctx->groups[R600_GROUP_RESOURCE].offset_block_id[offset >> 2];
|
||||
block = &ctx->groups[R600_GROUP_RESOURCE].blocks[id];
|
||||
if (state == NULL) {
|
||||
block->status &= ~(R600_BLOCK_STATUS_ENABLED | R600_BLOCK_STATUS_DIRTY);
|
||||
radeon_ws_bo_reference(ctx->radeon, &block->reloc[1].bo, NULL);
|
||||
radeon_ws_bo_reference(ctx->radeon , &block->reloc[2].bo, NULL);
|
||||
return;
|
||||
}
|
||||
block->reg[0] = state->regs[0].value;
|
||||
block->reg[1] = state->regs[1].value;
|
||||
block->reg[2] = state->regs[2].value;
|
||||
|
@ -849,6 +855,10 @@ static inline void r600_context_pipe_state_set_sampler(struct r600_context *ctx,
|
|||
offset -= ctx->groups[R600_GROUP_SAMPLER].start_offset;
|
||||
id = ctx->groups[R600_GROUP_SAMPLER].offset_block_id[offset >> 2];
|
||||
block = &ctx->groups[R600_GROUP_SAMPLER].blocks[id];
|
||||
if (state == NULL) {
|
||||
block->status &= ~(R600_BLOCK_STATUS_ENABLED | R600_BLOCK_STATUS_DIRTY);
|
||||
return;
|
||||
}
|
||||
block->reg[0] = state->regs[0].value;
|
||||
block->reg[1] = state->regs[1].value;
|
||||
block->reg[2] = state->regs[2].value;
|
||||
|
@ -865,6 +875,13 @@ static inline void r600_context_pipe_state_set_sampler_border(struct r600_contex
|
|||
offset -= ctx->groups[R600_GROUP_CONFIG].start_offset;
|
||||
id = ctx->groups[R600_GROUP_CONFIG].offset_block_id[offset >> 2];
|
||||
block = &ctx->groups[R600_GROUP_CONFIG].blocks[id];
|
||||
if (state == NULL) {
|
||||
block->status &= ~(R600_BLOCK_STATUS_ENABLED | R600_BLOCK_STATUS_DIRTY);
|
||||
return;
|
||||
}
|
||||
if (state->nregs <= 3) {
|
||||
return;
|
||||
}
|
||||
block->reg[0] = state->regs[3].value;
|
||||
block->reg[1] = state->regs[4].value;
|
||||
block->reg[2] = state->regs[5].value;
|
||||
|
@ -880,10 +897,8 @@ void r600_context_pipe_state_set_ps_sampler(struct r600_context *ctx, struct r60
|
|||
|
||||
offset = 0x0003C000 + id * 0xc;
|
||||
r600_context_pipe_state_set_sampler(ctx, state, offset);
|
||||
if (state->nregs > 3) {
|
||||
offset = 0x0000A400 + id * 0x10;
|
||||
r600_context_pipe_state_set_sampler_border(ctx, state, offset);
|
||||
}
|
||||
offset = 0x0000A400 + id * 0x10;
|
||||
r600_context_pipe_state_set_sampler_border(ctx, state, offset);
|
||||
}
|
||||
|
||||
void r600_context_pipe_state_set_vs_sampler(struct r600_context *ctx, struct r600_pipe_state *state, unsigned id)
|
||||
|
@ -892,10 +907,8 @@ void r600_context_pipe_state_set_vs_sampler(struct r600_context *ctx, struct r60
|
|||
|
||||
offset = 0x0003C0D8 + id * 0xc;
|
||||
r600_context_pipe_state_set_sampler(ctx, state, offset);
|
||||
if (state->nregs > 3) {
|
||||
offset = 0x0000A600 + id * 0x10;
|
||||
r600_context_pipe_state_set_sampler_border(ctx, state, offset);
|
||||
}
|
||||
offset = 0x0000A600 + id * 0x10;
|
||||
r600_context_pipe_state_set_sampler_border(ctx, state, offset);
|
||||
}
|
||||
|
||||
void r600_context_group_emit_dirty(struct r600_context *ctx, struct r600_group *group)
|
||||
|
|
Loading…
Reference in New Issue