v3dv: don't reset descriptor state after a meta operation

If the meta operation did not change descriptor state then we should keep it,
not reset it.

Fixes:
dEQP-VK.fragment_operations.early_fragment.early_fragment_tests_stencil
dEQP-VK.fragment_operations.early_fragment.no_early_fragment_tests_stencil

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
This commit is contained in:
Iago Toral Quiroga 2020-06-25 09:30:04 +02:00 committed by Marge Bot
parent 4b9e3bbf48
commit e59e706928
2 changed files with 18 additions and 10 deletions

View File

@ -3572,9 +3572,14 @@ v3dv_cmd_buffer_meta_state_push(struct v3dv_cmd_buffer *cmd_buffer,
*/
struct v3dv_descriptor_state *gfx_descriptor_state =
&state->descriptor_state[VK_PIPELINE_BIND_POINT_GRAPHICS];
if (push_descriptor_state && gfx_descriptor_state->valid != 0) {
memcpy(&state->meta.descriptor_state, gfx_descriptor_state,
sizeof(state->descriptor_state));
if (push_descriptor_state) {
if (gfx_descriptor_state->valid != 0) {
memcpy(&state->meta.descriptor_state, gfx_descriptor_state,
sizeof(state->descriptor_state));
}
state->meta.has_descriptor_state = true;
} else {
state->meta.has_descriptor_state = false;
}
/* FIXME: if we keep track of wether we have bound any push constant state
@ -3629,12 +3634,14 @@ v3dv_cmd_buffer_meta_state_pop(struct v3dv_cmd_buffer *cmd_buffer,
state->pipeline = VK_NULL_HANDLE;
}
if (state->meta.descriptor_state.valid != 0) {
memcpy(&state->descriptor_state[VK_PIPELINE_BIND_POINT_GRAPHICS],
&state->meta.descriptor_state,
sizeof(state->descriptor_state));
} else {
state->descriptor_state[VK_PIPELINE_BIND_POINT_GRAPHICS].valid = 0;
if (state->meta.has_descriptor_state) {
if (state->meta.descriptor_state.valid != 0) {
memcpy(&state->descriptor_state[VK_PIPELINE_BIND_POINT_GRAPHICS],
&state->meta.descriptor_state,
sizeof(state->descriptor_state));
} else {
state->descriptor_state[VK_PIPELINE_BIND_POINT_GRAPHICS].valid = 0;
}
}
memcpy(cmd_buffer->push_constants_data, state->meta.push_constants,
@ -3644,7 +3651,7 @@ v3dv_cmd_buffer_meta_state_pop(struct v3dv_cmd_buffer *cmd_buffer,
state->meta.framebuffer = VK_NULL_HANDLE;
state->meta.pass = VK_NULL_HANDLE;
state->meta.subpass_idx = -1;
state->meta.descriptor_state.valid = 0;
state->meta.has_descriptor_state = false;
}
/* FIXME: C&P from v3dx_draw. Refactor to common place? */

View File

@ -914,6 +914,7 @@ struct v3dv_cmd_buffer_state {
struct v3dv_dynamic_state dynamic;
struct v3dv_descriptor_state descriptor_state;
bool has_descriptor_state;
uint32_t push_constants[MAX_PUSH_CONSTANTS_SIZE / 4];
} meta;