mirror of
https://github.com/libretro/RetroArch
synced 2025-03-23 19:21:03 +00:00
Go through function pointers for vkMapMemory/vkUnmapMemory
This commit is contained in:
parent
28d5ca6a86
commit
fc7a972466
@ -414,7 +414,7 @@ struct vk_texture vulkan_create_texture(vk_t *vk,
|
||||
unsigned bpp = vulkan_format_to_bpp(tex.format);
|
||||
unsigned stride = tex.width * bpp;
|
||||
|
||||
vkMapMemory(device, tex.memory, tex.offset, tex.size, 0, &ptr);
|
||||
VKFUNC(vkMapMemory)(device, tex.memory, tex.offset, tex.size, 0, &ptr);
|
||||
|
||||
dst = (uint8_t*)ptr;
|
||||
src = (const uint8_t*)initial;
|
||||
@ -763,7 +763,9 @@ void vulkan_image_layout_transition(
|
||||
1, &barrier);
|
||||
}
|
||||
|
||||
struct vk_buffer vulkan_create_buffer(const struct vulkan_context *context,
|
||||
struct vk_buffer vulkan_create_buffer(
|
||||
struct vulkan_context_fp *vkcfp,
|
||||
const struct vulkan_context *context,
|
||||
size_t size, VkBufferUsageFlags usage)
|
||||
{
|
||||
struct vk_buffer buffer;
|
||||
@ -789,7 +791,7 @@ struct vk_buffer vulkan_create_buffer(const struct vulkan_context *context,
|
||||
|
||||
buffer.size = alloc.allocationSize;
|
||||
|
||||
vkMapMemory(context->device,
|
||||
VKFUNC(vkMapMemory)(context->device,
|
||||
buffer.memory, 0, buffer.size, 0, &buffer.mapped);
|
||||
return buffer;
|
||||
}
|
||||
@ -938,7 +940,9 @@ static struct vk_buffer_node *vulkan_buffer_chain_alloc_node(
|
||||
if (!node)
|
||||
return NULL;
|
||||
|
||||
node->buffer = vulkan_create_buffer(context, size, usage);
|
||||
node->buffer = vulkan_create_buffer(
|
||||
(struct vulkan_context_fp*)&context->fp,
|
||||
context, size, usage);
|
||||
return node;
|
||||
}
|
||||
|
||||
|
@ -606,7 +606,9 @@ static INLINE void vulkan_write_quad_vbo(struct vk_vertex *pv,
|
||||
}
|
||||
}
|
||||
|
||||
struct vk_buffer vulkan_create_buffer(const struct vulkan_context *context,
|
||||
struct vk_buffer vulkan_create_buffer(
|
||||
struct vulkan_context_fp *vkcfp,
|
||||
const struct vulkan_context *context,
|
||||
size_t size, VkBufferUsageFlags usage);
|
||||
|
||||
void vulkan_destroy_buffer(
|
||||
|
@ -1833,7 +1833,7 @@ static void vulkan_set_texture_frame(void *data,
|
||||
NULL, rgb32 ? NULL : &br_swizzle,
|
||||
texture_optimal->memory ? VULKAN_TEXTURE_STAGING : VULKAN_TEXTURE_STREAMED);
|
||||
|
||||
vkMapMemory(vk->context->device, texture->memory,
|
||||
VKFUNC(vkMapMemory)(vk->context->device, texture->memory,
|
||||
texture->offset, texture->size, 0, (void**)&ptr);
|
||||
|
||||
dst = ptr;
|
||||
@ -1843,7 +1843,7 @@ static void vulkan_set_texture_frame(void *data,
|
||||
for (y = 0; y < height; y++, dst += texture->stride, src += stride)
|
||||
memcpy(dst, src, stride);
|
||||
|
||||
vkUnmapMemory(vk->context->device, texture->memory);
|
||||
VKFUNC(vkUnmapMemory)(vk->context->device, texture->memory);
|
||||
|
||||
vk->menu.alpha = alpha;
|
||||
vk->menu.last_index = index;
|
||||
@ -1992,14 +1992,14 @@ static bool vulkan_read_viewport(void *data, uint8_t *buffer)
|
||||
retro_perf_start(&stream_readback);
|
||||
|
||||
buffer += 3 * (vk->vp.height - 1) * vk->vp.width;
|
||||
vkMapMemory(vk->context->device, staging->memory,
|
||||
VKFUNC(vkMapMemory)(vk->context->device, staging->memory,
|
||||
staging->offset, staging->size, 0, (void**)&src);
|
||||
|
||||
vk->readback.scaler.in_stride = staging->stride;
|
||||
vk->readback.scaler.out_stride = -(int)vk->vp.width * 3;
|
||||
scaler_ctx_scale(&vk->readback.scaler, buffer, src);
|
||||
|
||||
vkUnmapMemory(vk->context->device, staging->memory);
|
||||
VKFUNC(vkUnmapMemory)(vk->context->device, staging->memory);
|
||||
|
||||
retro_perf_stop(&stream_readback);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user