(D3D) Refactors pt. 2

This commit is contained in:
twinaphex 2015-04-05 04:59:35 +02:00
parent bf196212f3
commit 8b9d08e8ee
4 changed files with 5 additions and 10 deletions

View File

@ -315,7 +315,7 @@ HRESULT d3d_set_vertex_shader(LPDIRECT3DDEVICE dev, unsigned index,
}
void d3d_texture_blit(void *data, void *renderchain_data,
void d3d_texture_blit(void *data, unsigned pixel_size,
LPDIRECT3DTEXTURE tex, D3DLOCKED_RECT *lr, const void *frame,
unsigned width, unsigned height, unsigned pitch)
{
@ -345,18 +345,13 @@ void d3d_texture_blit(void *data, void *renderchain_data,
#endif
D3DTexture_UnlockRect(tex, 0);
#else
renderchain_t *chain = (renderchain_t*)renderchain_data;
if (!chain)
return;
if (SUCCEEDED(tex->LockRect(0, lr, NULL, D3DLOCK_NOSYSLOCK)))
{
for (y = 0; y < height; y++)
{
const uint8_t *in = (const uint8_t*)frame + y * pitch;
uint8_t *out = (uint8_t*)lr->pBits + y * lr->Pitch;
memcpy(out, in, width * chain->pixel_size);
memcpy(out, in, width * pixel_size);
}
tex->UnlockRect(0);
}

View File

@ -77,7 +77,7 @@ void d3d_set_texture(LPDIRECT3DDEVICE dev, unsigned sampler,
HRESULT d3d_set_vertex_shader(LPDIRECT3DDEVICE dev, unsigned index,
void *data);
void d3d_texture_blit(void *data, void *renderchain_data,
void d3d_texture_blit(void *data, unsigned pixel_size,
LPDIRECT3DTEXTURE tex,
D3DLOCKED_RECT *lr, const void *frame,
unsigned width, unsigned height, unsigned pitch);

View File

@ -637,7 +637,7 @@ void renderchain_blit_to_texture(void *data, const void *frame,
NULL, D3DLOCK_NOSYSLOCK);
}
d3d_texture_blit(driver->video_data, chain, first->tex,
d3d_texture_blit(driver->video_data, chain->pixel_size, first->tex,
&d3dlr, frame, width, height, pitch);
}

View File

@ -230,7 +230,7 @@ static void renderchain_blit_to_texture(void *data, const void *frame,
0, &d3dlr, NULL, D3DLOCK_NOSYSLOCK);
}
d3d_texture_blit(driver->video_data, NULL, d3d->tex,
d3d_texture_blit(driver->video_data, 0, d3d->tex,
&d3dlr, frame, width, height, pitch);
}