Skip to content

Gate clip/cull distance builtins on Vulkan feature support#36

Merged
pythonlover02 merged 2 commits intopythonlover02:mainfrom
zeyadadev:mali-fixes
Apr 5, 2026
Merged

Gate clip/cull distance builtins on Vulkan feature support#36
pythonlover02 merged 2 commits intopythonlover02:mainfrom
zeyadadev:mali-fixes

Conversation

@zeyadadev
Copy link
Copy Markdown

Summary

  • Skip ClipDistance/CullDistance SPIR-V capability and builtin emission when the Vulkan device doesn't report shaderClipDistance/shaderCullDistance support
  • Covers both DXBC (D3D10/11) and DXSO/D3D9 fixed-function shader pipelines
  • No behavioral change on desktop GPUs (NVIDIA, AMD, Intel) where these features are always enabled

Motivation

Some mobile GPUs (e.g. Mali) don't expose shaderClipDistance/shaderCullDistance. Previously DXVK would unconditionally emit these builtins, producing invalid SPIR-V that causes crashes or rendering failures on such hardware

Changes

  • dxbc: Guard CapabilityClipDistance/CapabilityCullDistance in VS, HS, DS, GS init; skip emitDclClipCullDistanceArray when feature is off
  • dxso: Guard CapabilityClipDistance and emitVsClipping; move invariantPosition decoration after oPos.id validation
  • d3d9 fixed-function: Add enableClipDistance to D3D9FixedFunctionOptions, gate clipping emission

@pythonlover02 pythonlover02 self-assigned this Apr 5, 2026
@pythonlover02 pythonlover02 added the enhancement New feature or request label Apr 5, 2026
@pythonlover02
Copy link
Copy Markdown
Owner

thx for the work mate, everything looks good on the code, so merging :)

@pythonlover02 pythonlover02 merged commit e9f8681 into pythonlover02:main Apr 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants