mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-01 12:13:38 +00:00
wined3d: Tell vkd3d_shader about dual source blending.
Dual source blending implies an additional shader output, which needs to be declared. This improves WoT on high graphics settings on MoltenVK.
This commit is contained in:
parent
04c5aeadaf
commit
64effe6df7
|
@ -3422,6 +3422,8 @@ VkCommandBuffer wined3d_context_vk_apply_draw_state(struct wined3d_context_vk *c
|
|||
{
|
||||
struct wined3d_device_vk *device_vk = wined3d_device_vk(context_vk->c.device);
|
||||
const struct wined3d_vk_info *vk_info = context_vk->vk_info;
|
||||
const struct wined3d_blend_state *b = state->blend_state;
|
||||
bool dual_source_blend = b && b->dual_source;
|
||||
struct wined3d_rendertarget_view *dsv;
|
||||
struct wined3d_rendertarget_view *rtv;
|
||||
struct wined3d_buffer_vk *buffer_vk;
|
||||
|
@ -3433,8 +3435,12 @@ VkCommandBuffer wined3d_context_vk_apply_draw_state(struct wined3d_context_vk *c
|
|||
bool invalidate_ds = false;
|
||||
|
||||
if (wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL))
|
||||
|| wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_FRAMEBUFFER))
|
||||
|| wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_FRAMEBUFFER)
|
||||
|| dual_source_blend != context_vk->c.last_was_dual_source_blend)
|
||||
{
|
||||
context_vk->c.shader_update_mask |= (1u << WINED3D_SHADER_TYPE_PIXEL);
|
||||
context_vk->c.last_was_dual_source_blend = dual_source_blend;
|
||||
}
|
||||
if (wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_SHADER(WINED3D_SHADER_TYPE_VERTEX)))
|
||||
context_vk->c.shader_update_mask |= (1u << WINED3D_SHADER_TYPE_VERTEX);
|
||||
if (wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_SHADER(WINED3D_SHADER_TYPE_GEOMETRY)))
|
||||
|
|
|
@ -57,6 +57,7 @@ struct shader_spirv_compile_arguments
|
|||
{
|
||||
uint32_t alpha_swizzle;
|
||||
unsigned int sample_count;
|
||||
bool dual_source_blending;
|
||||
} fs;
|
||||
} u;
|
||||
};
|
||||
|
@ -147,6 +148,7 @@ static void shader_spirv_compile_arguments_init(struct shader_spirv_compile_argu
|
|||
args->u.fs.alpha_swizzle |= 1u << i;
|
||||
}
|
||||
args->u.fs.sample_count = sample_count;
|
||||
args->u.fs.dual_source_blending = state->blend_state && state->blend_state->dual_source;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -177,6 +179,8 @@ static void shader_spirv_init_compile_args(struct wined3d_shader_spirv_compile_a
|
|||
shader_parameter->data_type = VKD3D_SHADER_PARAMETER_DATA_TYPE_UINT32;
|
||||
shader_parameter->u.immediate_constant.u.u32 = compile_args->u.fs.sample_count;
|
||||
|
||||
args->spirv_target.dual_source_blending = compile_args->u.fs.dual_source_blending;
|
||||
|
||||
args->spirv_target.parameter_count = 1;
|
||||
args->spirv_target.parameters = shader_parameter;
|
||||
|
||||
|
|
Loading…
Reference in a new issue