mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
(D3D) Get rid of Texture Blit macros
This commit is contained in:
parent
11372a7a9f
commit
fa0261c1d6
@ -67,18 +67,6 @@
|
||||
tex->UnlockRect(0); \
|
||||
}
|
||||
#define D3DDevice_CreateVertexBuffers(device, Length, Usage, UnusedFVF, UnusedPool, ppVertexBuffer, pUnusedSharedHandle) device->CreateVertexBuffer(Length, Usage, UnusedFVF, UnusedPool, ppVertexBuffer, NULL)
|
||||
|
||||
#define D3DTexture_Blit(d3d, desc, d3dlr, frame, width, height, pitch) \
|
||||
if (SUCCEEDED(first.tex->LockRect(0, &d3dlr, NULL, D3DLOCK_NOSYSLOCK))) \
|
||||
{ \
|
||||
for (unsigned y = 0; y < height; y++) \
|
||||
{ \
|
||||
const uint8_t *in = (const uint8_t*)frame + y * pitch; \
|
||||
uint8_t *out = (uint8_t*)d3dlr.pBits + y * d3dlr.Pitch; \
|
||||
memcpy(out, in, width * d3d->pixel_size); \
|
||||
} \
|
||||
first.tex->UnlockRect(0); \
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
|
@ -200,7 +200,7 @@ HRESULT d3d_set_vertex_shader(LPDIRECT3DDEVICE dev, unsigned index,
|
||||
}
|
||||
|
||||
|
||||
void d3d_textureblit(void *data, void *renderchain_data,
|
||||
void d3d_texture_blit(void *data, void *renderchain_data,
|
||||
LPDIRECT3DTEXTURE tex, D3DSURFACE_DESC desc,
|
||||
D3DLOCKED_RECT lr, const void *frame,
|
||||
unsigned width, unsigned height, unsigned pitch)
|
||||
|
@ -56,7 +56,7 @@ void d3d_set_texture(LPDIRECT3DDEVICE dev, unsigned sampler,
|
||||
HRESULT d3d_set_vertex_shader(LPDIRECT3DDEVICE dev, unsigned index,
|
||||
void *data);
|
||||
|
||||
void d3d_textureblit(void *data,
|
||||
void d3d_texture_blit(void *data,
|
||||
LPDIRECT3DTEXTURE tex, D3DSURFACE_DESC desc,
|
||||
D3DLOCKED_RECT lr, const void *frame,
|
||||
unsigned width, unsigned height, unsigned pitch);
|
||||
|
@ -541,7 +541,7 @@ void renderchain_blit_to_texture(void *data, const void *frame,
|
||||
NULL, D3DLOCK_NOSYSLOCK);
|
||||
}
|
||||
|
||||
D3DTexture_Blit(chain, desc, d3dlr, frame, width, height, pitch);
|
||||
d3d_texture_blit(chain, desc, d3dlr, frame, width, height, pitch);
|
||||
}
|
||||
|
||||
void renderchain_render_pass(void *data, Pass &pass, unsigned pass_index)
|
||||
|
@ -5,20 +5,6 @@ static void renderchain_blit_to_texture(void *data, const void *frame,
|
||||
static void renderchain_set_mvp(void *data, unsigned vp_width, unsigned vp_height, unsigned rotation);
|
||||
static void renderchain_set_vertices(void *data, unsigned pass, unsigned width, unsigned height);
|
||||
|
||||
#if defined(_XBOX360)
|
||||
#define D3DTexture_Blit(d3d, desc, d3dlr, frame, width, height, pitch) \
|
||||
d3d->tex->GetLevelDesc(0, &desc); \
|
||||
XGCopySurface(d3dlr.pBits, d3dlr.Pitch, width, height, desc.Format, NULL, frame, pitch, desc.Format, NULL, 0, 0)
|
||||
#else
|
||||
#define D3DTexture_Blit(d3d, desc, d3dlr, frame, width, height, pitch) \
|
||||
for (unsigned y = 0; y < height; y++) \
|
||||
{ \
|
||||
const uint8_t *in = (const uint8_t*)frame + y * pitch; \
|
||||
uint8_t *out = (uint8_t*)d3dlr.pBits + y * d3dlr.Pitch; \
|
||||
memcpy(out, in, width * d3d->pixel_size); \
|
||||
}
|
||||
#endif
|
||||
|
||||
static void renderchain_clear(void *data)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
@ -285,5 +271,5 @@ static void renderchain_blit_to_texture(void *data, const void *frame,
|
||||
}
|
||||
|
||||
D3DTexture_LockRect(d3d->tex, 0, &d3dlr, NULL, D3DLOCK_NOSYSLOCK);
|
||||
D3DTexture_Blit(d3d, desc, d3dlr, frame, width, height, pitch);
|
||||
d3d_texture_blit(d3d, desc, d3dlr, frame, width, height, pitch);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user