tu_tiling_config_update_pipes(tiling, dev);
}
-const struct tu_dynamic_state default_dynamic_state = {
- .viewport =
- {
- .count = 0,
- },
- .scissor =
- {
- .count = 0,
- },
- .line_width = 1.0f,
- .depth_bias =
- {
- .bias = 0.0f,
- .clamp = 0.0f,
- .slope = 0.0f,
- },
- .blend_constants = { 0.0f, 0.0f, 0.0f, 0.0f },
- .depth_bounds =
- {
- .min = 0.0f,
- .max = 1.0f,
- },
- .stencil_compare_mask =
- {
- .front = ~0u,
- .back = ~0u,
- },
- .stencil_write_mask =
- {
- .front = ~0u,
- .back = ~0u,
- },
- .stencil_reference =
- {
- .front = 0u,
- .back = 0u,
- },
-};
-
-static void UNUSED /* FINISHME */
-tu_bind_dynamic_state(struct tu_cmd_buffer *cmd_buffer,
- const struct tu_dynamic_state *src)
-{
- struct tu_dynamic_state *dest = &cmd_buffer->state.dynamic;
- uint32_t copy_mask = src->mask;
- uint32_t dest_mask = 0;
-
- tu_use_args(cmd_buffer); /* FINISHME */
-
- /* Make sure to copy the number of viewports/scissors because they can
- * only be specified at pipeline creation time.
- */
- dest->viewport.count = src->viewport.count;
- dest->scissor.count = src->scissor.count;
- dest->discard_rectangle.count = src->discard_rectangle.count;
-
- if (copy_mask & TU_DYNAMIC_VIEWPORT) {
- if (memcmp(&dest->viewport.viewports, &src->viewport.viewports,
- src->viewport.count * sizeof(VkViewport))) {
- typed_memcpy(dest->viewport.viewports, src->viewport.viewports,
- src->viewport.count);
- dest_mask |= TU_DYNAMIC_VIEWPORT;
- }
- }
-
- if (copy_mask & TU_DYNAMIC_SCISSOR) {
- if (memcmp(&dest->scissor.scissors, &src->scissor.scissors,
- src->scissor.count * sizeof(VkRect2D))) {
- typed_memcpy(dest->scissor.scissors, src->scissor.scissors,
- src->scissor.count);
- dest_mask |= TU_DYNAMIC_SCISSOR;
- }
- }
-
- if (copy_mask & TU_DYNAMIC_LINE_WIDTH) {
- if (dest->line_width != src->line_width) {
- dest->line_width = src->line_width;
- dest_mask |= TU_DYNAMIC_LINE_WIDTH;
- }
- }
-
- if (copy_mask & TU_DYNAMIC_DEPTH_BIAS) {
- if (memcmp(&dest->depth_bias, &src->depth_bias,
- sizeof(src->depth_bias))) {
- dest->depth_bias = src->depth_bias;
- dest_mask |= TU_DYNAMIC_DEPTH_BIAS;
- }
- }
-
- if (copy_mask & TU_DYNAMIC_BLEND_CONSTANTS) {
- if (memcmp(&dest->blend_constants, &src->blend_constants,
- sizeof(src->blend_constants))) {
- typed_memcpy(dest->blend_constants, src->blend_constants, 4);
- dest_mask |= TU_DYNAMIC_BLEND_CONSTANTS;
- }
- }
-
- if (copy_mask & TU_DYNAMIC_DEPTH_BOUNDS) {
- if (memcmp(&dest->depth_bounds, &src->depth_bounds,
- sizeof(src->depth_bounds))) {
- dest->depth_bounds = src->depth_bounds;
- dest_mask |= TU_DYNAMIC_DEPTH_BOUNDS;
- }
- }
-
- if (copy_mask & TU_DYNAMIC_STENCIL_COMPARE_MASK) {
- if (memcmp(&dest->stencil_compare_mask, &src->stencil_compare_mask,
- sizeof(src->stencil_compare_mask))) {
- dest->stencil_compare_mask = src->stencil_compare_mask;
- dest_mask |= TU_DYNAMIC_STENCIL_COMPARE_MASK;
- }
- }
-
- if (copy_mask & TU_DYNAMIC_STENCIL_WRITE_MASK) {
- if (memcmp(&dest->stencil_write_mask, &src->stencil_write_mask,
- sizeof(src->stencil_write_mask))) {
- dest->stencil_write_mask = src->stencil_write_mask;
- dest_mask |= TU_DYNAMIC_STENCIL_WRITE_MASK;
- }
- }
-
- if (copy_mask & TU_DYNAMIC_STENCIL_REFERENCE) {
- if (memcmp(&dest->stencil_reference, &src->stencil_reference,
- sizeof(src->stencil_reference))) {
- dest->stencil_reference = src->stencil_reference;
- dest_mask |= TU_DYNAMIC_STENCIL_REFERENCE;
- }
- }
-
- if (copy_mask & TU_DYNAMIC_DISCARD_RECTANGLE) {
- if (memcmp(&dest->discard_rectangle.rectangles,
- &src->discard_rectangle.rectangles,
- src->discard_rectangle.count * sizeof(VkRect2D))) {
- typed_memcpy(dest->discard_rectangle.rectangles,
- src->discard_rectangle.rectangles,
- src->discard_rectangle.count);
- dest_mask |= TU_DYNAMIC_DISCARD_RECTANGLE;
- }
- }
-}
-
static VkResult
tu_create_cmd_buffer(struct tu_device *device,
struct tu_cmd_pool *pool,