(D3D) Get rid of Texture Blit macros

This commit is contained in:
twinaphex 2014-09-12 20:13:27 +02:00
parent 11372a7a9f
commit fa0261c1d6
5 changed files with 4 additions and 30 deletions

View File

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

View File

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

View File

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

View File

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

View File

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