v3dv: don't use a global constant for default pipeline dynamic state
Some of these may change across V3D versions, so it is not practical. Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13775>
This commit is contained in:
committed by
Marge Bot
parent
4b3931ee6c
commit
7490bcad37
@@ -26,38 +26,6 @@
|
||||
#include "vk_format_info.h"
|
||||
#include "vk_util.h"
|
||||
|
||||
const struct v3dv_dynamic_state default_dynamic_state = {
|
||||
.viewport = {
|
||||
.count = 0,
|
||||
},
|
||||
.scissor = {
|
||||
.count = 0,
|
||||
},
|
||||
.stencil_compare_mask =
|
||||
{
|
||||
.front = ~0u,
|
||||
.back = ~0u,
|
||||
},
|
||||
.stencil_write_mask =
|
||||
{
|
||||
.front = ~0u,
|
||||
.back = ~0u,
|
||||
},
|
||||
.stencil_reference =
|
||||
{
|
||||
.front = 0u,
|
||||
.back = 0u,
|
||||
},
|
||||
.blend_constants = { 0.0f, 0.0f, 0.0f, 0.0f },
|
||||
.depth_bias = {
|
||||
.constant_factor = 0.0f,
|
||||
.depth_bias_clamp = 0.0f,
|
||||
.slope_factor = 0.0f,
|
||||
},
|
||||
.line_width = 1.0f,
|
||||
.color_write_enable = (1ull << (4 * V3D_MAX_DRAW_BUFFERS)) - 1,
|
||||
};
|
||||
|
||||
void
|
||||
v3dv_job_add_bo(struct v3dv_job *job, struct v3dv_bo *bo)
|
||||
{
|
||||
|
||||
@@ -2694,8 +2694,15 @@ pipeline_init_dynamic_state(
|
||||
const VkPipelineRasterizationStateCreateInfo *pRasterizationState,
|
||||
const VkPipelineColorWriteCreateInfoEXT *pColorWriteState)
|
||||
{
|
||||
pipeline->dynamic_state = default_dynamic_state;
|
||||
/* Initialize to default values */
|
||||
struct v3dv_dynamic_state *dynamic = &pipeline->dynamic_state;
|
||||
memset(dynamic, 0, sizeof(*dynamic));
|
||||
dynamic->stencil_compare_mask.front = ~0;
|
||||
dynamic->stencil_compare_mask.back = ~0;
|
||||
dynamic->stencil_write_mask.front = ~0;
|
||||
dynamic->stencil_write_mask.back = ~0;
|
||||
dynamic->line_width = 1.0f;
|
||||
dynamic->color_write_enable = (1ull << (4 * V3D_MAX_DRAW_BUFFERS)) - 1;
|
||||
|
||||
/* Create a mask of enabled dynamic states */
|
||||
uint32_t dynamic_states = 0;
|
||||
|
||||
@@ -843,8 +843,6 @@ struct v3dv_dynamic_state {
|
||||
uint32_t color_write_enable;
|
||||
};
|
||||
|
||||
extern const struct v3dv_dynamic_state default_dynamic_state;
|
||||
|
||||
void v3dv_viewport_compute_xform(const VkViewport *viewport,
|
||||
float scale[3],
|
||||
float translate[3]);
|
||||
|
||||
Reference in New Issue
Block a user