diff --git a/dlls/wined3d/context_vk.c b/dlls/wined3d/context_vk.c index 4e4e0642505..ba1f6bb9261 100644 --- a/dlls/wined3d/context_vk.c +++ b/dlls/wined3d/context_vk.c @@ -1335,6 +1335,7 @@ static bool wined3d_context_vk_update_descriptors(struct wined3d_context_vk *con struct wined3d_resource *resource; VkDescriptorSet vk_descriptor_set; struct wined3d_view_vk *view_vk; + struct wined3d_sampler *sampler; struct wined3d_buffer *buffer; VkBufferView *buffer_view; VkDescriptorType type; @@ -1400,6 +1401,14 @@ static bool wined3d_context_vk_update_descriptors(struct wined3d_context_vk *con return false; break; + case WINED3D_SHADER_DESCRIPTOR_TYPE_SAMPLER: + if (!(sampler = state->sampler[binding->shader_type][binding->resource_idx])) + sampler = context_vk->c.device->null_sampler; + if (!wined3d_shader_descriptor_writes_vk_add_write(writes, vk_descriptor_set, binding->binding_idx, + VK_DESCRIPTOR_TYPE_SAMPLER, NULL, &wined3d_sampler_vk(sampler)->vk_image_info, NULL)) + return false; + break; + default: FIXME("Unhandled descriptor type %#x.\n", binding->shader_descriptor_type); return false; @@ -1506,6 +1515,7 @@ static void wined3d_context_vk_load_shader_resources(struct wined3d_context_vk * struct wined3d_shader_resource_view_vk *srv_vk; struct wined3d_shader_resource_view *srv; struct wined3d_buffer_vk *buffer_vk; + struct wined3d_sampler *sampler; struct wined3d_buffer *buffer; size_t i; @@ -1551,6 +1561,12 @@ static void wined3d_context_vk_load_shader_resources(struct wined3d_context_vk * case WINED3D_SHADER_DESCRIPTOR_TYPE_UAV_COUNTER: break; + case WINED3D_SHADER_DESCRIPTOR_TYPE_SAMPLER: + if (!(sampler = state->sampler[binding->shader_type][binding->resource_idx])) + sampler = context_vk->c.device->null_sampler; + wined3d_context_vk_reference_sampler(context_vk, wined3d_sampler_vk(sampler)); + break; + default: FIXME("Unhandled descriptor type %#x.\n", binding->shader_descriptor_type); break; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 35b0815d959..93852e0de79 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -5662,6 +5662,12 @@ static inline void wined3d_context_vk_reference_texture(const struct wined3d_con texture_vk->command_buffer_id = context_vk->current_command_buffer.id; } +static inline void wined3d_context_vk_reference_sampler(const struct wined3d_context_vk *context_vk, + struct wined3d_sampler_vk *sampler_vk) +{ + sampler_vk->command_buffer_id = context_vk->current_command_buffer.id; +} + static inline void wined3d_context_vk_reference_rendertarget_view(const struct wined3d_context_vk *context_vk, struct wined3d_rendertarget_view_vk *rtv_vk) {