Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

Commit bbf2c8a

Browse files
Update 'mesa-vulkan-wrapper' and add a patch for trying to fix memory errors on 32bits games and always enable fake bc
1 parent a6b04b0 commit bbf2c8a

File tree

3 files changed

+84
-1
lines changed

3 files changed

+84
-1
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
diff --git a/src/vulkan/wrapper/wrapper_instance.c b/src/vulkan/wrapper/wrapper_instance.c
2+
index 8a2aba85b33..dcfda2da086 100644
3+
--- a/src/vulkan/wrapper/wrapper_instance.c
4+
+++ b/src/vulkan/wrapper/wrapper_instance.c
5+
@@ -5,14 +5,6 @@
6+
#include "vk_dispatch_table.h"
7+
#include "vk_extensions.h"
8+
9+
-uint64_t WRAPPER_DEBUG;
10+
-
11+
-static const struct debug_control debug_control[] = {
12+
- { "placed", WRAPPER_MAP_MEMORY_PLACED },
13+
- { "bc", WRAPPER_BC },
14+
- { NULL, },
15+
-};
16+
-
17+
const struct vk_instance_extension_table wrapper_instance_extensions = {
18+
.KHR_get_surface_capabilities2 = true,
19+
.EXT_surface_maintenance1 = true,
20+
@@ -61,9 +53,6 @@ static bool vulkan_library_init()
21+
if (vulkan_library_handle)
22+
return true;
23+
24+
- WRAPPER_DEBUG = parse_debug_string(getenv("WRAPPER_DEBUG"),
25+
- debug_control);
26+
-
27+
const char *env = getenv("WRAPPER_VULKAN_PATH");
28+
vulkan_library_handle = dlopen(env ? env : DEFAULT_VULKAN_PATH,
29+
RTLD_LOCAL | RTLD_NOW);
30+
diff --git a/src/vulkan/wrapper/wrapper_physical_device.c b/src/vulkan/wrapper/wrapper_physical_device.c
31+
index a2a8ac387d1..3d109bf4d3c 100644
32+
--- a/src/vulkan/wrapper/wrapper_physical_device.c
33+
+++ b/src/vulkan/wrapper/wrapper_physical_device.c
34+
@@ -127,16 +127,12 @@ VkResult enumerate_physical_device(struct vk_instance *_instance)
35+
supported_features->swapchainMaintenance1 = true;
36+
supported_features->imageCompressionControlSwapchain = false;
37+
38+
- pdevice->enable_bc =
39+
- !supported_features->textureCompressionBC
40+
- && (WRAPPER_DEBUG & WRAPPER_BC);
41+
+ pdevice->enable_bc = true;
42+
43+
if (pdevice->enable_bc)
44+
supported_features->textureCompressionBC = true;
45+
46+
- pdevice->enable_map_memory_placed =
47+
- !pdevice->vk.supported_extensions.EXT_map_memory_placed
48+
- && (WRAPPER_DEBUG & WRAPPER_MAP_MEMORY_PLACED);
49+
+ pdevice->enable_map_memory_placed = true;
50+
51+
if (pdevice->enable_map_memory_placed) {
52+
pdevice->vk.supported_extensions.EXT_map_memory_placed = true;
53+
diff --git a/src/vulkan/wrapper/wrapper_private.h b/src/vulkan/wrapper/wrapper_private.h
54+
index a7a9c22e627..d45746cf6bf 100644
55+
--- a/src/vulkan/wrapper/wrapper_private.h
56+
+++ b/src/vulkan/wrapper/wrapper_private.h
57+
@@ -12,11 +12,6 @@ extern const struct vk_instance_extension_table wrapper_instance_extensions;
58+
extern const struct vk_device_extension_table wrapper_device_extensions;
59+
extern const struct vk_device_extension_table wrapper_filter_extensions;
60+
61+
-extern uint64_t WRAPPER_DEBUG;
62+
-
63+
-#define WRAPPER_MAP_MEMORY_PLACED (1ull << 0)
64+
-#define WRAPPER_BC (1ull << 1)
65+
-
66+
struct wrapper_instance {
67+
struct vk_instance vk;
68+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/src/vulkan/wrapper/wrapper_device_memory.c b/src/vulkan/wrapper/wrapper_device_memory.c
2+
index f91dcf2a54a..1f1846c025f 100644
3+
--- a/src/vulkan/wrapper/wrapper_device_memory.c
4+
+++ b/src/vulkan/wrapper/wrapper_device_memory.c
5+
@@ -1,6 +1,10 @@
6+
+#define native_handle_t __native_handle_t
7+
+#define buffer_handle_t __buffer_handle_t
8+
#include "wrapper_private.h"
9+
#include "wrapper_entrypoints.h"
10+
#include "vk_common_entrypoints.h"
11+
+#undef native_handle_t
12+
+#undef buffer_handle_t
13+
#include "util/os_file.h"
14+
#include "vk_util.h"
15+

packages/mesa-vulkan-wrapper/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ PKG_PRETTY_NAME="Mesa Android Wrapper"
44
VK_DRIVER_LIB="libvulkan_wrapper.so"
55

66
GIT_URL=https://github.com/xMeM/mesa
7-
GIT_COMMIT=d7a274ab77ecadb4b06175c38b726d24a6cb9210
7+
GIT_COMMIT=e65c7eb6ee2f9903c3256f2677beb1d98464103f
88
LDFLAGS="-L$PREFIX/lib -landroid-shmem"
99
MESON_ARGS="-Dgallium-drivers= -Dvulkan-drivers=wrapper -Dglvnd=disabled -Dplatforms=x11 -Dxmlconfig=disabled -Dllvm=disabled -Dopengl=false -Degl=disabled -Dzstd=enabled"

0 commit comments

Comments
 (0)