Repository navigation
wrapper: emulate VK_EXT_depth_clip_enable and expose the EXT name of rasterization order attachment access for GL - #66
Merged
Conversation
added 2 commits
November 20, 2026 10:23
…ers with depthClamp zink exposes GL_ARB_depth_clamp only with VK_EXT_depth_clip_enable, and that extension is the last missing GL 3.2 requirement on Mali-G615 r44p1: zink gives OpenGL 3.1 there and 3.2 core and compatibility context requests fail. The driver does not list the extension but has depthClamp. Without the extension the driver clips against the depth planes exactly when depthClampEnable is false. When the base driver lacks the extension, has depthClamp and the client is not DXVK or vkd3d, the wrapper now lists VK_EXT_depth_clip_enable with depthClipEnable and reports extendedDynamicState3DepthClipEnable as unsupported. At device creation the extension is not passed to the driver and its feature struct is unlinked from the chain before the feature masking, so the caller's depthClipEnable stays set. At pipeline creation a VkPipelineRasterizationDepthClipStateCreateInfoEXT in a pipeline that owns pre-rasterization state is removed from a copy of the rasterization state, and depthClampEnable becomes !depthClipEnable (clamping only when the device enabled depthClamp). D3D clients, drivers with the extension and drivers without depthClamp are unchanged. WRAPPER_EMULATE_DEPTH_CLIP_ENABLE=0 turns it off.
…rs with only the ARM name zink only recognizes VK_EXT_rasterization_order_attachment_access, which it needs for coherent framebuffer fetch. Mali-G68 r38p1 and Mali-G710 r36p0 list only VK_ARM_rasterization_order_attachment_access. The EXT extension promoted the ARM one unchanged: the feature struct, its sType, the pipeline color blend and depth stencil create flags and the subpass description flags are aliases with the same values. When the driver lists the ARM name but not the EXT name, the wrapper now also lists the EXT name. The feature bits are the driver's own: the wrapper's feature query always chains the struct, whose sType the driver knows through the ARM extension. At device creation an enabled EXT name is passed to the driver as the ARM name and the feature struct stays in the chain. Drivers that list the EXT name or neither are unchanged. It applies to every client, like the vertex_attribute_divisor alias: DXVK and vkd3d-proton do not use the extension, and it reports only what the driver supports.
This was referenced Nov 20, 2026
utkarshdalal
marked this pull request as ready for review
November 20, 2026 11:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Mali-G615 (driver r44p1, Vulkan 1.3.247, Vivo T4x 5G) zink gives OpenGL 3.1 only, and 3.2 core and compatibility context requests fail. The one GL 3.2 requirement missing there is
GL_ARB_depth_clamp: Mesa maps it toPIPE_CAP_DEPTH_CLIP_DISABLE, and zink reports that only when the device listsVK_EXT_depth_clip_enable. The Mali driver does not list the extension, but it hasdepthClamp.zink also recognizes only the name
VK_EXT_rasterization_order_attachment_access, which it needs for coherent framebuffer fetch. Mali-G68 r38p1 and Mali-G710 r36p0 list onlyVK_ARM_rasterization_order_attachment_access; Mali-G615 r44p1 and G715 r48 list both.Change
Depth clip enable
Without the extension, the driver clips against the depth planes exactly when
depthClampEnableis false. So a driver withdepthClampcan express what aVkPipelineRasterizationDepthClipStateCreateInfoEXTasks for.The wrapper now does this when the base driver lacks the extension, has
depthClamp, and the client is not DXVK or vkd3d:VK_EXT_depth_clip_enableand reportsdepthClipEnable. It reportsextendedDynamicState3DepthClipEnableas unsupported, because the dynamic state is not emulated.depthClipEnablestays set.depthClampEnableis set to!depthClipEnable. Clamping is only used when the device enableddepthClamp. The caller's structs are not modified.D3D clients, drivers that have the extension, and drivers without
depthClampbehave as before.WRAPPER_EMULATE_DEPTH_CLIP_ENABLE=0turns the emulation off.Clip off with clamp off becomes clamp on. That is the closest the driver can do, and it is what DXVK does without the extension.
Rasterization order attachment access
The EXT extension promoted the ARM one unchanged: in
vk.xmlthe feature struct, its sType, the color blend and depth stencil pipeline create flags and the subpass description flags are all aliases with the same values.When the driver lists the ARM name but not the EXT name, the wrapper now also lists
VK_EXT_rasterization_order_attachment_access:rasterizationOrder*AttachmentAccessfeature bits are the driver's own values. The wrapper's feature query always chains the struct, and the driver fills it through the ARM extension because the sType is the same.Drivers that list the EXT name, or neither name, behave as before. This applies to every client, like the existing
vertex_attribute_divisoralias: DXVK and vkd3d-proton do not use the extension, and it reports only what the driver supports.Testing
Run on BrowserStack devices with the wrapper from #66 (
wrapper-gamenative-20261120.tzst, sha2564443e109...43ff) and the guest libGL from #67 (extra_libs-20261120.tzst, sha2566f4914c0...44bc, reportsgit-9b8c6bf6f8), X11, xlib zink, no version or extension overrides. A WGL test program requests each context version, then draws and reads pixels back: depth clamp on and off (19 cases), all eight packed 10/10/10/2 vertex formats with plain, instanced and interleaved layouts (59 cases), and dual-source blending with every src1 factor and equation, constant color, color masks, sRGB, RGBA16F, RGB565, the default framebuffer, overlapping primitives in one draw, 4x MSAA and alpha-to-coverage (63 cases). The testbed's GL texture suite runs as a second step.wrapper-gamenative-20261027withextra_libs-20261104.dualSrcBlend, no rasterization order attachment access and no queue timestamps (GL_ARB_timer_query).GL_ARB_viewport_array,maxViewportsis 1).Found during these runs and not caused by these changes (both reproduce with the shipped parts):
glReadPixels(GL_DEPTH_COMPONENT, GL_FLOAT)on a 24-bit depth renderbuffer, later draws to that framebuffer no longer show in readbacks. Integer reads, other depth formats and a new framebuffer work.D3D regression
The testbed's D3D acceptance suite (D3D11 through DXVK, D3D12 through vkd3d-proton, five configurations) ran with the same two archives. Values are pass/fail/skip.
wrapper-gamenative-20261027. The one failure is the recorded Pixel 7 case (d3d12 rgba8_heap_top).load_bc*_2048_finalcase, which skips when its background stage does not finish in 10 s.Not covered: no game was run on these devices, only the test programs. On Adreno only the libGL change was run (results in #67); the wrapper change was not. The GL 4.0 features that are now reachable on Mali (tessellation, doubles) were not drawn.