mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
(Vulkan) vulkan_transition_texture - get rid of early return
This commit is contained in:
parent
3cad090b4c
commit
6f156d064e
@ -915,9 +915,6 @@ static void vulkan_write_quad_descriptors(
|
|||||||
|
|
||||||
void vulkan_transition_texture(vk_t *vk, VkCommandBuffer cmd, struct vk_texture *texture)
|
void vulkan_transition_texture(vk_t *vk, VkCommandBuffer cmd, struct vk_texture *texture)
|
||||||
{
|
{
|
||||||
if (!texture->image)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* Transition to GENERAL layout for linear streamed textures.
|
/* Transition to GENERAL layout for linear streamed textures.
|
||||||
* We're using linear textures here, so only
|
* We're using linear textures here, so only
|
||||||
* GENERAL layout is supported.
|
* GENERAL layout is supported.
|
||||||
@ -968,7 +965,7 @@ static void vulkan_check_dynamic_state(vk_t *vk)
|
|||||||
|
|
||||||
void vulkan_draw_triangles(vk_t *vk, const struct vk_draw_triangles *call)
|
void vulkan_draw_triangles(vk_t *vk, const struct vk_draw_triangles *call)
|
||||||
{
|
{
|
||||||
if (call->texture)
|
if (call->texture->image)
|
||||||
vulkan_transition_texture(vk, vk->cmd, call->texture);
|
vulkan_transition_texture(vk, vk->cmd, call->texture);
|
||||||
|
|
||||||
if (call->pipeline != vk->tracker.pipeline)
|
if (call->pipeline != vk->tracker.pipeline)
|
||||||
@ -1034,7 +1031,8 @@ void vulkan_draw_triangles(vk_t *vk, const struct vk_draw_triangles *call)
|
|||||||
|
|
||||||
void vulkan_draw_quad(vk_t *vk, const struct vk_draw_quad *quad)
|
void vulkan_draw_quad(vk_t *vk, const struct vk_draw_quad *quad)
|
||||||
{
|
{
|
||||||
vulkan_transition_texture(vk, vk->cmd, quad->texture);
|
if (quad->texture->image)
|
||||||
|
vulkan_transition_texture(vk, vk->cmd, quad->texture);
|
||||||
|
|
||||||
if (quad->pipeline != vk->tracker.pipeline)
|
if (quad->pipeline != vk->tracker.pipeline)
|
||||||
{
|
{
|
||||||
|
@ -2138,7 +2138,7 @@ static bool vulkan_frame(void *data, const void *frame,
|
|||||||
if (vk->swapchain[vk->last_valid_index].texture_optimal.memory
|
if (vk->swapchain[vk->last_valid_index].texture_optimal.memory
|
||||||
!= VK_NULL_HANDLE)
|
!= VK_NULL_HANDLE)
|
||||||
tex = &vk->swapchain[vk->last_valid_index].texture_optimal;
|
tex = &vk->swapchain[vk->last_valid_index].texture_optimal;
|
||||||
else
|
else if (tex->image)
|
||||||
vulkan_transition_texture(vk, vk->cmd, tex);
|
vulkan_transition_texture(vk, vk->cmd, tex);
|
||||||
|
|
||||||
input.image = tex->image;
|
input.image = tex->image;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user