wined3d: Remove the buffer fvf.
This commit is contained in:
parent
77e6dcca02
commit
f0efa97413
|
@ -737,7 +737,9 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexBuffer(LPDIRECT3DDEVICE8
|
||||||
object->lpVtbl = &Direct3DVertexBuffer8_Vtbl;
|
object->lpVtbl = &Direct3DVertexBuffer8_Vtbl;
|
||||||
object->ref = 1;
|
object->ref = 1;
|
||||||
EnterCriticalSection(&d3d8_cs);
|
EnterCriticalSection(&d3d8_cs);
|
||||||
hrc = IWineD3DDevice_CreateVertexBuffer(This->WineD3DDevice, Size, Usage & WINED3DUSAGE_MASK, FVF, (WINED3DPOOL) Pool, &(object->wineD3DVertexBuffer), NULL, (IUnknown *)object);
|
hrc = IWineD3DDevice_CreateVertexBuffer(This->WineD3DDevice, Size, Usage & WINED3DUSAGE_MASK,
|
||||||
|
0 /* fvf for ddraw only */, (WINED3DPOOL) Pool, &(object->wineD3DVertexBuffer), NULL,
|
||||||
|
(IUnknown *)object);
|
||||||
LeaveCriticalSection(&d3d8_cs);
|
LeaveCriticalSection(&d3d8_cs);
|
||||||
object->fvf = FVF;
|
object->fvf = FVF;
|
||||||
|
|
||||||
|
@ -1662,10 +1664,11 @@ static HRESULT WINAPI IDirect3DDevice8Impl_DrawIndexedPrimitiveUP(LPDIRECT3DDEVI
|
||||||
static HRESULT WINAPI IDirect3DDevice8Impl_ProcessVertices(LPDIRECT3DDEVICE8 iface, UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer8* pDestBuffer,DWORD Flags) {
|
static HRESULT WINAPI IDirect3DDevice8Impl_ProcessVertices(LPDIRECT3DDEVICE8 iface, UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer8* pDestBuffer,DWORD Flags) {
|
||||||
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
|
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
IDirect3DVertexBuffer8Impl *dest = (IDirect3DVertexBuffer8Impl *) pDestBuffer;
|
||||||
TRACE("(%p) Relay\n" , This);
|
TRACE("(%p) Relay\n" , This);
|
||||||
|
|
||||||
EnterCriticalSection(&d3d8_cs);
|
EnterCriticalSection(&d3d8_cs);
|
||||||
hr = IWineD3DDevice_ProcessVertices(This->WineD3DDevice,SrcStartIndex, DestIndex, VertexCount, ((IDirect3DVertexBuffer8Impl *)pDestBuffer)->wineD3DVertexBuffer, NULL, Flags);
|
hr = IWineD3DDevice_ProcessVertices(This->WineD3DDevice,SrcStartIndex, DestIndex, VertexCount, dest->wineD3DVertexBuffer, NULL, Flags, dest->fvf);
|
||||||
LeaveCriticalSection(&d3d8_cs);
|
LeaveCriticalSection(&d3d8_cs);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1449,10 +1449,11 @@ static HRESULT WINAPI IDirect3DDevice9Impl_ProcessVertices(LPDIRECT3DDEVICE9EX
|
||||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||||
IDirect3DVertexDeclaration9Impl *Decl = (IDirect3DVertexDeclaration9Impl *) pVertexDecl;
|
IDirect3DVertexDeclaration9Impl *Decl = (IDirect3DVertexDeclaration9Impl *) pVertexDecl;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
IDirect3DVertexBuffer9Impl *dest = (IDirect3DVertexBuffer9Impl *) pDestBuffer;
|
||||||
TRACE("(%p) Relay\n" , This);
|
TRACE("(%p) Relay\n" , This);
|
||||||
|
|
||||||
EnterCriticalSection(&d3d9_cs);
|
EnterCriticalSection(&d3d9_cs);
|
||||||
hr = IWineD3DDevice_ProcessVertices(This->WineD3DDevice,SrcStartIndex, DestIndex, VertexCount, ((IDirect3DVertexBuffer9Impl *)pDestBuffer)->wineD3DVertexBuffer, Decl ? Decl->wineD3DVertexDeclaration : NULL, Flags);
|
hr = IWineD3DDevice_ProcessVertices(This->WineD3DDevice,SrcStartIndex, DestIndex, VertexCount, dest->wineD3DVertexBuffer, Decl ? Decl->wineD3DVertexDeclaration : NULL, Flags, dest->fvf);
|
||||||
LeaveCriticalSection(&d3d9_cs);
|
LeaveCriticalSection(&d3d9_cs);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -247,7 +247,9 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexBuffer(LPDIRECT3DDEVICE9EX iface
|
||||||
object->ref = 1;
|
object->ref = 1;
|
||||||
object->fvf = FVF;
|
object->fvf = FVF;
|
||||||
EnterCriticalSection(&d3d9_cs);
|
EnterCriticalSection(&d3d9_cs);
|
||||||
hrc = IWineD3DDevice_CreateVertexBuffer(This->WineD3DDevice, Size, Usage & WINED3DUSAGE_MASK, FVF, (WINED3DPOOL) Pool, &(object->wineD3DVertexBuffer), pSharedHandle, (IUnknown *)object);
|
hrc = IWineD3DDevice_CreateVertexBuffer(This->WineD3DDevice, Size, Usage & WINED3DUSAGE_MASK,
|
||||||
|
0 /* fvf for ddraw only */, (WINED3DPOOL) Pool, &(object->wineD3DVertexBuffer),
|
||||||
|
pSharedHandle, (IUnknown *)object);
|
||||||
LeaveCriticalSection(&d3d9_cs);
|
LeaveCriticalSection(&d3d9_cs);
|
||||||
|
|
||||||
if (hrc != D3D_OK) {
|
if (hrc != D3D_OK) {
|
||||||
|
|
|
@ -384,7 +384,8 @@ IDirect3DVertexBufferImpl_ProcessVertices(IDirect3DVertexBuffer7 *iface,
|
||||||
Count,
|
Count,
|
||||||
This->wineD3DVertexBuffer,
|
This->wineD3DVertexBuffer,
|
||||||
NULL /* Output vdecl */,
|
NULL /* Output vdecl */,
|
||||||
Flags);
|
Flags,
|
||||||
|
This->fvf);
|
||||||
|
|
||||||
/* Restore the states if needed */
|
/* Restore the states if needed */
|
||||||
if(doClip != oldClip)
|
if(doClip != oldClip)
|
||||||
|
|
|
@ -317,11 +317,15 @@ static BOOL buffer_find_decl(struct wined3d_buffer *This)
|
||||||
* processing, FLOAT4 POSITIONT with fixed function, and FLOAT16 if
|
* processing, FLOAT4 POSITIONT with fixed function, and FLOAT16 if
|
||||||
* GL_NV_half_float is not supported.
|
* GL_NV_half_float is not supported.
|
||||||
*
|
*
|
||||||
|
* Note for d3d8 and d3d9:
|
||||||
* The vertex buffer FVF doesn't help with finding them, we have to use
|
* The vertex buffer FVF doesn't help with finding them, we have to use
|
||||||
* the decoded vertex declaration and pick the things that concern the
|
* the decoded vertex declaration and pick the things that concern the
|
||||||
* current buffer. A problem with this is that this can change between
|
* current buffer. A problem with this is that this can change between
|
||||||
* draws, so we have to validate the information and reprocess the buffer
|
* draws, so we have to validate the information and reprocess the buffer
|
||||||
* if it changes, and avoid false positives for performance reasons.
|
* if it changes, and avoid false positives for performance reasons.
|
||||||
|
* WineD3D doesn't even know the vertex buffer any more, it is managed
|
||||||
|
* by the client libraries and passed to SetStreamSource and ProcessVertices
|
||||||
|
* as needed.
|
||||||
*
|
*
|
||||||
* We have to distinguish between vertex shaders and fixed function to
|
* We have to distinguish between vertex shaders and fixed function to
|
||||||
* pick the way we access the strided vertex information.
|
* pick the way we access the strided vertex information.
|
||||||
|
@ -938,7 +942,6 @@ static HRESULT STDMETHODCALLTYPE buffer_GetDesc(IWineD3DBuffer *iface, WINED3DBU
|
||||||
desc->Usage = This->resource.usage;
|
desc->Usage = This->resource.usage;
|
||||||
desc->Pool = This->resource.pool;
|
desc->Pool = This->resource.pool;
|
||||||
desc->Size = This->resource.size;
|
desc->Size = This->resource.size;
|
||||||
desc->FVF = This->fvf;
|
|
||||||
|
|
||||||
return WINED3D_OK;
|
return WINED3D_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -552,8 +552,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexBuffer(IWineD3DDevice *ifac
|
||||||
TRACE("(%p) : Size=%d, Usage=0x%08x, FVF=%x, Pool=%d - Memory@%p, Iface@%p\n", This, Size, Usage, FVF, Pool, object->resource.allocatedMemory, object);
|
TRACE("(%p) : Size=%d, Usage=0x%08x, FVF=%x, Pool=%d - Memory@%p, Iface@%p\n", This, Size, Usage, FVF, Pool, object->resource.allocatedMemory, object);
|
||||||
*ppVertexBuffer = (IWineD3DBuffer *)object;
|
*ppVertexBuffer = (IWineD3DBuffer *)object;
|
||||||
|
|
||||||
object->fvf = FVF;
|
|
||||||
|
|
||||||
/* Observations show that drawStridedSlow is faster on dynamic VBs than converting +
|
/* Observations show that drawStridedSlow is faster on dynamic VBs than converting +
|
||||||
* drawStridedFast (half-life 2).
|
* drawStridedFast (half-life 2).
|
||||||
*
|
*
|
||||||
|
@ -4506,11 +4504,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetPixelShaderConstantF(
|
||||||
|
|
||||||
#define copy_and_next(dest, src, size) memcpy(dest, src, size); dest += (size)
|
#define copy_and_next(dest, src, size) memcpy(dest, src, size); dest += (size)
|
||||||
static HRESULT process_vertices_strided(IWineD3DDeviceImpl *This, DWORD dwDestIndex, DWORD dwCount,
|
static HRESULT process_vertices_strided(IWineD3DDeviceImpl *This, DWORD dwDestIndex, DWORD dwCount,
|
||||||
const struct wined3d_stream_info *stream_info, struct wined3d_buffer *dest, DWORD dwFlags)
|
const struct wined3d_stream_info *stream_info, struct wined3d_buffer *dest, DWORD dwFlags,
|
||||||
|
DWORD DestFVF)
|
||||||
{
|
{
|
||||||
char *dest_ptr, *dest_conv = NULL, *dest_conv_addr = NULL;
|
char *dest_ptr, *dest_conv = NULL, *dest_conv_addr = NULL;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
DWORD DestFVF = dest->fvf;
|
|
||||||
WINED3DVIEWPORT vp;
|
WINED3DVIEWPORT vp;
|
||||||
WINED3DMATRIX mat, proj_mat, view_mat, world_mat;
|
WINED3DMATRIX mat, proj_mat, view_mat, world_mat;
|
||||||
BOOL doClip;
|
BOOL doClip;
|
||||||
|
@ -4866,7 +4864,8 @@ static HRESULT process_vertices_strided(IWineD3DDeviceImpl *This, DWORD dwDestIn
|
||||||
#undef copy_and_next
|
#undef copy_and_next
|
||||||
|
|
||||||
static HRESULT WINAPI IWineD3DDeviceImpl_ProcessVertices(IWineD3DDevice *iface, UINT SrcStartIndex, UINT DestIndex,
|
static HRESULT WINAPI IWineD3DDeviceImpl_ProcessVertices(IWineD3DDevice *iface, UINT SrcStartIndex, UINT DestIndex,
|
||||||
UINT VertexCount, IWineD3DBuffer *pDestBuffer, IWineD3DVertexDeclaration *pVertexDecl, DWORD Flags)
|
UINT VertexCount, IWineD3DBuffer *pDestBuffer, IWineD3DVertexDeclaration *pVertexDecl, DWORD Flags,
|
||||||
|
DWORD DestFVF)
|
||||||
{
|
{
|
||||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||||
struct wined3d_stream_info stream_info;
|
struct wined3d_stream_info stream_info;
|
||||||
|
@ -4912,7 +4911,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ProcessVertices(IWineD3DDevice *iface,
|
||||||
}
|
}
|
||||||
|
|
||||||
return process_vertices_strided(This, DestIndex, VertexCount, &stream_info,
|
return process_vertices_strided(This, DestIndex, VertexCount, &stream_info,
|
||||||
(struct wined3d_buffer *)pDestBuffer, Flags);
|
(struct wined3d_buffer *)pDestBuffer, Flags, DestFVF);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****
|
/*****
|
||||||
|
|
|
@ -2095,9 +2095,6 @@ struct wined3d_buffer
|
||||||
UINT dirty_end;
|
UINT dirty_end;
|
||||||
LONG lock_count;
|
LONG lock_count;
|
||||||
|
|
||||||
/* legacy vertex buffers */
|
|
||||||
DWORD fvf;
|
|
||||||
|
|
||||||
/* conversion stuff */
|
/* conversion stuff */
|
||||||
UINT conversion_count;
|
UINT conversion_count;
|
||||||
UINT draw_count;
|
UINT draw_count;
|
||||||
|
|
|
@ -1869,7 +1869,6 @@ typedef struct _WINED3DBUFFER_DESC
|
||||||
DWORD Usage;
|
DWORD Usage;
|
||||||
WINED3DPOOL Pool;
|
WINED3DPOOL Pool;
|
||||||
UINT Size;
|
UINT Size;
|
||||||
DWORD FVF;
|
|
||||||
} WINED3DBUFFER_DESC;
|
} WINED3DBUFFER_DESC;
|
||||||
|
|
||||||
typedef struct glDescriptor
|
typedef struct glDescriptor
|
||||||
|
@ -3349,7 +3348,8 @@ interface IWineD3DDevice : IWineD3DBase
|
||||||
[in] UINT vertex_count,
|
[in] UINT vertex_count,
|
||||||
[in] IWineD3DBuffer *dest_buffer,
|
[in] IWineD3DBuffer *dest_buffer,
|
||||||
[in] IWineD3DVertexDeclaration *declaration,
|
[in] IWineD3DVertexDeclaration *declaration,
|
||||||
[in] DWORD flags
|
[in] DWORD flags,
|
||||||
|
[in] DWORD DestFVF
|
||||||
);
|
);
|
||||||
HRESULT BeginStateBlock(
|
HRESULT BeginStateBlock(
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue