mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-23 16:09:47 +00:00
(gfx display) blend_begin/blend_end - no more dependency on
video_frame_info
This commit is contained in:
parent
809e22ec1a
commit
591bb36e03
@ -31,8 +31,8 @@ static const float *gfx_display_ctr_get_default_vertices(void) { return NULL; }
|
||||
static const float *gfx_display_ctr_get_default_tex_coords(void) { return NULL; }
|
||||
static void *gfx_display_ctr_get_default_mvp(void *data) { return NULL; }
|
||||
|
||||
static void gfx_display_ctr_blend_begin(video_frame_info_t *video_info) { }
|
||||
static void gfx_display_ctr_blend_end(video_frame_info_t *video_info) { }
|
||||
static void gfx_display_ctr_blend_begin(void *data) { }
|
||||
static void gfx_display_ctr_blend_end(void *data) { }
|
||||
static void gfx_display_ctr_viewport(gfx_display_ctx_draw_t *draw,
|
||||
void *data) { }
|
||||
|
||||
|
@ -43,16 +43,16 @@ static void* gfx_display_d3d10_get_default_mvp(void *data)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void gfx_display_d3d10_blend_begin(video_frame_info_t *video_info)
|
||||
static void gfx_display_d3d10_blend_begin(void *data)
|
||||
{
|
||||
d3d10_video_t* d3d10 = (d3d10_video_t*)video_info->userdata;
|
||||
d3d10_video_t* d3d10 = (d3d10_video_t*)data;
|
||||
D3D10SetBlendState(d3d10->device,
|
||||
d3d10->blend_enable, NULL, D3D10_DEFAULT_SAMPLE_MASK);
|
||||
}
|
||||
|
||||
static void gfx_display_d3d10_blend_end(video_frame_info_t *video_info)
|
||||
static void gfx_display_d3d10_blend_end(void *data)
|
||||
{
|
||||
d3d10_video_t* d3d10 = (d3d10_video_t*)video_info->userdata;
|
||||
d3d10_video_t* d3d10 = (d3d10_video_t*)data;
|
||||
D3D10SetBlendState(d3d10->device,
|
||||
d3d10->blend_disable, NULL, D3D10_DEFAULT_SAMPLE_MASK);
|
||||
}
|
||||
|
@ -42,16 +42,16 @@ static void* gfx_display_d3d11_get_default_mvp(void *data)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void gfx_display_d3d11_blend_begin(video_frame_info_t *video_info)
|
||||
static void gfx_display_d3d11_blend_begin(void *data)
|
||||
{
|
||||
d3d11_video_t* d3d11 = (d3d11_video_t*)video_info->userdata;
|
||||
d3d11_video_t* d3d11 = (d3d11_video_t*)data;
|
||||
D3D11SetBlendState(d3d11->context,
|
||||
d3d11->blend_enable, NULL, D3D11_DEFAULT_SAMPLE_MASK);
|
||||
}
|
||||
|
||||
static void gfx_display_d3d11_blend_end(video_frame_info_t *video_info)
|
||||
static void gfx_display_d3d11_blend_end(void *data)
|
||||
{
|
||||
d3d11_video_t* d3d11 = (d3d11_video_t*)video_info->userdata;
|
||||
d3d11_video_t* d3d11 = (d3d11_video_t*)data;
|
||||
D3D11SetBlendState(d3d11->context,
|
||||
d3d11->blend_disable, NULL, D3D11_DEFAULT_SAMPLE_MASK);
|
||||
}
|
||||
|
@ -42,17 +42,17 @@ static void* gfx_display_d3d12_get_default_mvp(void *data)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void gfx_display_d3d12_blend_begin(video_frame_info_t *video_info)
|
||||
static void gfx_display_d3d12_blend_begin(void *data)
|
||||
{
|
||||
d3d12_video_t* d3d12 = (d3d12_video_t*)video_info->userdata;
|
||||
d3d12_video_t* d3d12 = (d3d12_video_t*)data;
|
||||
|
||||
d3d12->sprites.pipe = d3d12->sprites.pipe_blend;
|
||||
D3D12SetPipelineState(d3d12->queue.cmd, d3d12->sprites.pipe);
|
||||
}
|
||||
|
||||
static void gfx_display_d3d12_blend_end(video_frame_info_t *video_info)
|
||||
static void gfx_display_d3d12_blend_end(void *data)
|
||||
{
|
||||
d3d12_video_t* d3d12 = (d3d12_video_t*)video_info->userdata;
|
||||
d3d12_video_t* d3d12 = (d3d12_video_t*)data;
|
||||
|
||||
d3d12->sprites.pipe = d3d12->sprites.pipe_noblend;
|
||||
D3D12SetPipelineState(d3d12->queue.cmd, d3d12->sprites.pipe);
|
||||
|
@ -78,9 +78,9 @@ static INT32 gfx_display_prim_to_d3d8_enum(
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void gfx_display_d3d8_blend_begin(video_frame_info_t *video_info)
|
||||
static void gfx_display_d3d8_blend_begin(void *data)
|
||||
{
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)video_info->userdata;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
|
||||
if (!d3d)
|
||||
return;
|
||||
@ -88,9 +88,9 @@ static void gfx_display_d3d8_blend_begin(video_frame_info_t *video_info)
|
||||
d3d8_enable_blend_func(d3d->dev);
|
||||
}
|
||||
|
||||
static void gfx_display_d3d8_blend_end(video_frame_info_t *video_info)
|
||||
static void gfx_display_d3d8_blend_end(void *data)
|
||||
{
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)video_info->userdata;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
|
||||
if (!d3d)
|
||||
return;
|
||||
|
@ -78,9 +78,9 @@ static INT32 gfx_display_prim_to_d3d9_enum(
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void gfx_display_d3d9_blend_begin(video_frame_info_t *video_info)
|
||||
static void gfx_display_d3d9_blend_begin(void *data)
|
||||
{
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)video_info->userdata;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
|
||||
if (!d3d)
|
||||
return;
|
||||
@ -88,9 +88,9 @@ static void gfx_display_d3d9_blend_begin(video_frame_info_t *video_info)
|
||||
d3d9_enable_blend_func(d3d->dev);
|
||||
}
|
||||
|
||||
static void gfx_display_d3d9_blend_end(video_frame_info_t *video_info)
|
||||
static void gfx_display_d3d9_blend_end(void *data)
|
||||
{
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)video_info->userdata;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
|
||||
if (!d3d)
|
||||
return;
|
||||
|
@ -33,8 +33,8 @@
|
||||
#endif
|
||||
|
||||
static void *gfx_display_gdi_get_default_mvp(void *data) { return NULL; }
|
||||
static void gfx_display_gdi_blend_begin(video_frame_info_t *video_info) { }
|
||||
static void gfx_display_gdi_blend_end(video_frame_info_t *video_info) { }
|
||||
static void gfx_display_gdi_blend_begin(void *data) { }
|
||||
static void gfx_display_gdi_blend_end(void *data) { }
|
||||
|
||||
static void gfx_display_gdi_draw(gfx_display_ctx_draw_t *draw,
|
||||
video_frame_info_t *video_info)
|
||||
|
@ -118,9 +118,9 @@ static GLenum gfx_display_prim_to_gl_enum(
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void gfx_display_gl_blend_begin(video_frame_info_t *video_info)
|
||||
static void gfx_display_gl_blend_begin(void *data)
|
||||
{
|
||||
gl_t *gl = (gl_t*)video_info->userdata;
|
||||
gl_t *gl = (gl_t*)data;
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
@ -129,7 +129,7 @@ static void gfx_display_gl_blend_begin(video_frame_info_t *video_info)
|
||||
true);
|
||||
}
|
||||
|
||||
static void gfx_display_gl_blend_end(video_frame_info_t *video_info)
|
||||
static void gfx_display_gl_blend_end(void *data)
|
||||
{
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
|
@ -81,13 +81,13 @@ static GLenum gfx_display_prim_to_gl1_enum(
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void gfx_display_gl1_blend_begin(video_frame_info_t *video_info)
|
||||
static void gfx_display_gl1_blend_begin(void *data)
|
||||
{
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
|
||||
static void gfx_display_gl1_blend_end(video_frame_info_t *video_info)
|
||||
static void gfx_display_gl1_blend_end(void *data)
|
||||
{
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
|
@ -301,16 +301,16 @@ static void gfx_display_gl_core_clear_color(
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
}
|
||||
|
||||
static void gfx_display_gl_core_blend_begin(video_frame_info_t *video_info)
|
||||
static void gfx_display_gl_core_blend_begin(void *data)
|
||||
{
|
||||
gl_core_t *gl = (gl_core_t*)video_info->userdata;
|
||||
gl_core_t *gl = (gl_core_t*)data;
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glUseProgram(gl->pipelines.alpha_blend);
|
||||
}
|
||||
|
||||
static void gfx_display_gl_core_blend_end(video_frame_info_t *video_info)
|
||||
static void gfx_display_gl_core_blend_end(void *data)
|
||||
{
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
|
@ -44,18 +44,18 @@ static void *gfx_display_metal_get_default_mvp(void *data)
|
||||
return (void *)&md.viewportMVP->projectionMatrix;
|
||||
}
|
||||
|
||||
static void gfx_display_metal_blend_begin(video_frame_info_t *video_info)
|
||||
static void gfx_display_metal_blend_begin(void *data)
|
||||
{
|
||||
MetalDriver *md = (__bridge MetalDriver *)video_info->userdata;
|
||||
MetalDriver *md = (__bridge MetalDriver *)data;
|
||||
if (!md)
|
||||
return;
|
||||
|
||||
md.display.blend = YES;
|
||||
}
|
||||
|
||||
static void gfx_display_metal_blend_end(video_frame_info_t *video_info)
|
||||
static void gfx_display_metal_blend_end(void *data)
|
||||
{
|
||||
MetalDriver *md = (__bridge MetalDriver *)video_info->userdata;
|
||||
MetalDriver *md = (__bridge MetalDriver *)data;
|
||||
if (!md)
|
||||
return;
|
||||
|
||||
|
@ -27,13 +27,8 @@ static void *gfx_display_switch_get_default_mvp(void *data)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void gfx_display_switch_blend_begin(video_frame_info_t *video_info)
|
||||
{
|
||||
}
|
||||
|
||||
static void gfx_display_switch_blend_end(video_frame_info_t *video_info)
|
||||
{
|
||||
}
|
||||
static void gfx_display_switch_blend_begin(void *data) { }
|
||||
static void gfx_display_switch_blend_end(void *data) { }
|
||||
|
||||
static void gfx_display_switch_draw(gfx_display_ctx_draw_t *draw,
|
||||
video_frame_info_t *video_info)
|
||||
|
@ -74,15 +74,8 @@ static void *gfx_display_vita2d_get_default_mvp(void *data)
|
||||
return &vita2d->mvp_no_rot;
|
||||
}
|
||||
|
||||
static void gfx_display_vita2d_blend_begin(video_frame_info_t *video_info)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void gfx_display_vita2d_blend_end(video_frame_info_t *video_info)
|
||||
{
|
||||
|
||||
}
|
||||
static void gfx_display_vita2d_blend_begin(void *data) { }
|
||||
static void gfx_display_vita2d_blend_end(void *data) { }
|
||||
|
||||
static void gfx_display_vita2d_viewport(gfx_display_ctx_draw_t *draw,
|
||||
void *data)
|
||||
|
@ -325,17 +325,17 @@ static void gfx_display_vk_clear_color(
|
||||
vkCmdClearAttachments(vk->cmd, 1, &attachment, 1, &rect);
|
||||
}
|
||||
|
||||
static void gfx_display_vk_blend_begin(video_frame_info_t *video_info)
|
||||
static void gfx_display_vk_blend_begin(void *data)
|
||||
{
|
||||
vk_t *vk = (vk_t*)video_info->userdata;
|
||||
vk_t *vk = (vk_t*)data;
|
||||
|
||||
if (vk)
|
||||
vk->display.blend = true;
|
||||
}
|
||||
|
||||
static void gfx_display_vk_blend_end(video_frame_info_t *video_info)
|
||||
static void gfx_display_vk_blend_end(void *data)
|
||||
{
|
||||
vk_t *vk = (vk_t*)video_info->userdata;
|
||||
vk_t *vk = (vk_t*)data;
|
||||
|
||||
if (vk)
|
||||
vk->display.blend = false;
|
||||
|
@ -43,15 +43,8 @@ static void *gfx_display_wiiu_get_default_mvp(void *data)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void gfx_display_wiiu_blend_begin(video_frame_info_t *video_info)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void gfx_display_wiiu_blend_end(video_frame_info_t *video_info)
|
||||
{
|
||||
|
||||
}
|
||||
static void gfx_display_wiiu_blend_begin(void *data) { }
|
||||
static void gfx_display_wiiu_blend_end(void *data) { }
|
||||
|
||||
static void gfx_display_wiiu_viewport(gfx_display_ctx_draw_t *draw, void *data) { }
|
||||
|
||||
|
@ -77,8 +77,8 @@ static gfx_display_t *disp_get_ptr(void)
|
||||
}
|
||||
|
||||
static void *gfx_display_null_get_default_mvp(void *data) { return NULL; }
|
||||
static void gfx_display_null_blend_begin(video_frame_info_t *video_info) { }
|
||||
static void gfx_display_null_blend_end(video_frame_info_t *video_info) { }
|
||||
static void gfx_display_null_blend_begin(void *data) { }
|
||||
static void gfx_display_null_blend_end(void *data) { }
|
||||
static void gfx_display_null_draw(gfx_display_ctx_draw_t *draw,
|
||||
video_frame_info_t *video_info) { }
|
||||
static void gfx_display_null_draw_pipeline(gfx_display_ctx_draw_t *draw,
|
||||
@ -634,14 +634,14 @@ void gfx_display_coords_array_reset(void)
|
||||
void gfx_display_blend_begin(video_frame_info_t *video_info)
|
||||
{
|
||||
if (dispctx && dispctx->blend_begin)
|
||||
dispctx->blend_begin(video_info);
|
||||
dispctx->blend_begin(video_info->userdata);
|
||||
}
|
||||
|
||||
/* End blending operation */
|
||||
void gfx_display_blend_end(video_frame_info_t *video_info)
|
||||
{
|
||||
if (dispctx && dispctx->blend_end)
|
||||
dispctx->blend_end(video_info);
|
||||
dispctx->blend_end(video_info->userdata);
|
||||
}
|
||||
|
||||
/* Begin scissoring operation */
|
||||
@ -749,9 +749,9 @@ void gfx_display_draw_blend(gfx_display_ctx_draw_t *draw,
|
||||
return;
|
||||
if (draw->width <= 0)
|
||||
return;
|
||||
gfx_display_blend_begin(video_info);
|
||||
gfx_display_blend_begin(video_info->userdata);
|
||||
dispctx->draw(draw, video_info);
|
||||
gfx_display_blend_end(video_info);
|
||||
gfx_display_blend_end(video_info->userdata);
|
||||
}
|
||||
|
||||
void gfx_display_draw_pipeline(gfx_display_ctx_draw_t *draw,
|
||||
@ -831,7 +831,7 @@ void gfx_display_draw_quad(
|
||||
coords.color = color;
|
||||
|
||||
if (dispctx && dispctx->blend_begin)
|
||||
dispctx->blend_begin(video_info);
|
||||
dispctx->blend_begin(video_info->userdata);
|
||||
|
||||
draw.x = x;
|
||||
draw.y = (int)height - y - (int)h;
|
||||
@ -848,7 +848,7 @@ void gfx_display_draw_quad(
|
||||
gfx_display_draw(&draw, video_info);
|
||||
|
||||
if (dispctx && dispctx->blend_end)
|
||||
dispctx->blend_end(video_info);
|
||||
dispctx->blend_end(video_info->userdata);
|
||||
}
|
||||
|
||||
void gfx_display_draw_polygon(
|
||||
@ -881,7 +881,7 @@ void gfx_display_draw_polygon(
|
||||
coords.color = color;
|
||||
|
||||
if (dispctx && dispctx->blend_begin)
|
||||
dispctx->blend_begin(video_info);
|
||||
dispctx->blend_begin(video_info->userdata);
|
||||
|
||||
draw.x = 0;
|
||||
draw.y = 0;
|
||||
@ -898,7 +898,7 @@ void gfx_display_draw_polygon(
|
||||
gfx_display_draw(&draw, video_info);
|
||||
|
||||
if (dispctx && dispctx->blend_end)
|
||||
dispctx->blend_end(video_info);
|
||||
dispctx->blend_end(video_info->userdata);
|
||||
}
|
||||
|
||||
void gfx_display_draw_texture(
|
||||
@ -1276,7 +1276,7 @@ void gfx_display_draw_cursor(
|
||||
coords.color = (const float*)color;
|
||||
|
||||
if (dispctx && dispctx->blend_begin)
|
||||
dispctx->blend_begin(video_info);
|
||||
dispctx->blend_begin(video_info->userdata);
|
||||
|
||||
draw.x = x - (cursor_size / 2);
|
||||
draw.y = (int)height - y - (cursor_size / 2);
|
||||
@ -1291,7 +1291,7 @@ void gfx_display_draw_cursor(
|
||||
gfx_display_draw(&draw, video_info);
|
||||
|
||||
if (dispctx && dispctx->blend_end)
|
||||
dispctx->blend_end(video_info);
|
||||
dispctx->blend_end(video_info->userdata);
|
||||
}
|
||||
|
||||
void gfx_display_push_quad(
|
||||
@ -1598,7 +1598,7 @@ void gfx_display_draw_keyboard(
|
||||
|
||||
if (i == id)
|
||||
{
|
||||
gfx_display_blend_begin(video_info);
|
||||
gfx_display_blend_begin(video_info->userdata);
|
||||
|
||||
gfx_display_draw_texture(
|
||||
video_info,
|
||||
@ -1609,7 +1609,7 @@ void gfx_display_draw_keyboard(
|
||||
&white[0],
|
||||
hover_texture);
|
||||
|
||||
gfx_display_blend_end(video_info);
|
||||
gfx_display_blend_end(video_info->userdata);
|
||||
|
||||
color = text_color;
|
||||
}
|
||||
|
@ -111,9 +111,9 @@ typedef struct gfx_display_ctx_driver
|
||||
video_frame_info_t *video_info);
|
||||
void (*viewport)(gfx_display_ctx_draw_t *draw, void *data);
|
||||
/* Start blending operation. */
|
||||
void (*blend_begin)(video_frame_info_t *video_info);
|
||||
void (*blend_begin)(void *data);
|
||||
/* Finish blending operation. */
|
||||
void (*blend_end)(video_frame_info_t *video_info);
|
||||
void (*blend_end)(void *data);
|
||||
/* Set the clear color back to its default values. */
|
||||
void (*restore_clear_color)(void);
|
||||
/* Set the color to be used when clearing the screen */
|
||||
|
Loading…
Reference in New Issue
Block a user