mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
(Vulkan) Implement scissoring for Vulkan
This commit is contained in:
parent
b108dafa3e
commit
624ffc98c1
@ -257,7 +257,7 @@ static void menu_display_gl_scissor_begin(video_frame_info_t *video_info, int x,
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
}
|
||||
|
||||
static void menu_display_gl_scissor_end()
|
||||
static void menu_display_gl_scissor_end(void)
|
||||
{
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
}
|
||||
|
@ -346,6 +346,25 @@ static bool menu_display_vk_font_init_first(
|
||||
return false;
|
||||
}
|
||||
|
||||
static void menu_display_vk_scissor_begin(video_frame_info_t *video_info,
|
||||
int x, int y, unsigned width, unsigned height)
|
||||
{
|
||||
VkRect2D sci;
|
||||
vk_t *vk = video_info ? (vk_t*)video_info->userdata : NULL;
|
||||
|
||||
sci.offset.x = x;
|
||||
sci.offset.y = video_info->height - y - height;
|
||||
sci.extent.width = width;
|
||||
sci.extent.height = height;
|
||||
|
||||
vkCmdSetScissor (vk->cmd, 0, 1, &sci);
|
||||
}
|
||||
|
||||
static void menu_display_vk_scissor_end(void)
|
||||
{
|
||||
/* Can remain a stub for Vulkan */
|
||||
}
|
||||
|
||||
menu_display_ctx_driver_t menu_display_ctx_vulkan = {
|
||||
menu_display_vk_draw,
|
||||
menu_display_vk_draw_pipeline,
|
||||
@ -361,6 +380,6 @@ menu_display_ctx_driver_t menu_display_ctx_vulkan = {
|
||||
MENU_VIDEO_DRIVER_VULKAN,
|
||||
"menu_display_vulkan",
|
||||
false,
|
||||
NULL,
|
||||
NULL
|
||||
menu_display_vk_scissor_begin,
|
||||
menu_display_vk_scissor_end
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user