mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
Implement scissoring for d2d12
This commit is contained in:
parent
04b2ffcb9e
commit
0f3fcdd311
@ -295,6 +295,40 @@ static bool menu_display_d3d12_font_init_first(
|
||||
return true;
|
||||
}
|
||||
|
||||
void menu_display_d3d12_scissor_begin(video_frame_info_t *video_info, int x, int y, unsigned width, unsigned height)
|
||||
{
|
||||
D3D12_RECT rect = {0};
|
||||
d3d12_video_t *d3d12 = video_info ?
|
||||
(d3d12_video_t*)video_info->userdata : NULL;
|
||||
|
||||
rect.left = x;
|
||||
rect.top = y;
|
||||
rect.right = width + x;
|
||||
rect.bottom = height + y;
|
||||
|
||||
if (!d3d12 || !width || !height)
|
||||
return;
|
||||
|
||||
D3D12RSSetScissorRects(d3d12->queue.cmd, 1, &rect);
|
||||
}
|
||||
|
||||
void menu_display_d3d12_scissor_end(video_frame_info_t *video_info)
|
||||
{
|
||||
D3D12_RECT rect = {0};
|
||||
d3d12_video_t *d3d12 = video_info ?
|
||||
(d3d12_video_t*)video_info->userdata : NULL;
|
||||
|
||||
if (!d3d12)
|
||||
return;
|
||||
|
||||
rect.left = d3d12->vp.x;
|
||||
rect.top = d3d12->vp.y;
|
||||
rect.right = d3d12->vp.width;
|
||||
rect.bottom = d3d12->vp.height;
|
||||
|
||||
D3D12RSSetScissorRects(d3d12->queue.cmd, 1, &rect);
|
||||
}
|
||||
|
||||
menu_display_ctx_driver_t menu_display_ctx_d3d12 = {
|
||||
menu_display_d3d12_draw,
|
||||
menu_display_d3d12_draw_pipeline,
|
||||
@ -310,6 +344,6 @@ menu_display_ctx_driver_t menu_display_ctx_d3d12 = {
|
||||
MENU_VIDEO_DRIVER_DIRECT3D12,
|
||||
"d3d12",
|
||||
true,
|
||||
NULL,
|
||||
NULL
|
||||
menu_display_d3d12_scissor_begin,
|
||||
menu_display_d3d12_scissor_end
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user