From 9c040caa40916a4aedc7f0363cecd15c2e00d523 Mon Sep 17 00:00:00 2001 From: Evan Tang Date: Wed, 2 Jul 2025 16:23:51 -0500 Subject: [PATCH] vkd3d: Get rid of the default fragment shader from d3d12_pipeline_state_init_graphics(). Vulkan does support rendering without a fragment shader, and this seems to work fine on current drivers. This commit gets rid of the last embedded shader binary in libvkd3d, and may have a slight performance advantage on hardware/drivers able to take advantage of the absence of a fragment shader. --- libs/vkd3d/state.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index 517354c90..9e9811bf9 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -3232,17 +3232,6 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s uint32_t mask; HRESULT hr; - static const DWORD default_ps_code[] = - { -#if 0 - ps_4_0 - ret -#endif - 0x43425844, 0x19cbf606, 0x18f562b9, 0xdaeed4db, 0xc324aa46, 0x00000001, 0x00000060, 0x00000003, - 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, - 0x00000008, 0x00000000, 0x00000008, 0x52444853, 0x0000000c, 0x00000040, 0x00000003, 0x0100003e, - }; - static const D3D12_SHADER_BYTECODE default_ps = {default_ps_code, sizeof(default_ps_code)}; static const struct { enum VkShaderStageFlagBits stage; @@ -3405,12 +3394,6 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s { graphics->blend_attachments[i].colorWriteMask = 0; } - - if (FAILED(hr = create_shader_stage(device, &graphics->stages[graphics->stage_count], - VK_SHADER_STAGE_FRAGMENT_BIT, &default_ps, NULL))) - goto fail; - - ++graphics->stage_count; } }