diff --git a/gfx/d3d/d3d_wrapper.cpp b/gfx/d3d/d3d_wrapper.cpp index 5f0ad3cd56..de09498e3a 100644 --- a/gfx/d3d/d3d_wrapper.cpp +++ b/gfx/d3d/d3d_wrapper.cpp @@ -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); } diff --git a/gfx/d3d/d3d_wrapper.h b/gfx/d3d/d3d_wrapper.h index 6274cc7fee..ea0cb23412 100644 --- a/gfx/d3d/d3d_wrapper.h +++ b/gfx/d3d/d3d_wrapper.h @@ -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); diff --git a/gfx/d3d/render_chain.cpp b/gfx/d3d/render_chain.cpp index effbd78f37..9a6dadc05d 100644 --- a/gfx/d3d/render_chain.cpp +++ b/gfx/d3d/render_chain.cpp @@ -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); } diff --git a/gfx/d3d/render_chain_xdk.h b/gfx/d3d/render_chain_xdk.h index 67d0f87917..b600bc4916 100644 --- a/gfx/d3d/render_chain_xdk.h +++ b/gfx/d3d/render_chain_xdk.h @@ -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); }