From c4989fbf6b750e381c10e2f3ccf31a13442a3fa8 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 8 Jun 2014 03:02:02 +0200 Subject: [PATCH] (D3D) Renderchain_clear_texture can go into blit_texture function now --- gfx/d3d9/render_chain.cpp | 12 ++++-------- gfx/d3d9/render_chain.hpp | 1 - xdk/xdk_d3d.cpp | 15 ++++----------- 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/gfx/d3d9/render_chain.cpp b/gfx/d3d9/render_chain.cpp index 2b890c844b..675543f4eb 100644 --- a/gfx/d3d9/render_chain.cpp +++ b/gfx/d3d9/render_chain.cpp @@ -477,12 +477,6 @@ void renderchain_set_mvp(void *data, CGprogram &vPrg, renderchain_set_shader_mvp(chain, vPrg, tmp); } -void renderchain_clear_texture(void *data, Pass &pass) -{ - D3DLOCKED_RECT d3dlr; - D3DTexture_LockRectClear(pass, pass.tex, 0, d3dlr, NULL, D3DLOCK_NOSYSLOCK); -} - void renderchain_convert_geometry(void *data, const LinkInfo *info, unsigned &out_width, unsigned &out_height, unsigned width, unsigned height, @@ -524,12 +518,14 @@ 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 = chain->passes[0]; if (first.last_width != width || first.last_height != height) - renderchain_clear_texture(chain, first); + { + D3DTexture_LockRectClear(first, first.tex, 0, d3dlr, NULL, D3DLOCK_NOSYSLOCK); + } - D3DLOCKED_RECT d3dlr; #ifdef _XBOX360 D3DSURFACE_DESC desc; D3DTexture_LockRect(first.tex, 0, &d3dlr, NULL, D3DLOCK_NOSYSLOCK); diff --git a/gfx/d3d9/render_chain.hpp b/gfx/d3d9/render_chain.hpp index 9f2eaf2923..cebd66404a 100644 --- a/gfx/d3d9/render_chain.hpp +++ b/gfx/d3d9/render_chain.hpp @@ -131,7 +131,6 @@ void renderchain_set_viewport(void *data, D3DVIEWPORT *vp); void renderchain_set_mvp(void *data, CGprogram &vPrg, unsigned vp_width, unsigned vp_height, unsigned rotation); -void renderchain_clear_texture(void *data, Pass &pass); void renderchain_convert_geometry(void *data, const LinkInfo *info, unsigned &out_width, unsigned &out_height, unsigned width, unsigned height, diff --git a/xdk/xdk_d3d.cpp b/xdk/xdk_d3d.cpp index 9a904e0cd3..25ccfb31c2 100644 --- a/xdk/xdk_d3d.cpp +++ b/xdk/xdk_d3d.cpp @@ -512,24 +512,17 @@ static void d3d_draw_texture(void *data) } #endif -static void clear_texture(void *data) -{ - d3d_video_t *d3d = (d3d_video_t*)data; - LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev; - D3DLOCKED_RECT d3dlr; - - D3DTexture_LockRectClear(d3d, d3d->tex, 0, d3dlr, NULL, D3DLOCK_NOSYSLOCK); -} - static void blit_to_texture(void *data, const void *frame, unsigned width, unsigned height, unsigned pitch) { + D3DLOCKED_RECT d3dlr; d3d_video_t *d3d = (d3d_video_t*)data; if (d3d->last_width != width || d3d->last_height != height) - clear_texture(data); + { + D3DTexture_LockRectClear(d3d, d3d->tex, 0, d3dlr, NULL, D3DLOCK_NOSYSLOCK); + } - D3DLOCKED_RECT d3dlr; D3DTexture_LockRect(d3d->tex, 0, &d3dlr, NULL, D3DLOCK_NOSYSLOCK); #if defined(_XBOX360)