Work around problems with explicit LoD with arrayed depth images on Apple Silicon.
Use an explicit gradient to make it sample the correct level. Update SPIRV-Cross to pull in the change needed for this.
This commit is contained in:
parent
e8885a24e8
commit
2c01c8b7e0
@ -20,6 +20,8 @@ Released TBA
|
|||||||
|
|
||||||
- Fix issue where extension `VK_KHR_fragment_shader_barycentric`
|
- Fix issue where extension `VK_KHR_fragment_shader_barycentric`
|
||||||
was sometimes incorrectly disabled due to a Metal driver bug.
|
was sometimes incorrectly disabled due to a Metal driver bug.
|
||||||
|
- Work around problems with using explicit LoD with arrayed depth images
|
||||||
|
on Apple Silicon.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
eb9b2732982b8eea3395216be825a74dd84fe4be
|
4e2fdb25671c742a9fbe93a6034eb1542244c7e1
|
||||||
|
@ -979,6 +979,7 @@ typedef struct {
|
|||||||
VkBool32 programmableSamplePositions; /**< If true, programmable MSAA sample positions are supported. */
|
VkBool32 programmableSamplePositions; /**< If true, programmable MSAA sample positions are supported. */
|
||||||
VkBool32 shaderBarycentricCoordinates; /**< If true, fragment shader barycentric coordinates are supported. */
|
VkBool32 shaderBarycentricCoordinates; /**< If true, fragment shader barycentric coordinates are supported. */
|
||||||
MTLArgumentBuffersTier argumentBuffersTier; /**< The argument buffer tier available on this device, as a Metal enumeration. */
|
MTLArgumentBuffersTier argumentBuffersTier; /**< The argument buffer tier available on this device, as a Metal enumeration. */
|
||||||
|
VkBool32 needsSampleDrefLodArrayWorkaround; /**< If true, sampling from arrayed depth images with explicit LoD is broken and needs a workaround. */
|
||||||
} MVKPhysicalDeviceMetalFeatures;
|
} MVKPhysicalDeviceMetalFeatures;
|
||||||
|
|
||||||
/** MoltenVK performance of a particular type of activity. */
|
/** MoltenVK performance of a particular type of activity. */
|
||||||
|
@ -1493,6 +1493,9 @@ void MVKPhysicalDevice::initMetalFeatures() {
|
|||||||
_metalFeatures.clearColorFloatRounding = MVK_FLOAT_ROUNDING_DOWN;
|
_metalFeatures.clearColorFloatRounding = MVK_FLOAT_ROUNDING_DOWN;
|
||||||
break;
|
break;
|
||||||
case kAppleVendorId:
|
case kAppleVendorId:
|
||||||
|
// TODO: Other GPUs?
|
||||||
|
_metalFeatures.needsSampleDrefLodArrayWorkaround = true;
|
||||||
|
// fallthrough
|
||||||
case kIntelVendorId:
|
case kIntelVendorId:
|
||||||
case kNVVendorId:
|
case kNVVendorId:
|
||||||
default:
|
default:
|
||||||
|
@ -1152,6 +1152,9 @@ bool MVKGraphicsPipeline::addFragmentShaderToPipeline(MTLRenderPipelineDescripto
|
|||||||
shaderConfig.options.mslOptions.capture_output_to_buffer = false;
|
shaderConfig.options.mslOptions.capture_output_to_buffer = false;
|
||||||
shaderConfig.options.mslOptions.fixed_subgroup_size = mvkIsAnyFlagEnabled(_pFragmentSS->flags, VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT) ? 0 : _device->_pMetalFeatures->maxSubgroupSize;
|
shaderConfig.options.mslOptions.fixed_subgroup_size = mvkIsAnyFlagEnabled(_pFragmentSS->flags, VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT) ? 0 : _device->_pMetalFeatures->maxSubgroupSize;
|
||||||
shaderConfig.options.mslOptions.check_discarded_frag_stores = true;
|
shaderConfig.options.mslOptions.check_discarded_frag_stores = true;
|
||||||
|
if (_device->_pMetalFeatures->needsSampleDrefLodArrayWorkaround) {
|
||||||
|
shaderConfig.options.mslOptions.sample_dref_lod_array_as_grad = true;
|
||||||
|
}
|
||||||
if (_isRasterizing && pCreateInfo->pMultisampleState) { // Must ignore allowed bad pMultisampleState pointer if rasterization disabled
|
if (_isRasterizing && pCreateInfo->pMultisampleState) { // Must ignore allowed bad pMultisampleState pointer if rasterization disabled
|
||||||
if (pCreateInfo->pMultisampleState->pSampleMask && pCreateInfo->pMultisampleState->pSampleMask[0] != 0xffffffff) {
|
if (pCreateInfo->pMultisampleState->pSampleMask && pCreateInfo->pMultisampleState->pSampleMask[0] != 0xffffffff) {
|
||||||
shaderConfig.options.mslOptions.additional_fixed_sample_mask = pCreateInfo->pMultisampleState->pSampleMask[0];
|
shaderConfig.options.mslOptions.additional_fixed_sample_mask = pCreateInfo->pMultisampleState->pSampleMask[0];
|
||||||
@ -2253,7 +2256,8 @@ namespace SPIRV_CROSS_NAMESPACE {
|
|||||||
opt.vertex_index_type,
|
opt.vertex_index_type,
|
||||||
opt.force_sample_rate_shading,
|
opt.force_sample_rate_shading,
|
||||||
opt.manual_helper_invocation_updates,
|
opt.manual_helper_invocation_updates,
|
||||||
opt.check_discarded_frag_stores);
|
opt.check_discarded_frag_stores,
|
||||||
|
opt.sample_dref_lod_array_as_grad);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class Archive>
|
template<class Archive>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user