wined3d: Introduce wined3d_context_vk_reference_resource().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2021-01-19 14:34:56 +01:00 committed by Alexandre Julliard
parent 4ce1d7f93a
commit e2e776462d
1 changed files with 12 additions and 18 deletions

View File

@ -6043,6 +6043,15 @@ 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_resource(const struct wined3d_context_vk *context_vk,
struct wined3d_resource *resource)
{
if (resource->type == WINED3D_RTYPE_BUFFER)
wined3d_context_vk_reference_bo(context_vk, &wined3d_buffer_vk(buffer_from_resource(resource))->bo);
else
wined3d_context_vk_reference_texture(context_vk, wined3d_texture_vk(texture_from_resource(resource)));
}
static inline void wined3d_context_vk_reference_query(const struct wined3d_context_vk *context_vk,
struct wined3d_query_vk *query_vk)
{
@ -6058,36 +6067,21 @@ static inline void wined3d_context_vk_reference_sampler(const struct wined3d_con
static inline void wined3d_context_vk_reference_rendertarget_view(const struct wined3d_context_vk *context_vk,
struct wined3d_rendertarget_view_vk *rtv_vk)
{
struct wined3d_resource *resource = rtv_vk->v.resource;
if (resource->type == WINED3D_RTYPE_BUFFER)
wined3d_context_vk_reference_bo(context_vk, &wined3d_buffer_vk(buffer_from_resource(resource))->bo);
else
wined3d_context_vk_reference_texture(context_vk, wined3d_texture_vk(texture_from_resource(resource)));
wined3d_context_vk_reference_resource(context_vk, rtv_vk->v.resource);
rtv_vk->command_buffer_id = context_vk->current_command_buffer.id;
}
static inline void wined3d_context_vk_reference_shader_resource_view(const struct wined3d_context_vk *context_vk,
struct wined3d_shader_resource_view_vk *srv_vk)
{
struct wined3d_resource *resource = srv_vk->v.resource;
if (resource->type == WINED3D_RTYPE_BUFFER)
wined3d_context_vk_reference_bo(context_vk, &wined3d_buffer_vk(buffer_from_resource(resource))->bo);
else
wined3d_context_vk_reference_texture(context_vk, wined3d_texture_vk(texture_from_resource(resource)));
wined3d_context_vk_reference_resource(context_vk, srv_vk->v.resource);
srv_vk->view_vk.command_buffer_id = context_vk->current_command_buffer.id;
}
static inline void wined3d_context_vk_reference_unordered_access_view(const struct wined3d_context_vk *context_vk,
struct wined3d_unordered_access_view_vk *uav_vk)
{
struct wined3d_resource *resource = uav_vk->v.resource;
if (resource->type == WINED3D_RTYPE_BUFFER)
wined3d_context_vk_reference_bo(context_vk, &wined3d_buffer_vk(buffer_from_resource(resource))->bo);
else
wined3d_context_vk_reference_texture(context_vk, wined3d_texture_vk(texture_from_resource(resource)));
wined3d_context_vk_reference_resource(context_vk, uav_vk->v.resource);
uav_vk->view_vk.command_buffer_id = context_vk->current_command_buffer.id;
}