diff --git a/project_tuxbox/console_cbv.py b/project_tuxbox/console_cbv.py index 0a3fe66b..59c23777 100644 --- a/project_tuxbox/console_cbv.py +++ b/project_tuxbox/console_cbv.py @@ -41,10 +41,11 @@ def configure_console_cbv(backend, env, executable, report): if marker and marker.is_file() and feature in marker.read_text().splitlines(): prepend(env, "VKD3D_CONFIG", feature, ",") # The fork binds 16-byte offsets as storage buffers on its descriptor-set path. - prepend(env, "VKD3D_DISABLE_EXTENSIONS", "VK_EXT_descriptor_buffer", ",") + for extension in ("VK_EXT_descriptor_heap", "VK_EXT_descriptor_buffer"): + prepend(env, "VKD3D_DISABLE_EXTENSIONS", extension, ",") report("Constant-buffer alignment: selected Proton build feature") else: - # The layer hides VK_EXT_descriptor_buffer itself, only on GPUs that need it. + # The layer hides descriptor buffers and heaps itself, only on GPUs that need it. layer = console_cbv_layer(env) path_key = "VK_LAYER_PATH" if env.get("VK_LAYER_PATH") else "VK_ADD_LAYER_PATH" prepend(env, path_key, layer, ":") diff --git a/tests/test_host.py b/tests/test_host.py index 061c30bd..3ada7198 100644 --- a/tests/test_host.py +++ b/tests/test_host.py @@ -282,12 +282,13 @@ def test_explicit_fork_feature_and_wine_with_an_older_staged_copy(self): sample.write_bytes(b"older sample") self.provider.write_bytes(sample.read_bytes()) (self.root / "tuxbox-features").write_text("cbv_16_byte_alignment\n") - env = {"PROTONPATH": str(self.root), "VKD3D_DISABLE_EXTENSIONS": "first;VK_EXT_descriptor_buffer", + env = {"PROTONPATH": str(self.root), + "VKD3D_DISABLE_EXTENSIONS": "first;VK_EXT_descriptor_buffer;VK_EXT_descriptor_heap", "VKD3D_CONFIG": "other"} with patch("project_tuxbox.console_cbv.console_cbv_layer", return_value=self.layer) as layer: configure_console_cbv("proton", env, self.exe, self.log.status) self.assertEqual(env["VKD3D_CONFIG"], "cbv_16_byte_alignment,other") - self.assertEqual(env["VKD3D_DISABLE_EXTENSIONS"], "first;VK_EXT_descriptor_buffer") + self.assertEqual(env["VKD3D_DISABLE_EXTENSIONS"], "first;VK_EXT_descriptor_buffer;VK_EXT_descriptor_heap") layer.assert_not_called() wine = {"PROTONPATH": str(self.root)} configure_console_cbv("wine", wine, self.exe, self.log.status) @@ -296,7 +297,7 @@ def test_explicit_fork_feature_and_wine_with_an_older_staged_copy(self): self.assertNotIn("VKD3D_DISABLE_EXTENSIONS", wine) fork = {"PROTONPATH": str(self.root)} configure_console_cbv("proton", fork, self.exe, self.log.status) - self.assertEqual(fork["VKD3D_DISABLE_EXTENSIONS"], "VK_EXT_descriptor_buffer") + self.assertEqual(fork["VKD3D_DISABLE_EXTENSIONS"], "VK_EXT_descriptor_buffer,VK_EXT_descriptor_heap") self.assertNotIn("PRESSURE_VESSEL_FILESYSTEMS_RO", wine) def test_native_foreign_missing_and_explicit_comparison(self): diff --git a/tools/reference/cbv-layer/layer.c b/tools/reference/cbv-layer/layer.c index 367771a8..159624ee 100644 --- a/tools/reference/cbv-layer/layer.c +++ b/tools/reference/cbv-layer/layer.c @@ -5,6 +5,11 @@ #include #include +// Vulkan headers older than VK_EXT_descriptor_heap do not name it. +#ifndef VK_EXT_DESCRIPTOR_HEAP_EXTENSION_NAME +#define VK_EXT_DESCRIPTOR_HEAP_EXTENSION_NAME "VK_EXT_descriptor_heap" +#endif + struct instance_dispatch { void *key; PFN_vkGetInstanceProcAddr get_proc; @@ -130,8 +135,8 @@ static VKAPI_ATTR void VKAPI_CALL get_khr_features(VkPhysicalDevice device, VkPh } // vkd3d-proton binds constant buffers as storage buffers only on its -// descriptor-set path, so hide descriptor buffers from the devices that need it. -// Other devices keep the extension. +// descriptor-set path, so hide descriptor buffers and descriptor heaps from the +// devices that need it. Other devices keep both extensions. static VKAPI_ATTR VkResult VKAPI_CALL enumerate_extensions(VkPhysicalDevice device, const char *layer, uint32_t *count, VkExtensionProperties *properties) { const struct instance_dispatch *entry = lookup(device); @@ -149,7 +154,8 @@ static VKAPI_ATTR VkResult VKAPI_CALL enumerate_extensions(VkPhysicalDevice devi if (result == VK_SUCCESS) { uint32_t capacity = properties ? *count : 0, kept = 0; for (uint32_t i = 0; i < total; i++) { - if (!strcmp(all[i].extensionName, VK_EXT_DESCRIPTOR_BUFFER_EXTENSION_NAME)) + if (!strcmp(all[i].extensionName, VK_EXT_DESCRIPTOR_BUFFER_EXTENSION_NAME) + || !strcmp(all[i].extensionName, VK_EXT_DESCRIPTOR_HEAP_EXTENSION_NAME)) continue; if (properties) { if (kept == capacity) {