dzn: Add support for sampleRateShading

Forward the sample-rate shading info to spirv_to_dxil() so we can
claim to support sampleRateShading.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15916>
This commit is contained in:
Boris Brezillon 2022-04-12 07:31:50 -07:00 committed by Marge Bot
parent 80a5deee62
commit 3e97d37c63
3 changed files with 17 additions and 9 deletions

View File

@ -875,7 +875,9 @@ dEQP-VK.api.copy_and_blit.dedicated_allocation.blit_image.all_formats.depth_sten
dEQP-VK.api.copy_and_blit.dedicated_allocation.blit_image.all_formats.depth_stencil.2d.d32_sfloat_s8_uint_d32_sfloat_s8_uint_separate_layouts.optimal_general_nearest,Fail
dEQP-VK.api.copy_and_blit.dedicated_allocation.blit_image.all_formats.depth_stencil.2d.d32_sfloat_s8_uint_d32_sfloat_s8_uint_separate_layouts.optimal_optimal_nearest,Fail
dEQP-VK.draw.renderpass.multiple_interpolation.separate.no_sample_decoration.4_samples,Fail
dEQP-VK.draw.renderpass.multiple_interpolation.separate.with_sample_decoration.4_samples,Fail
dEQP-VK.draw.renderpass.multiple_interpolation.structured.no_sample_decoration.4_samples,Fail
dEQP-VK.draw.renderpass.multiple_interpolation.structured.with_sample_decoration.4_samples,Fail
dEQP-VK.draw.renderpass.output_location.array.r8g8-uint-highp,Fail
dEQP-VK.draw.renderpass.output_location.array.r8g8-uint-highp-output-uint,Fail
dEQP-VK.draw.renderpass.output_location.array.r8g8-uint-mediump,Fail

View File

@ -994,7 +994,7 @@ dzn_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
.independentBlend = false,
.geometryShader = false,
.tessellationShader = false,
.sampleRateShading = false,
.sampleRateShading = true,
.dualSrcBlend = false,
.logicOp = false,
.multiDrawIndirect = false,
@ -1234,9 +1234,9 @@ dzn_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice,
.maxTexelOffset = 7,
.minTexelGatherOffset = 0,
.maxTexelGatherOffset = 0,
.minInterpolationOffset = 0.0f,
.maxInterpolationOffset = 0.0f,
.subPixelInterpolationOffsetBits = 0,
.minInterpolationOffset = -0.5f,
.maxInterpolationOffset = 0.5f,
.subPixelInterpolationOffsetBits = 4,
.maxFramebufferWidth = 4096,
.maxFramebufferHeight = 4096,
.maxFramebufferLayers = 256,

View File

@ -54,6 +54,7 @@ dzn_pipeline_compile_shader(dzn_device *device,
const VkPipelineShaderStageCreateInfo *stage_info,
enum dxil_spirv_yz_flip_mode yz_flip_mode,
uint16_t y_flip_mask, uint16_t z_flip_mask,
bool force_sample_rate_shading,
D3D12_SHADER_BYTECODE *slot)
{
dzn_instance *instance =
@ -121,6 +122,7 @@ dzn_pipeline_compile_shader(dzn_device *device,
.z_mask = z_flip_mask,
},
.read_only_images_as_srvs = true,
.force_sample_rate_shading = force_sample_rate_shading,
};
struct dxil_spirv_debug_options dbg_opts = {
@ -392,9 +394,7 @@ dzn_graphics_pipeline_translate_ms(dzn_graphics_pipeline *pipeline,
const VkPipelineMultisampleStateCreateInfo *in_ms =
in_rast->rasterizerDiscardEnable ? NULL : in->pMultisampleState;
/* TODO: sampleShadingEnable, minSampleShading,
* alphaToOneEnable
*/
/* TODO: minSampleShading (use VRS), alphaToOneEnable */
out->SampleDesc.Count = in_ms ? in_ms->rasterizationSamples : 1;
out->SampleDesc.Quality = 0;
out->SampleMask = in_ms && in_ms->pSampleMask ?
@ -890,9 +890,15 @@ dzn_graphics_pipeline_create(dzn_device *device,
}
}
bool force_sample_rate_shading =
pCreateInfo->pStages[i].stage == VK_SHADER_STAGE_FRAGMENT_BIT &&
pCreateInfo->pMultisampleState &&
pCreateInfo->pMultisampleState->sampleShadingEnable;
ret = dzn_pipeline_compile_shader(device, pAllocator,
layout, &pCreateInfo->pStages[i],
yz_flip_mode, y_flip_mask, z_flip_mask, slot);
yz_flip_mode, y_flip_mask, z_flip_mask,
force_sample_rate_shading, slot);
if (ret != VK_SUCCESS)
goto out;
}
@ -1067,7 +1073,7 @@ dzn_compute_pipeline_create(dzn_device *device,
dzn_pipeline_compile_shader(device, pAllocator, layout,
&pCreateInfo->stage,
DXIL_SPIRV_YZ_FLIP_NONE, 0, 0,
&desc.CS);
false, &desc.CS);
if (ret != VK_SUCCESS)
goto out;