KhronosGroup/MoltenVK

Requirements for DXVK support..

Open

#203 geöffnet am 27. Juli 2018

Auf GitHub ansehen
 (175 Kommentare) (15 Reaktionen) (0 zugewiesene Personen)Objective-C++ (514 Forks)github user discovery
EnhancementHelp wantedMetal improvement required

Repository-Metriken

Stars
 (5.666 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

Hi, this is just a report of "things" missing in MoltenVK to support DXVK now that Wine supports Vulkan on MacOS via MoltenVK (I use v1.0.12 included in Vulkan MacOS SDK 1.0.77).. I tested DXVK 0.6.3 on Wine 3.13 with Vulkan support enabled on MacOS and simple programs like included d3d11-compute or d3d11-triangle failed due to unsupported extensions so I checked logs and seems it needs this extensions (as of 0.6.3):

From: https://github.com/doitsujin/dxvk/blob/master/src/dxvk/dxvk_extensions.h we see requirements for DxvkInstanceExtensions: VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2 the other two are emulated by Wine already..

for DxvkDeviceExtensions it needs: VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME, VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME, VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME,
VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME,
VK_KHR_MAINTENANCE1_EXTENSION_NAME VK_KHR_MAINTENANCE2_EXTENSION_NAME VK_KHR_SHADER_DRAW_PARAMETERS

I modified code of this exts from DxvkExtMode::Required to DxvkExtMode::Optional but then it complains it can't create a D3D device with support for any feature levels ranging from D3D_FEATURE_LEVEL_9_1 to D3D_FEATURE_LEVEL_11_1..

it's because needs features missing in MoltenVK (as of 1.0.12 in Vulkan SDK 1.0.77): code checking feature level is here: https://github.com/doitsujin/dxvk/blob/master/src/d3d11/d3d11_device.cpp `

if (featureLevel >= D3D_FEATURE_LEVEL_9_1) { enabled.depthClamp = VK_TRUE; enabled.depthBiasClamp = VK_TRUE; enabled.fillModeNonSolid = VK_TRUE; enabled.pipelineStatisticsQuery = supported.pipelineStatisticsQuery; enabled.sampleRateShading = VK_TRUE; enabled.samplerAnisotropy = VK_TRUE; enabled.shaderClipDistance = VK_TRUE; enabled.shaderCullDistance = VK_TRUE; enabled.robustBufferAccess = VK_TRUE; }

if (featureLevel >= D3D_FEATURE_LEVEL_9_2) {
  enabled.occlusionQueryPrecise                 = VK_TRUE;
}

if (featureLevel >= D3D_FEATURE_LEVEL_9_3) {
  enabled.multiViewport                         = VK_TRUE;
  enabled.independentBlend                      = VK_TRUE;
}

if (featureLevel >= D3D_FEATURE_LEVEL_10_0) {
  enabled.fullDrawIndexUint32                   = VK_TRUE;
  enabled.fragmentStoresAndAtomics              = VK_TRUE;
  enabled.geometryShader                        = VK_TRUE;
  enabled.logicOp                               = supported.logicOp;
  enabled.shaderImageGatherExtended             = VK_TRUE;
  enabled.textureCompressionBC                  = VK_TRUE;
}

if (featureLevel >= D3D_FEATURE_LEVEL_10_1) {
  enabled.dualSrcBlend                          = VK_TRUE;
  enabled.imageCubeArray                        = VK_TRUE;
}

if (featureLevel >= D3D_FEATURE_LEVEL_11_0) {
  enabled.shaderFloat64                         = supported.shaderFloat64;
  enabled.shaderInt64                           = supported.shaderInt64;
  enabled.tessellationShader                    = VK_TRUE;
  // TODO enable unconditionally once RADV gains support
  enabled.shaderStorageImageMultisample         = supported.shaderStorageImageMultisample;
  enabled.shaderStorageImageReadWithoutFormat   = supported.shaderStorageImageReadWithoutFormat;
  enabled.shaderStorageImageWriteWithoutFormat  = VK_TRUE;
}

if (featureLevel >= D3D_FEATURE_LEVEL_11_1) {
  enabled.logicOp                               = VK_TRUE;
  enabled.vertexPipelineStoresAndAtomics        = VK_TRUE;
}

`

had to comment these lines (due to missing MoltenVK support): for getting up to D3D_FEATURE_LEVEL_9_1: enabled.sampleRateShading = VK_TRUE; enabled.shaderCullDistance = VK_TRUE; enabled.robustBufferAccess = VK_TRUE; for D3D_FEATURE_LEVEL_9_3: enabled.multiViewport = VK_TRUE; for D3D_FEATURE_LEVEL_10_1: enabled.fullDrawIndexUint32 = VK_TRUE; enabled.geometryShader = VK_TRUE; enabled.logicOp = supported.logicOp; for D3D_FEATURE_LEVEL_11_0: enabled.shaderFloat64 = supported.shaderFloat64; enabled.shaderInt64 = supported.shaderInt64; enabled.tessellationShader = VK_TRUE; enabled.shaderStorageImageWriteWithoutFormat = VK_TRUE;

with all these "hacks" it doesn't complain but crashes executing simple d3d11 apps because it may be using missing features..

of course MoltenVK supporting DXVK might be a herculean effort but DXVK has shown it's able to run lots of DX11 modern games and this will be awesome on Mac.. this is just a report of things needed to do (as a means of guiding priorities of things to implement)..

hope is useful for someone..

Contributor Guide