if (memcmp(&dest->viewport.viewports, &src->viewport.viewports,
src->viewport.count * sizeof(VkViewport))) {
typed_memcpy(dest->viewport.viewports, src->viewport.viewports, src->viewport.count);
+ typed_memcpy(dest->viewport.xform, src->viewport.xform, src->viewport.count);
dest_mask |= RADV_DYNAMIC_VIEWPORT;
}
}
int i;
const unsigned count = viewport->count;
const unsigned first_vp = 0;
- const VkViewport *viewports = viewport->viewports;
assert(count);
radeon_set_context_reg_seq(cmd_buffer->cs, R_02843C_PA_CL_VPORT_XSCALE + first_vp * 4 * 6, count * 6);
for (i = 0; i < count; i++) {
- float scale[3], translate[3];
-
- radv_get_viewport_xform(&viewports[i], scale, translate);
- radeon_emit(cmd_buffer->cs, fui(scale[0]));
- radeon_emit(cmd_buffer->cs, fui(translate[0]));
- radeon_emit(cmd_buffer->cs, fui(scale[1]));
- radeon_emit(cmd_buffer->cs, fui(translate[1]));
- radeon_emit(cmd_buffer->cs, fui(scale[2]));
- radeon_emit(cmd_buffer->cs, fui(translate[2]));
+ radeon_emit(cmd_buffer->cs, fui(viewport->xform[i].scale[0]));
+ radeon_emit(cmd_buffer->cs, fui(viewport->xform[i].translate[0]));
+ radeon_emit(cmd_buffer->cs, fui(viewport->xform[i].scale[1]));
+ radeon_emit(cmd_buffer->cs, fui(viewport->xform[i].translate[1]));
+ radeon_emit(cmd_buffer->cs, fui(viewport->xform[i].scale[2]));
+ radeon_emit(cmd_buffer->cs, fui(viewport->xform[i].translate[2]));
}
- radeon_set_context_reg_seq(cmd_buffer->cs, R_0282D0_PA_SC_VPORT_ZMIN_0 + first_vp * 4 * 2, count * 2);
+ radeon_set_context_reg_seq(cmd_buffer->cmd_buffer->cs, R_0282D0_PA_SC_VPORT_ZMIN_0 + first_vp * 4 * 2, count * 2);
for (i = 0; i < count; i++) {
- float zmin = MIN2(viewports[i].minDepth, viewports[i].maxDepth);
- float zmax = MAX2(viewports[i].minDepth, viewports[i].maxDepth);
+ float zmin = MIN2(viewport->viewports[i].minDepth, viewport->viewports[i].maxDepth);
+ float zmax = MAX2(viewport->viewports[i].minDepth, viewport->viewports[i].maxDepth);
radeon_emit(cmd_buffer->cs, fui(zmin));
radeon_emit(cmd_buffer->cs, fui(zmax));
}
memcpy(state->dynamic.viewport.viewports + firstViewport, pViewports,
viewportCount * sizeof(*pViewports));
+ for (unsigned i = firstViewport; i < firstViewport + viewportCount; i++)
+ radv_get_viewport_xform(&pViewports[i], state->dynamic.viewport.xform[i].scale, state->dynamic.viewport.xform[i].translate);
state->dirty |= RADV_CMD_DIRTY_DYNAMIC_VIEWPORT;
}
state->viewport.count = cmd_buffer->state.dynamic.viewport.count;
typed_memcpy(state->viewport.viewports, cmd_buffer->state.dynamic.viewport.viewports,
MAX_VIEWPORTS);
+ typed_memcpy(state->viewport.xform, cmd_buffer->state.dynamic.viewport.xform,
+ MAX_VIEWPORTS);
/* Save all scissors. */
state->scissor.count = cmd_buffer->state.dynamic.scissor.count;
cmd_buffer->state.dynamic.viewport.count = state->viewport.count;
typed_memcpy(cmd_buffer->state.dynamic.viewport.viewports, state->viewport.viewports,
MAX_VIEWPORTS);
+ typed_memcpy(cmd_buffer->state.dynamic.viewport.xform, state->viewport.xform,
+ MAX_VIEWPORTS);
/* Restore all scissors. */
cmd_buffer->state.dynamic.scissor.count = state->scissor.count;