summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/frontends/lavapipe
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2022-04-21 04:23:05 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2022-04-21 04:23:05 +0000
commita09152815d99b8a68f7f5ed0e44bab39dd14a1e5 (patch)
tree2d0fdc70c25e62ac40fe0512a56b269564afb8f8 /lib/mesa/src/gallium/frontends/lavapipe
parent5141f851e7304b6ee32a98117c378cb814079903 (diff)
Import Mesa 21.3.8
Diffstat (limited to 'lib/mesa/src/gallium/frontends/lavapipe')
-rw-r--r--lib/mesa/src/gallium/frontends/lavapipe/lvp_cmd_buffer.c1
-rw-r--r--lib/mesa/src/gallium/frontends/lavapipe/lvp_execute.c70
-rw-r--r--lib/mesa/src/gallium/frontends/lavapipe/lvp_formats.c4
-rw-r--r--lib/mesa/src/gallium/frontends/lavapipe/lvp_pipeline.c2
4 files changed, 41 insertions, 36 deletions
diff --git a/lib/mesa/src/gallium/frontends/lavapipe/lvp_cmd_buffer.c b/lib/mesa/src/gallium/frontends/lavapipe/lvp_cmd_buffer.c
index cb2d58226..152283ae5 100644
--- a/lib/mesa/src/gallium/frontends/lavapipe/lvp_cmd_buffer.c
+++ b/lib/mesa/src/gallium/frontends/lavapipe/lvp_cmd_buffer.c
@@ -265,6 +265,7 @@ VKAPI_ATTR void VKAPI_CALL lvp_TrimCommandPool(
&pool->free_cmd_buffers, pool_link) {
lvp_cmd_buffer_destroy(cmd_buffer);
}
+ list_inithead(&pool->free_cmd_buffers);
}
VKAPI_ATTR void VKAPI_CALL lvp_CmdDrawMultiEXT(
diff --git a/lib/mesa/src/gallium/frontends/lavapipe/lvp_execute.c b/lib/mesa/src/gallium/frontends/lavapipe/lvp_execute.c
index 30d7bf3c0..1ca094ad8 100644
--- a/lib/mesa/src/gallium/frontends/lavapipe/lvp_execute.c
+++ b/lib/mesa/src/gallium/frontends/lavapipe/lvp_execute.c
@@ -573,40 +573,6 @@ static void handle_graphics_pipeline(struct vk_cmd_queue_entry *cmd,
state->rs_dirty = true;
}
- state->disable_multisample = pipeline->disable_multisample;
- if (pipeline->graphics_create_info.pMultisampleState) {
- const VkPipelineMultisampleStateCreateInfo *ms = pipeline->graphics_create_info.pMultisampleState;
- state->rs_state.multisample = ms->rasterizationSamples > 1;
- state->sample_mask = ms->pSampleMask ? ms->pSampleMask[0] : 0xffffffff;
- state->blend_state.alpha_to_coverage = ms->alphaToCoverageEnable;
- state->blend_state.alpha_to_one = ms->alphaToOneEnable;
- state->blend_dirty = true;
- state->rs_dirty = true;
- state->min_samples = 1;
- state->sample_mask_dirty = true;
- fb_samples = ms->rasterizationSamples;
- if (ms->sampleShadingEnable) {
- state->min_samples = ceil(ms->rasterizationSamples * ms->minSampleShading);
- if (state->min_samples > 1)
- state->min_samples = ms->rasterizationSamples;
- if (state->min_samples < 1)
- state->min_samples = 1;
- }
- if (pipeline->force_min_sample)
- state->min_samples = ms->rasterizationSamples;
- state->min_samples_dirty = true;
- } else {
- state->rs_state.multisample = false;
- state->sample_mask_dirty = state->sample_mask != 0xffffffff;
- state->sample_mask = 0xffffffff;
- state->min_samples_dirty = state->min_samples;
- state->min_samples = 0;
- state->blend_dirty |= state->blend_state.alpha_to_coverage || state->blend_state.alpha_to_one;
- state->blend_state.alpha_to_coverage = false;
- state->blend_state.alpha_to_one = false;
- state->rs_dirty = true;
- }
-
if (pipeline->graphics_create_info.pDepthStencilState) {
const VkPipelineDepthStencilStateCreateInfo *dsa = pipeline->graphics_create_info.pDepthStencilState;
@@ -710,6 +676,40 @@ static void handle_graphics_pipeline(struct vk_cmd_queue_entry *cmd,
state->blend_dirty = true;
}
+ state->disable_multisample = pipeline->disable_multisample;
+ if (pipeline->graphics_create_info.pMultisampleState) {
+ const VkPipelineMultisampleStateCreateInfo *ms = pipeline->graphics_create_info.pMultisampleState;
+ state->rs_state.multisample = ms->rasterizationSamples > 1;
+ state->sample_mask = ms->pSampleMask ? ms->pSampleMask[0] : 0xffffffff;
+ state->blend_state.alpha_to_coverage = ms->alphaToCoverageEnable;
+ state->blend_state.alpha_to_one = ms->alphaToOneEnable;
+ state->blend_dirty = true;
+ state->rs_dirty = true;
+ state->min_samples = 1;
+ state->sample_mask_dirty = true;
+ fb_samples = ms->rasterizationSamples;
+ if (ms->sampleShadingEnable) {
+ state->min_samples = ceil(ms->rasterizationSamples * ms->minSampleShading);
+ if (state->min_samples > 1)
+ state->min_samples = ms->rasterizationSamples;
+ if (state->min_samples < 1)
+ state->min_samples = 1;
+ }
+ if (pipeline->force_min_sample)
+ state->min_samples = ms->rasterizationSamples;
+ state->min_samples_dirty = true;
+ } else {
+ state->rs_state.multisample = false;
+ state->sample_mask_dirty = state->sample_mask != 0xffffffff;
+ state->sample_mask = 0xffffffff;
+ state->min_samples_dirty = state->min_samples;
+ state->min_samples = 0;
+ state->blend_dirty |= state->blend_state.alpha_to_coverage || state->blend_state.alpha_to_one;
+ state->blend_state.alpha_to_coverage = false;
+ state->blend_state.alpha_to_one = false;
+ state->rs_dirty = true;
+ }
+
if (!dynamic_states[conv_dynamic_state_idx(VK_DYNAMIC_STATE_VERTEX_INPUT_EXT)]) {
const VkPipelineVertexInputStateCreateInfo *vi = pipeline->graphics_create_info.pVertexInputState;
int i;
@@ -1011,8 +1011,6 @@ static void fill_sampler_view_stage(struct rendering_state *state,
*/
if (iv->subresourceRange.aspectMask == VK_IMAGE_ASPECT_DEPTH_BIT ||
iv->subresourceRange.aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT) {
- if (templ.swizzle_a == PIPE_SWIZZLE_X)
- templ.swizzle_r = PIPE_SWIZZLE_X;
fix_depth_swizzle(templ.swizzle_r);
fix_depth_swizzle(templ.swizzle_g);
fix_depth_swizzle(templ.swizzle_b);
diff --git a/lib/mesa/src/gallium/frontends/lavapipe/lvp_formats.c b/lib/mesa/src/gallium/frontends/lavapipe/lvp_formats.c
index b30853a9d..6831a6587 100644
--- a/lib/mesa/src/gallium/frontends/lavapipe/lvp_formats.c
+++ b/lib/mesa/src/gallium/frontends/lavapipe/lvp_formats.c
@@ -230,6 +230,9 @@ static VkResult lvp_get_image_format_properties(struct lvp_physical_device *phys
break;
}
+ if (info->flags & VK_IMAGE_CREATE_EXTENDED_USAGE_BIT)
+ goto skip_checks;
+
if (info->usage & VK_IMAGE_USAGE_SAMPLED_BIT) {
if (!(format_feature_flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT)) {
goto unsupported;
@@ -273,6 +276,7 @@ static VkResult lvp_get_image_format_properties(struct lvp_physical_device *phys
}
}
+skip_checks:
*pImageFormatProperties = (VkImageFormatProperties) {
.maxExtent = maxExtent,
.maxMipLevels = maxMipLevels,
diff --git a/lib/mesa/src/gallium/frontends/lavapipe/lvp_pipeline.c b/lib/mesa/src/gallium/frontends/lavapipe/lvp_pipeline.c
index 80551d4c4..6a4ed65a7 100644
--- a/lib/mesa/src/gallium/frontends/lavapipe/lvp_pipeline.c
+++ b/lib/mesa/src/gallium/frontends/lavapipe/lvp_pipeline.c
@@ -602,6 +602,8 @@ lvp_shader_compile_to_ir(struct lvp_pipeline *pipeline,
NIR_PASS(progress, nir, nir_opt_deref);
NIR_PASS(progress, nir, nir_lower_vars_to_ssa);
+ NIR_PASS(progress, nir, nir_opt_copy_prop_vars);
+
NIR_PASS(progress, nir, nir_copy_prop);
NIR_PASS(progress, nir, nir_opt_dce);
NIR_PASS(progress, nir, nir_opt_peephole_select, 8, true, true);