Skip to content

Commit 1d19617

Browse files
committed
fix patches
1 parent dd46b31 commit 1d19617

2 files changed

Lines changed: 39 additions & 60 deletions

patches/SE/0001-Bend-ANGLE-rules-for-MAX_TEXTURE_SIZE-unconditionally.patch

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
From ca144e341f339108b78b2754ee1e28c81b1fdcac Mon Sep 17 00:00:00 2001
1+
From 839e1838ca9418657f5baabbaf6d9e0d6830595d Mon Sep 17 00:00:00 2001
22
From: Homura <egzozu.be.bas@gmail.com>
3-
Date: Sat, 16 May 2026 21:51:25 +0300
3+
Date: Thu, 28 May 2026 20:28:01 +0300
44
Subject: [PATCH 1/5] bend ANGLE rules for `MAX_TEXTURE_SIZE` unconditionally.
55

66
Currently, reaching `MAX_TEXTURE_SIZE` has the effect of a black box. The creation fails and the behavior diverges vastly across backends, Without having the ability to realistically probe what the GPU can do, applications end up losing that capability.
@@ -18,23 +18,23 @@ Instead of making guesses, we give the GPU permission to try to create the textu
1818
8 files changed, 37 insertions(+), 70 deletions(-)
1919

2020
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
21-
index 57f4a734ef..475aa66c30 100644
21+
index 0609e54e53..eea2eba68c 100644
2222
--- a/src/libANGLE/Context.cpp
2323
+++ b/src/libANGLE/Context.cpp
24-
@@ -4309,9 +4309,9 @@ void Context::initCaps()
25-
26-
// Apply/Verify implementation limits
27-
ANGLE_LIMIT_CAP(caps->maxDrawBuffers, IMPLEMENTATION_MAX_DRAW_BUFFERS);
24+
@@ -4308,9 +4308,9 @@ void Context::initCaps()
25+
const GLint maxDrawBuffersAndColorAttachments = std::min<GLint>(
26+
std::min(caps->maxDrawBuffers, caps->maxColorAttachments), IMPLEMENTATION_MAX_DRAW_BUFFERS);
27+
ANGLE_LIMIT_CAP(caps->maxDrawBuffers, maxDrawBuffersAndColorAttachments);
2828
- ANGLE_LIMIT_CAP(caps->maxFramebufferWidth, IMPLEMENTATION_MAX_FRAMEBUFFER_SIZE);
2929
- ANGLE_LIMIT_CAP(caps->maxFramebufferHeight, IMPLEMENTATION_MAX_FRAMEBUFFER_SIZE);
3030
- ANGLE_LIMIT_CAP(caps->maxRenderbufferSize, IMPLEMENTATION_MAX_RENDERBUFFER_SIZE);
3131
+ ANGLE_LIMIT_CAP(caps->maxFramebufferWidth, 16384);
3232
+ ANGLE_LIMIT_CAP(caps->maxFramebufferHeight, 16384);
3333
+ ANGLE_LIMIT_CAP(caps->maxRenderbufferSize, 16384);
34-
ANGLE_LIMIT_CAP(caps->maxColorAttachments, IMPLEMENTATION_MAX_DRAW_BUFFERS);
34+
ANGLE_LIMIT_CAP(caps->maxColorAttachments, maxDrawBuffersAndColorAttachments);
3535
ANGLE_LIMIT_CAP(caps->maxVertexAttributes, MAX_VERTEX_ATTRIBS);
3636
if (mDisplay->getFrontendFeatures().forceMinimumMaxVertexAttributes.enabled &&
37-
@@ -4340,18 +4340,18 @@ void Context::initCaps()
37+
@@ -4339,18 +4339,18 @@ void Context::initCaps()
3838

3939
if (mWebGLContext && limitations.webGLTextureSizeLimit > 0)
4040
{
@@ -59,7 +59,7 @@ index 57f4a734ef..475aa66c30 100644
5959
ANGLE_LIMIT_CAP(caps->maxShaderUniformBlocks[ShaderType::Vertex],
6060
IMPLEMENTATION_MAX_VERTEX_SHADER_UNIFORM_BUFFERS);
6161
diff --git a/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp b/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp
62-
index 4de7ba5c3d..b3424c9414 100644
62+
index 9665f7d923..fbf58fac29 100644
6363
--- a/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp
6464
+++ b/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp
6565
@@ -414,32 +414,6 @@ int GetMaximumSimultaneousRenderTargets(D3D_FEATURE_LEVEL featureLevel)
@@ -118,7 +118,7 @@ index 52e9cdad65..86c1ba8bb7 100644
118118
// D3D treats cube maps as a special case of 2D textures
119119
caps->maxCubeMapTextureSize = caps->max2DTextureSize;
120120
diff --git a/src/libANGLE/renderer/gl/renderergl_utils.cpp b/src/libANGLE/renderer/gl/renderergl_utils.cpp
121-
index 1eadd4b551..254e37c37e 100644
121+
index b8219a1080..530c691bae 100644
122122
--- a/src/libANGLE/renderer/gl/renderergl_utils.cpp
123123
+++ b/src/libANGLE/renderer/gl/renderergl_utils.cpp
124124
@@ -810,7 +810,7 @@ void GenerateCaps(const FunctionsGL *functions,
@@ -169,10 +169,10 @@ index 1eadd4b551..254e37c37e 100644
169169

170170
// OpenGL 4.3 (and above) and OpenGL ES 3.2 can support all features and constants defined in
171171
diff --git a/src/libANGLE/renderer/metal/DisplayMtl.mm b/src/libANGLE/renderer/metal/DisplayMtl.mm
172-
index cdfd06b3f7..b82db25be4 100644
172+
index 066733a828..d8e2bcafba 100644
173173
--- a/src/libANGLE/renderer/metal/DisplayMtl.mm
174174
+++ b/src/libANGLE/renderer/metal/DisplayMtl.mm
175-
@@ -730,7 +730,7 @@ void DisplayMtl::ensureCapsInitialized() const
175+
@@ -732,7 +732,7 @@ void DisplayMtl::ensureCapsInitialized() const
176176
mNativeCaps.maxVaryingVectors = 31 - 1;
177177
mNativeCaps.maxVertexOutputComponents = mNativeCaps.maxFragmentInputComponents = 124 - 4;
178178
#elif TARGET_OS_SIMULATOR
@@ -181,7 +181,7 @@ index cdfd06b3f7..b82db25be4 100644
181181
mNativeCaps.maxVaryingVectors = 31 - 1;
182182
mNativeCaps.maxVertexOutputComponents = mNativeCaps.maxFragmentInputComponents = 124 - 4;
183183
#else
184-
@@ -742,7 +742,7 @@ void DisplayMtl::ensureCapsInitialized() const
184+
@@ -744,7 +744,7 @@ void DisplayMtl::ensureCapsInitialized() const
185185
}
186186
else
187187
{
@@ -304,5 +304,5 @@ index 30e5f270c6..855af53dc2 100644
304304
glCaps->maxColorTextureSamples = kMaxSampleCount;
305305
glCaps->maxDepthTextureSamples = kMaxSampleCount;
306306
--
307-
2.47.3
307+
2.54.0.windows.1
308308

patches/SE/0005-respect-XDG_SESSION_TYPE-instead-of-hardcoding-for-display-attribs.patch

Lines changed: 24 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,20 @@
1-
From 41b6ce23fddaf7fa158d5a8c5c573dd4aca5b491 Mon Sep 17 00:00:00 2001
1+
From 1930d7cdc7392e00cf38e0c3c3457c1d43eace48 Mon Sep 17 00:00:00 2001
22
From: Homura <egzozu.be.bas@gmail.com>
3-
Date: Mon, 20 Apr 2026 20:36:20 +0300
3+
Date: Thu, 28 May 2026 20:34:21 +0300
44
Subject: [PATCH 5/5] respect `XDG_SESSION_TYPE` instead of hardcoding for display
55
attribs.
66

77
---
8-
src/libANGLE/Display.cpp | 35 ++++++++++++---
8+
src/libANGLE/Display.cpp | 28 +++++++++---
99
src/libANGLE/renderer/vulkan/CLPlatformVk.cpp | 45 +++++++++++++------
10-
util/linux/LinuxWindow.cpp | 17 ++++---
11-
3 files changed, 72 insertions(+), 25 deletions(-)
10+
util/linux/LinuxWindow.cpp | 10 ++---
11+
3 files changed, 56 insertions(+), 27 deletions(-)
1212

1313
diff --git a/src/libANGLE/Display.cpp b/src/libANGLE/Display.cpp
14-
index 3b8bd137ab..1180182f2e 100644
14+
index 65f0f15ae3..86d36da9ec 100644
1515
--- a/src/libANGLE/Display.cpp
1616
+++ b/src/libANGLE/Display.cpp
17-
@@ -314,6 +314,13 @@ EGLAttrib GetDisplayTypeFromEnvironment()
18-
}
19-
#endif
20-
21-
+#if defined(ANGLE_ENABLE_D3D9)
22-
+ if (angleDefaultEnv == "d3d9")
23-
+ {
24-
+ return EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE;
25-
+ }
26-
+#endif
27-
+
28-
#if defined(ANGLE_ENABLE_D3D11)
29-
if (angleDefaultEnv == "d3d11")
30-
{
31-
@@ -377,19 +384,35 @@ EGLAttrib GetDeviceTypeFromEnvironment()
17+
@@ -377,19 +377,35 @@ EGLAttrib GetDeviceTypeFromEnvironment()
3218

3319
EGLAttrib GetPlatformTypeFromEnvironment()
3420
{
@@ -71,10 +57,10 @@ index 3b8bd137ab..1180182f2e 100644
7157

7258
rx::DisplayImpl *CreateDisplayFromAttribs(EGLAttrib displayType,
7359
diff --git a/src/libANGLE/renderer/vulkan/CLPlatformVk.cpp b/src/libANGLE/renderer/vulkan/CLPlatformVk.cpp
74-
index bfe30e866a..d38352721b 100644
60+
index 8a4d164614..588041f8fe 100644
7561
--- a/src/libANGLE/renderer/vulkan/CLPlatformVk.cpp
7662
+++ b/src/libANGLE/renderer/vulkan/CLPlatformVk.cpp
77-
@@ -259,24 +259,41 @@ angle::NativeWindowSystem CLPlatformVk::getWindowSystem()
63+
@@ -276,24 +276,41 @@ angle::NativeWindowSystem CLPlatformVk::getWindowSystem()
7864
const char *CLPlatformVk::getWSIExtension()
7965
{
8066
#if defined(ANGLE_ENABLE_VULKAN)
@@ -131,40 +117,33 @@ index bfe30e866a..d38352721b 100644
131117
#endif
132118
}
133119
diff --git a/util/linux/LinuxWindow.cpp b/util/linux/LinuxWindow.cpp
134-
index 34aa645bf3..c7799457ea 100644
120+
index 014a0fca81..03950412f7 100644
135121
--- a/util/linux/LinuxWindow.cpp
136122
+++ b/util/linux/LinuxWindow.cpp
137-
@@ -20,18 +20,25 @@
123+
@@ -20,20 +20,16 @@
138124
#if defined(ANGLE_USE_X11) || defined(ANGLE_USE_WAYLAND)
139-
OSWindow *OSWindow::New()
125+
OSWindow *OSWindow::New(void *nativeDisplay)
140126
{
141-
+ const char *session = getenv("XDG_SESSION_TYPE");
142-
+
143-
# if defined(ANGLE_USE_X11)
127+
-# if defined(ANGLE_USE_X11)
144128
- // Prefer X11
145129
- if (IsX11WindowAvailable())
146-
+ if (session && strcmp(session, "x11") == 0)
130+
+ const char *session = getenv("XDG_SESSION_TYPE");
131+
+ if ((session && strcmp(session, "x11") == 0) && IsX11WindowAvailable())
147132
{
148-
- return CreateX11Window();
149-
+ if (IsX11WindowAvailable())
150-
+ {
151-
+ return CreateX11Window();
152-
+ }
133+
return CreateX11Window();
153134
}
154-
# endif
135+
-# endif
155136

156-
# if defined(ANGLE_USE_WAYLAND)
137+
-# if defined(ANGLE_USE_WAYLAND)
157138
- if (IsWaylandWindowAvailable())
158-
+ if (session && strcmp(session, "wayland") == 0)
139+
+ if ((session && strcmp(session, "wayland") == 0) && IsWaylandWindowAvailable())
159140
{
160-
- return new WaylandWindow();
161-
+ if (IsWaylandWindowAvailable())
162-
+ {
163-
+ return new WaylandWindow();
164-
+ }
141+
return new WaylandWindow(nativeDisplay);
165142
}
166-
# endif
143+
-# endif
167144

145+
return nullptr;
146+
}
168147
--
169-
2.53.0.windows.1
148+
2.54.0.windows.1
170149

0 commit comments

Comments
 (0)