Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- include/vkd3d_shader.h | 13 +++++++------ libs/vkd3d-shader/spirv.c | 8 ++++---- libs/vkd3d/device.c | 2 +- libs/vkd3d/state.c | 4 ++-- libs/vkd3d/vkd3d_private.h | 2 +- 5 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/include/vkd3d_shader.h b/include/vkd3d_shader.h index 1fa39b9..e57b913 100644 --- a/include/vkd3d_shader.h +++ b/include/vkd3d_shader.h @@ -227,11 +227,12 @@ enum vkd3d_shader_spirv_environment VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_SPIRV_ENVIRONMENT), };
-enum vkd3d_shader_target_extension +enum vkd3d_shader_spirv_extension { - VKD3D_SHADER_TARGET_EXTENSION_NONE, + VKD3D_SHADER_SPIRV_EXTENSION_NONE, + VKD3D_SHADER_SPIRV_EXTENSION_EXT_DEMOTE_TO_HELPER_INVOCATION,
- VKD3D_SHADER_TARGET_EXTENSION_SPV_EXT_DEMOTE_TO_HELPER_INVOCATION, + VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_SPIRV_EXTENSION), };
struct vkd3d_shader_spirv_target_info @@ -241,11 +242,11 @@ struct vkd3d_shader_spirv_target_info
enum vkd3d_shader_spirv_environment environment;
- unsigned int target_extension_count; - const enum vkd3d_shader_target_extension *target_extensions; + const enum vkd3d_shader_spirv_extension *extensions; + unsigned int extension_count;
- unsigned int parameter_count; const struct vkd3d_shader_parameter *parameters; + unsigned int parameter_count;
bool dual_source_blending; const unsigned int *output_swizzles; diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index bcc208a..3f6d526 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -2197,14 +2197,14 @@ static bool vkd3d_dxbc_compiler_is_opengl_target(const struct vkd3d_dxbc_compile }
static bool vkd3d_dxbc_compiler_is_target_extension_supported(const struct vkd3d_dxbc_compiler *compiler, - enum vkd3d_shader_target_extension extension) + enum vkd3d_shader_spirv_extension extension) { const struct vkd3d_shader_spirv_target_info *info = compiler->spirv_target_info; unsigned int i;
- for (i = 0; info && i < info->target_extension_count; ++i) + for (i = 0; info && i < info->extension_count; ++i) { - if (info->target_extensions[i] == extension) + if (info->extensions[i] == extension) return true; }
@@ -6660,7 +6660,7 @@ static void vkd3d_dxbc_compiler_emit_kill(struct vkd3d_dxbc_compiler *compiler, vkd3d_spirv_build_op_label(builder, target_id);
if (vkd3d_dxbc_compiler_is_target_extension_supported(compiler, - VKD3D_SHADER_TARGET_EXTENSION_SPV_EXT_DEMOTE_TO_HELPER_INVOCATION)) + VKD3D_SHADER_SPIRV_EXTENSION_EXT_DEMOTE_TO_HELPER_INVOCATION)) { vkd3d_spirv_enable_capability(builder, SpvCapabilityDemoteToHelperInvocationEXT); vkd3d_spirv_build_op_demote_to_helper_invocation(builder); diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 843f327..437454d 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -1447,7 +1447,7 @@ static HRESULT vkd3d_init_device_caps(struct d3d12_device *device, if (vulkan_info->EXT_shader_demote_to_helper_invocation) { vulkan_info->shader_extension_count = 1; - vulkan_info->shader_extensions[0] = VKD3D_SHADER_TARGET_EXTENSION_SPV_EXT_DEMOTE_TO_HELPER_INVOCATION; + vulkan_info->shader_extensions[0] = VKD3D_SHADER_SPIRV_EXTENSION_EXT_DEMOTE_TO_HELPER_INVOCATION; }
/* Disable unused Vulkan features. */ diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index 84cdbe8..7b14198 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -2167,8 +2167,8 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s ps_target_info.type = VKD3D_SHADER_STRUCTURE_TYPE_SPIRV_TARGET_INFO; ps_target_info.next = NULL; ps_target_info.environment = VKD3D_SHADER_SPIRV_ENVIRONMENT_VULKAN_1_0; - ps_target_info.target_extensions = vk_info->shader_extensions; - ps_target_info.target_extension_count = vk_info->shader_extension_count; + ps_target_info.extensions = vk_info->shader_extensions; + ps_target_info.extension_count = vk_info->shader_extension_count; ps_target_info.parameters = ps_shader_parameters; ps_target_info.parameter_count = ARRAY_SIZE(ps_shader_parameters); ps_target_info.dual_source_blending = is_dual_source_blending(&desc->BlendState.RenderTarget[0]); diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index bfdc7b4..d7da7f1 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -122,7 +122,7 @@ struct vkd3d_vulkan_info VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT texel_buffer_alignment_properties;
unsigned int shader_extension_count; - enum vkd3d_shader_target_extension shader_extensions[VKD3D_MAX_SHADER_EXTENSIONS]; + enum vkd3d_shader_spirv_extension shader_extensions[VKD3D_MAX_SHADER_EXTENSIONS];
D3D_FEATURE_LEVEL max_feature_level; };