From 91f9b5713fab80d50a8e6e60aae2e1c87abb674b Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 5 Apr 2015 23:30:38 +0200 Subject: [PATCH] (D3D) Make renderchain_blit_to_texture static --- gfx/d3d/render_chain.cpp | 38 ++++++++++++++++++++------------------ gfx/d3d/render_chain.h | 4 ---- gfx/d3d/render_chain_xdk.h | 2 +- 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/gfx/d3d/render_chain.cpp b/gfx/d3d/render_chain.cpp index ff9b92e3b3..340c31c8aa 100644 --- a/gfx/d3d/render_chain.cpp +++ b/gfx/d3d/render_chain.cpp @@ -1261,6 +1261,26 @@ static void renderchain_set_viewport(void *data, void *viewport_data) d3d_set_viewport(d3dr, vp); } +static void renderchain_blit_to_texture(void *data, + const void *frame, + unsigned width, unsigned height, + unsigned pitch) +{ + D3DLOCKED_RECT d3dlr; + renderchain_t *chain = (renderchain_t*)data; + Pass *first = (Pass*)&chain->passes[0]; + driver_t *driver = driver_get_ptr(); + + if (first->last_width != width || first->last_height != height) + { + d3d_lockrectangle_clear(first, first->tex, 0, &d3dlr, + NULL, first->info.tex_h, D3DLOCK_NOSYSLOCK); + } + + d3d_texture_blit(driver->video_data, chain->pixel_size, first->tex, + &d3dlr, frame, width, height, pitch); +} + bool renderchain_render(void *chain_data, const void *data, unsigned width, unsigned height, unsigned pitch, unsigned rotation) { @@ -1397,24 +1417,6 @@ void renderchain_convert_geometry( } } -void renderchain_blit_to_texture(void *data, const void *frame, - unsigned width, unsigned height, - unsigned pitch) -{ - D3DLOCKED_RECT d3dlr; - renderchain_t *chain = (renderchain_t*)data; - Pass *first = (Pass*)&chain->passes[0]; - driver_t *driver = driver_get_ptr(); - - if (first->last_width != width || first->last_height != height) - { - d3d_lockrectangle_clear(first, first->tex, 0, &d3dlr, - NULL, first->info.tex_h, D3DLOCK_NOSYSLOCK); - } - - d3d_texture_blit(driver->video_data, chain->pixel_size, first->tex, - &d3dlr, frame, width, height, pitch); -} static void renderchain_unbind_all(void *data) { diff --git a/gfx/d3d/render_chain.h b/gfx/d3d/render_chain.h index e3b13559a8..0b87b499c1 100644 --- a/gfx/d3d/render_chain.h +++ b/gfx/d3d/render_chain.h @@ -72,10 +72,6 @@ void renderchain_convert_geometry(void *data, const void *info_data, unsigned width, unsigned height, D3DVIEWPORT *final_viewport); -void renderchain_blit_to_texture(void *data, const void *frame, - unsigned width, unsigned height, - unsigned pitch); - void renderchain_render_pass(void *data, void *pass_data, unsigned pass_index); bool renderchain_init_shader_fvf(void *data, void *pass_data); diff --git a/gfx/d3d/render_chain_xdk.h b/gfx/d3d/render_chain_xdk.h index 771eb80735..3e71487226 100644 --- a/gfx/d3d/render_chain_xdk.h +++ b/gfx/d3d/render_chain_xdk.h @@ -264,7 +264,7 @@ static void renderchain_set_vertices(void *data, unsigned pass, #endif } -void renderchain_blit_to_texture(void *data, const void *frame, +static void renderchain_blit_to_texture(void *data, const void *frame, unsigned width, unsigned height, unsigned pitch) { D3DLOCKED_RECT d3dlr;