anv: don't store sample location sample count
This information should match the current pipeline sample count. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15310>
This commit is contained in:
parent
6f5f817c0f
commit
8cdd5647c6
|
@ -199,10 +199,9 @@ anv_dynamic_state_copy(struct anv_dynamic_state *dest,
|
|||
ANV_CMP_COPY(logic_op, ANV_CMD_DIRTY_DYNAMIC_LOGIC_OP);
|
||||
|
||||
if (copy_mask & ANV_CMD_DIRTY_DYNAMIC_SAMPLE_LOCATIONS) {
|
||||
dest->sample_locations.samples = src->sample_locations.samples;
|
||||
typed_memcpy(dest->sample_locations.locations,
|
||||
src->sample_locations.locations,
|
||||
dest->sample_locations.samples);
|
||||
ARRAY_SIZE(src->sample_locations.locations));
|
||||
changed |= ANV_CMD_DIRTY_DYNAMIC_SAMPLE_LOCATIONS;
|
||||
}
|
||||
|
||||
|
@ -857,7 +856,6 @@ void anv_CmdSetSampleLocationsEXT(
|
|||
struct anv_dynamic_state *dyn_state = &cmd_buffer->state.gfx.dynamic;
|
||||
uint32_t samples = pSampleLocationsInfo->sampleLocationsPerPixel;
|
||||
|
||||
dyn_state->sample_locations.samples = samples;
|
||||
typed_memcpy(dyn_state->sample_locations.locations,
|
||||
pSampleLocationsInfo->pSampleLocations, samples);
|
||||
|
||||
|
|
|
@ -2292,27 +2292,21 @@ copy_non_dynamic_state(struct anv_graphics_pipeline *pipeline,
|
|||
const VkPipelineSampleLocationsStateCreateInfoEXT *sl_info = ms_info ?
|
||||
vk_find_struct_const(ms_info, PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT) : NULL;
|
||||
|
||||
uint32_t samples = ms_info ? ms_info->rasterizationSamples : 1;
|
||||
if (sl_info) {
|
||||
dynamic->sample_locations.samples =
|
||||
sl_info->sampleLocationsInfo.sampleLocationsCount;
|
||||
const VkSampleLocationEXT *positions =
|
||||
sl_info->sampleLocationsInfo.pSampleLocations;
|
||||
for (uint32_t i = 0; i < dynamic->sample_locations.samples; i++) {
|
||||
for (uint32_t i = 0; i < samples; i++) {
|
||||
dynamic->sample_locations.locations[i].x = positions[i].x;
|
||||
dynamic->sample_locations.locations[i].y = positions[i].y;
|
||||
}
|
||||
} else {
|
||||
const struct intel_sample_position *positions =
|
||||
intel_get_sample_positions(samples);
|
||||
for (uint32_t i = 0; i < samples; i++) {
|
||||
dynamic->sample_locations.locations[i].x = positions[i].x;
|
||||
dynamic->sample_locations.locations[i].y = positions[i].y;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Ensure we always have valid values for sample_locations. */
|
||||
if (pipeline->base.device->vk.enabled_extensions.EXT_sample_locations &&
|
||||
dynamic->sample_locations.samples == 0) {
|
||||
dynamic->sample_locations.samples =
|
||||
ms_info ? ms_info->rasterizationSamples : 1;
|
||||
const struct intel_sample_position *positions =
|
||||
intel_get_sample_positions(dynamic->sample_locations.samples);
|
||||
for (uint32_t i = 0; i < dynamic->sample_locations.samples; i++) {
|
||||
dynamic->sample_locations.locations[i].x = positions[i].x;
|
||||
dynamic->sample_locations.locations[i].y = positions[i].y;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2738,7 +2738,6 @@ struct anv_dynamic_state {
|
|||
} line_stipple;
|
||||
|
||||
struct {
|
||||
uint32_t samples;
|
||||
VkSampleLocationEXT locations[MAX_SAMPLE_LOCATIONS];
|
||||
} sample_locations;
|
||||
|
||||
|
|
|
@ -925,7 +925,7 @@ emit_ms_state(struct anv_graphics_pipeline *pipeline,
|
|||
#if GFX_VER >= 8
|
||||
/* On Gfx8+ 3DSTATE_MULTISAMPLE only holds the number of samples. */
|
||||
genX(emit_multisample)(&pipeline->base.batch,
|
||||
info ? info->rasterizationSamples : 1,
|
||||
pipeline->rasterization_samples,
|
||||
NULL);
|
||||
#endif
|
||||
|
||||
|
@ -938,11 +938,11 @@ emit_ms_state(struct anv_graphics_pipeline *pipeline,
|
|||
!(dynamic_states & ANV_CMD_DIRTY_DYNAMIC_SAMPLE_LOCATIONS)) {
|
||||
#if GFX_VER >= 8
|
||||
genX(emit_sample_pattern)(&pipeline->base.batch,
|
||||
pipeline->dynamic_state.sample_locations.samples,
|
||||
pipeline->rasterization_samples,
|
||||
pipeline->dynamic_state.sample_locations.locations);
|
||||
#else
|
||||
genX(emit_multisample)(&pipeline->base.batch,
|
||||
pipeline->dynamic_state.sample_locations.samples,
|
||||
pipeline->rasterization_samples,
|
||||
pipeline->dynamic_state.sample_locations.locations);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -305,7 +305,7 @@ genX(cmd_buffer_flush_dynamic_state)(struct anv_cmd_buffer *cmd_buffer)
|
|||
if (anv_cmd_buffer_needs_dynamic_state(cmd_buffer,
|
||||
ANV_CMD_DIRTY_DYNAMIC_SAMPLE_LOCATIONS)) {
|
||||
genX(emit_multisample)(&cmd_buffer->batch,
|
||||
d->sample_locations.samples,
|
||||
pipeline->rasterization_samples,
|
||||
d->sample_locations.locations);
|
||||
}
|
||||
|
||||
|
|
|
@ -633,7 +633,7 @@ genX(cmd_buffer_flush_dynamic_state)(struct anv_cmd_buffer *cmd_buffer)
|
|||
if (anv_cmd_buffer_needs_dynamic_state(cmd_buffer,
|
||||
ANV_CMD_DIRTY_DYNAMIC_SAMPLE_LOCATIONS)) {
|
||||
genX(emit_sample_pattern)(&cmd_buffer->batch,
|
||||
d->sample_locations.samples,
|
||||
pipeline->rasterization_samples,
|
||||
d->sample_locations.locations);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue