(D3D) Renderchain_clear_texture can go into blit_texture

function now
This commit is contained in:
twinaphex 2014-06-08 03:02:02 +02:00
parent 48fc3d209a
commit c4989fbf6b
3 changed files with 8 additions and 20 deletions

View File

@ -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);

View File

@ -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,

View File

@ -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)