mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-25 15:56:01 +00:00
feat(vkbridge): SPIR-V editor; clip/cull distance and GS/TES point size emulation
The last pre-raster stage's ClipDistance becomes a varying and the fragment shader discards on a negative distance; cull distance and GS/TES PointSize become unread varyings. Rewritten modules pass spirv-val; DXVK's SV_ClipDistance check passes with the GPU's clip distance hidden. The client reports features by what the server emulates and what the GPU lacks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KZqR8XUE8czvGzEpgSCVQR
This commit is contained in:
1 parent
4a96c62f93
commit
2e569b850a
14 files changed
+1046
-28
No files matched your search
@@ -25,7 +25,7 @@ static int env_off(const char *name)
|
||||
return v && !strcmp(v, "0");
|
||||
}
|
||||
|
||||
uint32_t vkb_emu_detect(const vkb_dispatch *idt, VkPhysicalDevice pd)
|
||||
uint32_t vkb_emu_detect(const vkb_dispatch *idt, VkPhysicalDevice pd, uint32_t *missing)
|
||||
{
|
||||
VkPhysicalDeviceFeatures f;
|
||||
idt->vkGetPhysicalDeviceFeatures(pd, &f);
|
||||
@@ -65,6 +65,14 @@ uint32_t vkb_emu_detect(const vkb_dispatch *idt, VkPhysicalDevice pd)
|
||||
if (!depth_clip && f.depthClamp && !env_off("VKBRIDGE_EMU_DEPTHCLIP")) emu |= VKB_EMU_DEPTH_CLIP;
|
||||
/* PointSize in geometry/tessellation stages: stripped when the feature is missing. */
|
||||
if (!f.shaderTessellationAndGeometryPointSize && (f.geometryShader || f.tessellationShader)) emu |= VKB_EMU_POINT_SIZE;
|
||||
uint32_t miss = 0;
|
||||
if (!f.textureCompressionBC) miss |= VKB_EMU_BCN;
|
||||
if (!divisor) miss |= VKB_EMU_DIVISOR;
|
||||
if (!f.shaderClipDistance) miss |= VKB_EMU_CLIP_DISTANCE;
|
||||
if (!f.shaderCullDistance) miss |= VKB_EMU_CULL_DISTANCE;
|
||||
if (!depth_clip) miss |= VKB_EMU_DEPTH_CLIP;
|
||||
if (emu & VKB_EMU_MAINT5) miss |= VKB_EMU_MAINT5;
|
||||
*missing = miss;
|
||||
return emu & VKB_EMU_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user