From: Jonathan Marek Date: Sun, 14 Jun 2020 14:34:25 +0000 (-0400) Subject: turnip: delete dead dynamic state code X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=62a4db4c0f15905d6988d4024e0dc93c095e0378;p=mesa.git turnip: delete dead dynamic state code Remove unused code, split this out to reduce the diff in the next patch. Signed-off-by: Jonathan Marek Part-of: --- diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c index fdb701a2bfa..b050550cddb 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.c +++ b/src/freedreno/vulkan/tu_cmd_buffer.c @@ -1460,147 +1460,6 @@ tu_cmd_update_tiling_config(struct tu_cmd_buffer *cmd, 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, diff --git a/src/freedreno/vulkan/tu_private.h b/src/freedreno/vulkan/tu_private.h index 590ce897108..527bf817bbc 100644 --- a/src/freedreno/vulkan/tu_private.h +++ b/src/freedreno/vulkan/tu_private.h @@ -170,13 +170,6 @@ tu_logi(const char *format, ...) tu_printflike(1, 2); } \ } while (0) -/* Suppress -Wunused in stub functions */ -#define tu_use_args(...) __tu_use_args(0, ##__VA_ARGS__) -static inline void -__tu_use_args(int ignore, ...) -{ -} - #define tu_stub() \ do { \ tu_finishme("stub %s", __func__); \ @@ -619,12 +612,6 @@ struct tu_scissor_state VkRect2D scissors[MAX_SCISSORS]; }; -struct tu_discard_rectangle_state -{ - uint32_t count; - VkRect2D rectangles[MAX_DISCARD_RECTANGLES]; -}; - struct tu_dynamic_state { /** @@ -639,21 +626,6 @@ struct tu_dynamic_state float line_width; - struct - { - float bias; - float clamp; - float slope; - } depth_bias; - - float blend_constants[4]; - - struct - { - float min; - float max; - } depth_bounds; - struct { uint32_t front; @@ -671,12 +643,8 @@ struct tu_dynamic_state uint32_t front; uint32_t back; } stencil_reference; - - struct tu_discard_rectangle_state discard_rectangle; }; -extern const struct tu_dynamic_state default_dynamic_state; - const char * tu_get_debug_option_name(int id);