mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 13:20:30 +00:00
(D3D) Create d3d_vertex_buffer_unlock
This commit is contained in:
parent
548c04bd1b
commit
22dd54e1f5
@ -1024,7 +1024,7 @@ static bool texture_image_render(void *data,
|
||||
|
||||
/* copy the new verts over the old verts */
|
||||
memcpy(verts, newVerts, sizeof(newVerts));
|
||||
out_img->vertex_buf->Unlock();
|
||||
d3d_vertex_buffer_unlock(out_img->vertex_buf);
|
||||
|
||||
d3d->dev->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
|
||||
d3d->dev->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
|
||||
@ -1284,7 +1284,7 @@ static void d3d_overlay_render(void *data, overlay_t *overlay)
|
||||
|
||||
overlay->vert_buf->Lock(0, sizeof(vert), &verts, 0);
|
||||
memcpy(verts, vert, sizeof(vert));
|
||||
overlay->vert_buf->Unlock();
|
||||
d3d_vertex_buffer_unlock(overlay->vert_buf);
|
||||
|
||||
// enable alpha
|
||||
d3d->dev->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
|
||||
|
@ -104,6 +104,20 @@ LPDIRECT3DVERTEXBUFFER d3d_vertex_buffer_new(LPDIRECT3DDEVICE dev,
|
||||
return buf;
|
||||
}
|
||||
|
||||
void d3d_vertex_buffer_unlock(LPDIRECT3DVERTEXBUFFER vertbuf)
|
||||
{
|
||||
/* This is a stub on Xbox 1, see docs. */
|
||||
#ifndef _XBOX1
|
||||
|
||||
#ifdef _XBOX360
|
||||
D3DVertexBuffer_Unlock(vertbuf);
|
||||
#else
|
||||
vertbuf->Unlock();
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void *d3d_vertex_buffer_lock(LPDIRECT3DVERTEXBUFFER vertbuf)
|
||||
{
|
||||
#ifdef _XBOX1
|
||||
|
@ -27,6 +27,7 @@ LPDIRECT3DVERTEXBUFFER d3d_vertex_buffer_new(LPDIRECT3DDEVICE dev,
|
||||
D3DPOOL pool, void *handle);
|
||||
|
||||
void *d3d_vertex_buffer_lock(LPDIRECT3DVERTEXBUFFER vertbuf);
|
||||
void d3d_vertex_buffer_unlock(LPDIRECT3DVERTEXBUFFER vertbuf);
|
||||
|
||||
void d3d_vertex_buffer_free(LPDIRECT3DVERTEXBUFFER buf);
|
||||
|
||||
|
@ -457,7 +457,7 @@ void renderchain_set_vertices(void *data, Pass *pass,
|
||||
|
||||
void *verts = d3d_vertex_buffer_lock(pass->vertex_buf);
|
||||
memcpy(verts, vert, sizeof(vert));
|
||||
pass->vertex_buf->Unlock();
|
||||
d3d_vertex_buffer_unlock(pass->vertex_buf);
|
||||
}
|
||||
|
||||
renderchain_set_mvp(chain, pass->vPrg, vp_width, vp_height, rotation);
|
||||
|
@ -206,7 +206,7 @@ static void renderchain_set_vertices(void *data, unsigned pass, unsigned width,
|
||||
|
||||
void *verts = d3d_vertex_buffer_lock(d3d->vertex_buf);
|
||||
memcpy(verts, vert, sizeof(vert));
|
||||
RD3DVertexBuffer_Unlock(d3d->vertex_buf);
|
||||
d3d_vertex_buffer_unlock(d3d->vertex_buf);
|
||||
}
|
||||
|
||||
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
|
||||
|
@ -23,16 +23,11 @@
|
||||
|
||||
#define RD3DDevice_SetTransform(device, State, pMatrix) D3DDevice_SetTransform(State, pMatrix)
|
||||
|
||||
#define RD3DVertexBuffer_Lock(device, OffsetToLock, SizeToLock, ppbData, Flags) *ppbData = D3DVertexBuffer_Lock2(device, Flags) + OffsetToLock
|
||||
#define RD3DVertexBuffer_Unlock(device)
|
||||
#define RD3DDevice_Clear(device, Count, pRects, Flags, Color, Z, Stencil) D3DDevice_Clear(Count, pRects, Flags, Color, Z, Stencil)
|
||||
|
||||
#elif defined(_XBOX360)
|
||||
/* XBox 360*/
|
||||
|
||||
#define RD3DVertexBuffer_Lock(device, OffsetToLock, SizeToLock, ppbData, Flags) *ppbData = D3DVertexBuffer_Lock(device, OffsetToLock, SizeToLock, Flags)
|
||||
#define RD3DVertexBuffer_Unlock(device) D3DVertexBuffer_Unlock(device)
|
||||
|
||||
#define RD3DDevice_Clear(device, Count, pRects, Flags, Color, Z, Stencil) D3DDevice_Clear(device, Count, pRects, Flags, Color, Z, Stencil, false)
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user