Based on a vkd3d-proton patch by Philip Rebohle.
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- tests/d3d12.c | 181 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 181 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c index 89b1f000..dd0c0b61 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -673,6 +673,21 @@ static bool is_shader_float64_supported(ID3D12Device *device) return options.DoublePrecisionFloatShaderOps; }
+static bool is_stencil_ref_export_supported(ID3D12Device *device) +{ + D3D12_FEATURE_DATA_D3D12_OPTIONS options; + HRESULT hr; + + if (FAILED(hr = ID3D12Device_CheckFeatureSupport(device, + D3D12_FEATURE_D3D12_OPTIONS, &options, sizeof(options)))) + { + trace("Failed to check feature support, hr %#x.\n", hr); + return false; + } + + return options.PSSpecifiedStencilRefSupported; +} + #define create_cb_root_signature(a, b, c, e) create_cb_root_signature_(__LINE__, a, b, c, e) static ID3D12RootSignature *create_cb_root_signature_(unsigned int line, ID3D12Device *device, unsigned int reg_idx, D3D12_SHADER_VISIBILITY shader_visibility, @@ -20547,6 +20562,171 @@ static void test_stencil_load(void) destroy_test_context(&context); }
+static void test_stencil_export(void) +{ + D3D12_SHADER_RESOURCE_VIEW_DESC stencil_srv_desc; + D3D12_GRAPHICS_PIPELINE_STATE_DESC pso_desc; + ID3D12GraphicsCommandList *command_list; + D3D12_DESCRIPTOR_HEAP_DESC heap_desc; + struct depth_stencil_resource ds; + ID3D12PipelineState *pso_sample; + ID3D12RootSignature *rs_sample; + ID3D12DescriptorHeap *srv_heap; + struct test_context_desc desc; + struct test_context context; + ID3D12CommandQueue *queue; + HRESULT hr; + + static const DWORD ps_code[] = + { +#if 0 + uint stencil_ref; + + uint main() : SV_StencilRef + { + return stencil_ref; + } +#endif + 0x43425844, 0x3980cb16, 0xbbe87d38, 0xb93f7c61, 0x200c41ed, 0x00000001, 0x000000cc, 0x00000004, + 0x00000030, 0x00000040, 0x00000078, 0x000000bc, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, + 0x4e47534f, 0x00000030, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001, + 0xffffffff, 0x00000e01, 0x535f5653, 0x636e6574, 0x65526c69, 0xabab0066, 0x58454853, 0x0000003c, + 0x00000050, 0x0000000f, 0x0100086a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x02000065, + 0x00029001, 0x05000036, 0x00029001, 0x0020800a, 0x00000000, 0x00000000, 0x0100003e, 0x30494653, + 0x00000008, 0x00000200, 0x00000000, + }; + const D3D12_SHADER_BYTECODE ps = {ps_code, sizeof(ps_code)}; + static const DWORD ps_sample_code[] = + { +#if 0 + Texture2D<uint4> tex : register(t0); + + uint4 main(float4 pos : SV_Position) : SV_TARGET + { + return tex[uint2(pos.xy)].g; + } +#endif + 0x43425844, 0xdd1e98d4, 0x53c81701, 0x576f6b2e, 0x040b18bb, 0x00000001, 0x0000014c, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x0000000f, 0x545f5653, 0x45475241, 0xabab0054, 0x58454853, 0x000000b0, 0x00000050, + 0x0000002c, 0x0100086a, 0x04001858, 0x00107000, 0x00000000, 0x00004444, 0x04002064, 0x00101032, + 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000001, 0x0500001c, + 0x00100032, 0x00000000, 0x00101046, 0x00000000, 0x08000036, 0x001000c2, 0x00000000, 0x00004002, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8900002d, 0x800000c2, 0x00111103, 0x00100012, + 0x00000000, 0x00100e46, 0x00000000, 0x00107e16, 0x00000000, 0x05000036, 0x001020f2, 0x00000000, + 0x00100006, 0x00000000, 0x0100003e, + }; + static const D3D12_SHADER_BYTECODE ps_sample = {ps_sample_code, sizeof(ps_sample_code)}; + static const float clear_color[4] = {0.0f, 0.0f, 0.0f, 0.0f}; + + memset(&desc, 0, sizeof(desc)); + desc.rt_width = 640; + desc.rt_height = 480; + desc.rt_format = DXGI_FORMAT_R8_UINT; + desc.no_root_signature = true; + if (!init_test_context(&context, &desc)) + return; + + if (!is_stencil_ref_export_supported(context.device)) + { + skip("The device does not support stencil ref export.\n"); + destroy_test_context(&context); + return; + } + + command_list = context.list; + queue = context.queue; + + init_depth_stencil(&ds, context.device, 640, 480, 1, 1, + DXGI_FORMAT_R32G8X24_TYPELESS, DXGI_FORMAT_D32_FLOAT_S8X24_UINT, NULL); + set_viewport(&context.viewport, 0.0f, 0.0f, 640.0f, 480.0f, 0.0f, 1.0f); + set_rect(&context.scissor_rect, 0, 0, 640, 480); + + context.root_signature = create_32bit_constants_root_signature(context.device, + 0, 1, D3D12_SHADER_VISIBILITY_PIXEL); + + init_pipeline_state_desc(&pso_desc, context.root_signature, 0, NULL, &ps, NULL); + + pso_desc.NumRenderTargets = 0; + pso_desc.DSVFormat = DXGI_FORMAT_D32_FLOAT_S8X24_UINT; + pso_desc.DepthStencilState.StencilEnable = true; + pso_desc.DepthStencilState.StencilReadMask = 0xff; + pso_desc.DepthStencilState.StencilWriteMask = 0xff; + pso_desc.DepthStencilState.FrontFace.StencilFailOp = D3D12_STENCIL_OP_REPLACE; + pso_desc.DepthStencilState.FrontFace.StencilDepthFailOp = D3D12_STENCIL_OP_REPLACE; + pso_desc.DepthStencilState.FrontFace.StencilPassOp = D3D12_STENCIL_OP_REPLACE; + pso_desc.DepthStencilState.FrontFace.StencilFunc = D3D12_COMPARISON_FUNC_ALWAYS; + pso_desc.DepthStencilState.BackFace = pso_desc.DepthStencilState.FrontFace; + hr = ID3D12Device_CreateGraphicsPipelineState(context.device, &pso_desc, + &IID_ID3D12PipelineState, (void **)&context.pipeline_state); + ok(SUCCEEDED(hr), "Failed to create graphics pipeline state, hr %#x.\n", hr); + + rs_sample = create_texture_root_signature(context.device, + D3D12_SHADER_VISIBILITY_PIXEL, 0, 0); + init_pipeline_state_desc(&pso_desc, rs_sample, DXGI_FORMAT_R8_UINT, NULL, &ps_sample, NULL); + hr = ID3D12Device_CreateGraphicsPipelineState(context.device, &pso_desc, + &IID_ID3D12PipelineState, (void **)&pso_sample); + ok(SUCCEEDED(hr), "Failed to create graphics pipeline state, hr %#x.\n", hr); + + heap_desc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV; + heap_desc.NumDescriptors = 1; + heap_desc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE; + heap_desc.NodeMask = 0; + + hr = ID3D12Device_CreateDescriptorHeap(context.device, &heap_desc, &IID_ID3D12DescriptorHeap, (void **)&srv_heap); + ok(hr == S_OK, "Failed to create descriptor heap, hr %#x.\n", hr); + + ID3D12GraphicsCommandList_ClearDepthStencilView(command_list, ds.dsv_handle, + D3D12_CLEAR_FLAG_STENCIL, 0.0f, 0x80, 0, NULL); + + ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 0, NULL, false, &ds.dsv_handle); + ID3D12GraphicsCommandList_OMSetStencilRef(command_list, 0x40); + ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature); + ID3D12GraphicsCommandList_SetPipelineState(command_list, context.pipeline_state); + ID3D12GraphicsCommandList_IASetPrimitiveTopology(command_list, D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST); + ID3D12GraphicsCommandList_RSSetViewports(command_list, 1, &context.viewport); + ID3D12GraphicsCommandList_RSSetScissorRects(command_list, 1, &context.scissor_rect); + + ID3D12GraphicsCommandList_SetGraphicsRoot32BitConstant(command_list, 0, 0xff, 0); + ID3D12GraphicsCommandList_DrawInstanced(command_list, 3, 1, 0, 0); + + transition_resource_state(command_list, ds.texture, + D3D12_RESOURCE_STATE_DEPTH_WRITE, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE); + + stencil_srv_desc.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D; + stencil_srv_desc.Format = DXGI_FORMAT_X32_TYPELESS_G8X24_UINT; + stencil_srv_desc.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING; + stencil_srv_desc.Texture2D.MostDetailedMip = 0; + stencil_srv_desc.Texture2D.MipLevels = 1; + stencil_srv_desc.Texture2D.PlaneSlice = 1; + stencil_srv_desc.Texture2D.ResourceMinLODClamp = 0.0f; + + ID3D12Device_CreateShaderResourceView(context.device, ds.texture, &stencil_srv_desc, + ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(srv_heap)); + + ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL); + ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, clear_color, 0, NULL); + ID3D12GraphicsCommandList_SetDescriptorHeaps(command_list, 1, &srv_heap); + ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, rs_sample); + ID3D12GraphicsCommandList_SetGraphicsRootDescriptorTable(command_list, 0, + ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(srv_heap)); + ID3D12GraphicsCommandList_SetPipelineState(command_list, pso_sample); + ID3D12GraphicsCommandList_DrawInstanced(command_list, 3, 1, 0, 0); + + transition_resource_state(command_list, context.render_target, + D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE); + + check_sub_resource_uint8(context.render_target, 0, queue, command_list, 0xff, 0); + + ID3D12DescriptorHeap_Release(srv_heap); + ID3D12PipelineState_Release(pso_sample); + ID3D12RootSignature_Release(rs_sample); + destroy_depth_stencil(&ds); + destroy_test_context(&context); +} + static void test_typed_buffer_uav(void) { D3D12_CPU_DESCRIPTOR_HANDLE cpu_descriptor_handle; @@ -35223,6 +35403,7 @@ START_TEST(d3d12) run_test(test_depth_load); run_test(test_depth_read_only_view); run_test(test_stencil_load); + run_test(test_stencil_export); run_test(test_typed_buffer_uav); run_test(test_typed_uav_store); run_test(test_compute_shader_registers);
Based on a vkd3d-proton patch by Philip Rebohle.
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- include/vkd3d_shader.h | 1 + libs/vkd3d-shader/dxbc.c | 3 +++ libs/vkd3d-shader/sm4.h | 1 + libs/vkd3d-shader/spirv.c | 20 ++++++++++++++++++++ libs/vkd3d-shader/trace.c | 4 ++++ libs/vkd3d-shader/vkd3d_shader_private.h | 2 ++ 6 files changed, 31 insertions(+)
diff --git a/include/vkd3d_shader.h b/include/vkd3d_shader.h index 58e507b7..e8f329f3 100644 --- a/include/vkd3d_shader.h +++ b/include/vkd3d_shader.h @@ -578,6 +578,7 @@ enum vkd3d_shader_spirv_extension VKD3D_SHADER_SPIRV_EXTENSION_NONE, VKD3D_SHADER_SPIRV_EXTENSION_EXT_DEMOTE_TO_HELPER_INVOCATION, VKD3D_SHADER_SPIRV_EXTENSION_EXT_DESCRIPTOR_INDEXING, + VKD3D_SHADER_SPIRV_EXTENSION_EXT_STENCIL_EXPORT,
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_SPIRV_EXTENSION), }; diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 23814a35..3e4dfc6d 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -923,6 +923,8 @@ static const enum vkd3d_shader_register_type register_type_table[] = /* VKD3D_SM5_RT_GS_INSTANCE_ID */ VKD3DSPR_GSINSTID, /* VKD3D_SM5_RT_DEPTHOUT_GREATER_EQUAL */ VKD3DSPR_DEPTHOUTGE, /* VKD3D_SM5_RT_DEPTHOUT_LESS_EQUAL */ VKD3DSPR_DEPTHOUTLE, + /* VKD3D_SM5_RT_CYCLE_COUNTER */ ~0u, + /* VKD3D_SM5_RT_OUTPUT_STENCIL_REF */ VKD3DSPR_OUTSTENCILREF, };
static const enum vkd3d_shader_register_precision register_precision_table[] = @@ -1385,6 +1387,7 @@ static bool shader_sm4_is_scalar_register(const struct vkd3d_shader_register *re case VKD3DSPR_OUTPOINTID: case VKD3DSPR_PRIMID: case VKD3DSPR_SAMPLEMASK: + case VKD3DSPR_OUTSTENCILREF: return true; default: return false; diff --git a/libs/vkd3d-shader/sm4.h b/libs/vkd3d-shader/sm4.h index 3ac41cb0..ddcb9a86 100644 --- a/libs/vkd3d-shader/sm4.h +++ b/libs/vkd3d-shader/sm4.h @@ -397,6 +397,7 @@ enum vkd3d_sm4_register_type VKD3D_SM5_RT_GS_INSTANCE_ID = 0x25, VKD3D_SM5_RT_DEPTHOUT_GREATER_EQUAL = 0x26, VKD3D_SM5_RT_DEPTHOUT_LESS_EQUAL = 0x27, + VKD3D_SM5_RT_OUTPUT_STENCIL_REF = 0x29, };
enum vkd3d_sm4_extended_operand_type diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index f604b8ef..b03558e4 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -1840,6 +1840,8 @@ static bool vkd3d_spirv_compile_module(struct vkd3d_spirv_builder *builder, || vkd3d_spirv_capability_is_enabled(builder, SpvCapabilityStorageTexelBufferArrayDynamicIndexingEXT) || vkd3d_spirv_capability_is_enabled(builder, SpvCapabilityStorageImageArrayDynamicIndexing)) vkd3d_spirv_build_op_extension(&stream, "SPV_EXT_descriptor_indexing"); + if (vkd3d_spirv_capability_is_enabled(builder, SpvCapabilityStencilExportEXT)) + vkd3d_spirv_build_op_extension(&stream, "SPV_EXT_shader_stencil_export");
if (builder->ext_instr_set_glsl_450) vkd3d_spirv_build_op_ext_inst_import(&stream, builder->ext_instr_set_glsl_450, "GLSL.std.450"); @@ -2884,6 +2886,9 @@ static bool vkd3d_dxbc_compiler_get_register_name(char *buffer, unsigned int buf case VKD3DSPR_PRIMID: /* SPIRV-Tools disassembler generates names for SPIR-V built-ins. */ return false; + case VKD3DSPR_OUTSTENCILREF: + snprintf(buffer, buffer_size, "oStencilRef"); + break; default: FIXME("Unhandled register %#x.\n", reg->type); snprintf(buffer, buffer_size, "unrecognized_%#x", reg->type); @@ -4090,6 +4095,8 @@ vkd3d_register_builtins[] = {VKD3DSPR_DEPTHOUT, {VKD3D_SHADER_COMPONENT_FLOAT, 1, SpvBuiltInFragDepth}}, {VKD3DSPR_DEPTHOUTGE, {VKD3D_SHADER_COMPONENT_FLOAT, 1, SpvBuiltInFragDepth}}, {VKD3DSPR_DEPTHOUTLE, {VKD3D_SHADER_COMPONENT_FLOAT, 1, SpvBuiltInFragDepth}}, + + {VKD3DSPR_OUTSTENCILREF, {VKD3D_SHADER_COMPONENT_UINT, 1, SpvBuiltInFragStencilRefEXT}}, };
static void vkd3d_dxbc_compiler_emit_register_execution_mode(struct vkd3d_dxbc_compiler *compiler, @@ -4103,6 +4110,18 @@ static void vkd3d_dxbc_compiler_emit_register_execution_mode(struct vkd3d_dxbc_c case VKD3DSPR_DEPTHOUTLE: vkd3d_dxbc_compiler_emit_execution_mode(compiler, SpvExecutionModeDepthLess, NULL, 0); break; + case VKD3DSPR_OUTSTENCILREF: + if (!vkd3d_dxbc_compiler_is_target_extension_supported(compiler, + VKD3D_SHADER_SPIRV_EXTENSION_EXT_STENCIL_EXPORT)) + { + FIXME("The target environment does not support stencil export.\n"); + vkd3d_dxbc_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_STENCIL_EXPORT_UNSUPPORTED, + "Cannot export stencil reference value for register id %u. " + "The target environment does not support stencil export.", reg->idx[0].offset); + } + vkd3d_spirv_enable_capability(&compiler->spirv_builder, SpvCapabilityStencilExportEXT); + vkd3d_dxbc_compiler_emit_execution_mode(compiler, SpvExecutionModeStencilRefReplacingEXT, NULL, 0); + break; default: return; } @@ -4864,6 +4883,7 @@ static void vkd3d_dxbc_compiler_emit_output_register(struct vkd3d_dxbc_compiler reg_symbol.info.reg.dcl_mask = write_mask; reg_symbol.info.reg.is_aggregate = builtin->spirv_array_size; vkd3d_dxbc_compiler_put_symbol(compiler, ®_symbol); + vkd3d_dxbc_compiler_emit_register_execution_mode(compiler, reg); vkd3d_dxbc_compiler_emit_register_debug_name(builder, output_id, reg); }
diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c index 45f38d13..d4dbf059 100644 --- a/libs/vkd3d-shader/trace.c +++ b/libs/vkd3d-shader/trace.c @@ -1027,6 +1027,10 @@ static void shader_dump_register(struct vkd3d_d3d_asm_compiler *compiler, const shader_addline(buffer, "vGSInstanceID"); break;
+ case VKD3DSPR_OUTSTENCILREF: + shader_addline(buffer, "oStencilRef"); + break; + default: shader_addline(buffer, "<unhandled_rtype(%#x)>", reg->type); break; diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 8b3e7624..a06755d2 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -76,6 +76,7 @@ enum vkd3d_shader_error VKD3D_SHADER_ERROR_SPV_INVALID_REGISTER_TYPE = 2001, VKD3D_SHADER_ERROR_SPV_INVALID_DESCRIPTOR_BINDING = 2002, VKD3D_SHADER_ERROR_SPV_DESCRIPTOR_IDX_UNSUPPORTED = 2003, + VKD3D_SHADER_ERROR_SPV_STENCIL_EXPORT_UNSUPPORTED = 2004,
VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY = 3000, VKD3D_SHADER_ERROR_RS_INVALID_VERSION = 3001, @@ -437,6 +438,7 @@ enum vkd3d_shader_register_type VKD3DSPR_DEPTHOUTGE, VKD3DSPR_DEPTHOUTLE, VKD3DSPR_RASTERIZER, + VKD3DSPR_OUTSTENCILREF,
VKD3DSPR_INVALID = ~0u, };
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d/device.c | 9 ++++++++- libs/vkd3d/vkd3d_private.h | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 0fadb521..3fd8f123 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -134,6 +134,7 @@ static const struct vkd3d_optional_extension_info optional_device_extensions[] = VK_EXTENSION(EXT_DEPTH_CLIP_ENABLE, EXT_depth_clip_enable), VK_EXTENSION(EXT_DESCRIPTOR_INDEXING, EXT_descriptor_indexing), VK_EXTENSION(EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION, EXT_shader_demote_to_helper_invocation), + VK_EXTENSION(EXT_SHADER_STENCIL_EXPORT, EXT_shader_stencil_export), VK_EXTENSION(EXT_TEXEL_BUFFER_ALIGNMENT, EXT_texel_buffer_alignment), VK_EXTENSION(EXT_TRANSFORM_FEEDBACK, EXT_transform_feedback), VK_EXTENSION(EXT_VERTEX_ATTRIBUTE_DIVISOR, EXT_vertex_attribute_divisor), @@ -1329,7 +1330,6 @@ static HRESULT vkd3d_init_device_caps(struct d3d12_device *device, else device->feature_options.ResourceBindingTier = D3D12_RESOURCE_BINDING_TIER_3;
- device->feature_options.PSSpecifiedStencilRefSupported = FALSE; device->feature_options.TypedUAVLoadAdditionalFormats = features->shaderStorageImageExtendedFormats; /* GL_INTEL_fragment_shader_ordering, no Vulkan equivalent. */ device->feature_options.ROVsSupported = FALSE; @@ -1441,6 +1441,8 @@ static HRESULT vkd3d_init_device_caps(struct d3d12_device *device,
vkd3d_free(vk_extensions);
+ device->feature_options.PSSpecifiedStencilRefSupported = vulkan_info->EXT_shader_stencil_export; + vkd3d_init_feature_level(vulkan_info, features, &device->feature_options); if (vulkan_info->max_feature_level < create_info->minimum_feature_level) { @@ -1461,6 +1463,11 @@ static HRESULT vkd3d_init_device_caps(struct d3d12_device *device, vulkan_info->shader_extensions[vulkan_info->shader_extension_count++] = VKD3D_SHADER_SPIRV_EXTENSION_EXT_DESCRIPTOR_INDEXING;
+ if (vulkan_info->EXT_shader_stencil_export) + vulkan_info->shader_extensions[vulkan_info->shader_extension_count++] + = VKD3D_SHADER_SPIRV_EXTENSION_EXT_STENCIL_EXPORT; + + /* Disable unused Vulkan features. */ features->shaderTessellationAndGeometryPointSize = VK_FALSE;
diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index 0b326b11..5705bb51 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -51,7 +51,7 @@
#define VKD3D_MAX_COMPATIBLE_FORMAT_COUNT 6u #define VKD3D_MAX_QUEUE_FAMILY_COUNT 3u -#define VKD3D_MAX_SHADER_EXTENSIONS 2u +#define VKD3D_MAX_SHADER_EXTENSIONS 3u #define VKD3D_MAX_SHADER_STAGES 5u #define VKD3D_MAX_VK_SYNC_OBJECTS 4u #define VKD3D_MAX_DESCRIPTOR_SETS 2u @@ -108,6 +108,7 @@ struct vkd3d_vulkan_info bool EXT_depth_clip_enable; bool EXT_descriptor_indexing; bool EXT_shader_demote_to_helper_invocation; + bool EXT_shader_stencil_export; bool EXT_texel_buffer_alignment; bool EXT_transform_feedback; bool EXT_vertex_attribute_divisor;