mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 08:43:10 +00:00
(D3D) Refactors pt. 2
This commit is contained in:
parent
bf196212f3
commit
8b9d08e8ee
@ -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,
|
LPDIRECT3DTEXTURE tex, D3DLOCKED_RECT *lr, const void *frame,
|
||||||
unsigned width, unsigned height, unsigned pitch)
|
unsigned width, unsigned height, unsigned pitch)
|
||||||
{
|
{
|
||||||
@ -345,18 +345,13 @@ void d3d_texture_blit(void *data, void *renderchain_data,
|
|||||||
#endif
|
#endif
|
||||||
D3DTexture_UnlockRect(tex, 0);
|
D3DTexture_UnlockRect(tex, 0);
|
||||||
#else
|
#else
|
||||||
renderchain_t *chain = (renderchain_t*)renderchain_data;
|
|
||||||
|
|
||||||
if (!chain)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (SUCCEEDED(tex->LockRect(0, lr, NULL, D3DLOCK_NOSYSLOCK)))
|
if (SUCCEEDED(tex->LockRect(0, lr, NULL, D3DLOCK_NOSYSLOCK)))
|
||||||
{
|
{
|
||||||
for (y = 0; y < height; y++)
|
for (y = 0; y < height; y++)
|
||||||
{
|
{
|
||||||
const uint8_t *in = (const uint8_t*)frame + y * pitch;
|
const uint8_t *in = (const uint8_t*)frame + y * pitch;
|
||||||
uint8_t *out = (uint8_t*)lr->pBits + y * lr->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);
|
tex->UnlockRect(0);
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ void d3d_set_texture(LPDIRECT3DDEVICE dev, unsigned sampler,
|
|||||||
HRESULT d3d_set_vertex_shader(LPDIRECT3DDEVICE dev, unsigned index,
|
HRESULT d3d_set_vertex_shader(LPDIRECT3DDEVICE dev, unsigned index,
|
||||||
void *data);
|
void *data);
|
||||||
|
|
||||||
void d3d_texture_blit(void *data, void *renderchain_data,
|
void d3d_texture_blit(void *data, unsigned pixel_size,
|
||||||
LPDIRECT3DTEXTURE tex,
|
LPDIRECT3DTEXTURE tex,
|
||||||
D3DLOCKED_RECT *lr, const void *frame,
|
D3DLOCKED_RECT *lr, const void *frame,
|
||||||
unsigned width, unsigned height, unsigned pitch);
|
unsigned width, unsigned height, unsigned pitch);
|
||||||
|
@ -637,7 +637,7 @@ void renderchain_blit_to_texture(void *data, const void *frame,
|
|||||||
NULL, D3DLOCK_NOSYSLOCK);
|
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);
|
&d3dlr, frame, width, height, pitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,7 +230,7 @@ static void renderchain_blit_to_texture(void *data, const void *frame,
|
|||||||
0, &d3dlr, NULL, D3DLOCK_NOSYSLOCK);
|
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);
|
&d3dlr, frame, width, height, pitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user