wined3d: Get rid of the WineDirect3DVertexStridedData typedef.
This commit is contained in:
parent
ada8ad76b9
commit
52231bc467
|
@ -3848,14 +3848,14 @@ IDirect3DDeviceImpl_7_DrawPrimitiveStrided(IDirect3DDevice7 *iface,
|
|||
DWORD Flags)
|
||||
{
|
||||
IDirect3DDeviceImpl *This = impl_from_IDirect3DDevice7(iface);
|
||||
WineDirect3DVertexStridedData WineD3DStrided;
|
||||
struct wined3d_strided_data wined3d_strided;
|
||||
DWORD i;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, primitive_type %#x, FVF %#x, strided_data %p, vertex_count %u, flags %#x.\n",
|
||||
iface, PrimitiveType, VertexType, D3DDrawPrimStrideData, VertexCount, Flags);
|
||||
|
||||
memset(&WineD3DStrided, 0, sizeof(WineD3DStrided));
|
||||
memset(&wined3d_strided, 0, sizeof(wined3d_strided));
|
||||
/* Get the strided data right. the wined3d structure is a bit bigger
|
||||
* Watch out: The contents of the strided data are determined by the fvf,
|
||||
* not by the members set in D3DDrawPrimStrideData. So it's valid
|
||||
|
@ -3864,57 +3864,60 @@ IDirect3DDeviceImpl_7_DrawPrimitiveStrided(IDirect3DDevice7 *iface,
|
|||
*/
|
||||
if(VertexType & D3DFVF_POSITION_MASK)
|
||||
{
|
||||
WineD3DStrided.position.format = WINED3DFMT_R32G32B32_FLOAT;
|
||||
WineD3DStrided.position.data = D3DDrawPrimStrideData->position.lpvData;
|
||||
WineD3DStrided.position.stride = D3DDrawPrimStrideData->position.dwStride;
|
||||
wined3d_strided.position.format = WINED3DFMT_R32G32B32_FLOAT;
|
||||
wined3d_strided.position.data = D3DDrawPrimStrideData->position.lpvData;
|
||||
wined3d_strided.position.stride = D3DDrawPrimStrideData->position.dwStride;
|
||||
if (VertexType & D3DFVF_XYZRHW)
|
||||
{
|
||||
WineD3DStrided.position.format = WINED3DFMT_R32G32B32A32_FLOAT;
|
||||
WineD3DStrided.position_transformed = TRUE;
|
||||
} else
|
||||
WineD3DStrided.position_transformed = FALSE;
|
||||
}
|
||||
|
||||
if(VertexType & D3DFVF_NORMAL)
|
||||
{
|
||||
WineD3DStrided.normal.format = WINED3DFMT_R32G32B32_FLOAT;
|
||||
WineD3DStrided.normal.data = D3DDrawPrimStrideData->normal.lpvData;
|
||||
WineD3DStrided.normal.stride = D3DDrawPrimStrideData->normal.dwStride;
|
||||
}
|
||||
|
||||
if(VertexType & D3DFVF_DIFFUSE)
|
||||
{
|
||||
WineD3DStrided.diffuse.format = WINED3DFMT_B8G8R8A8_UNORM;
|
||||
WineD3DStrided.diffuse.data = D3DDrawPrimStrideData->diffuse.lpvData;
|
||||
WineD3DStrided.diffuse.stride = D3DDrawPrimStrideData->diffuse.dwStride;
|
||||
}
|
||||
|
||||
if(VertexType & D3DFVF_SPECULAR)
|
||||
{
|
||||
WineD3DStrided.specular.format = WINED3DFMT_B8G8R8A8_UNORM;
|
||||
WineD3DStrided.specular.data = D3DDrawPrimStrideData->specular.lpvData;
|
||||
WineD3DStrided.specular.stride = D3DDrawPrimStrideData->specular.dwStride;
|
||||
}
|
||||
|
||||
for( i = 0; i < GET_TEXCOUNT_FROM_FVF(VertexType); i++)
|
||||
{
|
||||
switch(GET_TEXCOORD_SIZE_FROM_FVF(VertexType, i))
|
||||
wined3d_strided.position.format = WINED3DFMT_R32G32B32A32_FLOAT;
|
||||
wined3d_strided.position_transformed = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
case 1: WineD3DStrided.texCoords[i].format = WINED3DFMT_R32_FLOAT; break;
|
||||
case 2: WineD3DStrided.texCoords[i].format = WINED3DFMT_R32G32_FLOAT; break;
|
||||
case 3: WineD3DStrided.texCoords[i].format = WINED3DFMT_R32G32B32_FLOAT; break;
|
||||
case 4: WineD3DStrided.texCoords[i].format = WINED3DFMT_R32G32B32A32_FLOAT; break;
|
||||
wined3d_strided.position_transformed = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (VertexType & D3DFVF_NORMAL)
|
||||
{
|
||||
wined3d_strided.normal.format = WINED3DFMT_R32G32B32_FLOAT;
|
||||
wined3d_strided.normal.data = D3DDrawPrimStrideData->normal.lpvData;
|
||||
wined3d_strided.normal.stride = D3DDrawPrimStrideData->normal.dwStride;
|
||||
}
|
||||
|
||||
if (VertexType & D3DFVF_DIFFUSE)
|
||||
{
|
||||
wined3d_strided.diffuse.format = WINED3DFMT_B8G8R8A8_UNORM;
|
||||
wined3d_strided.diffuse.data = D3DDrawPrimStrideData->diffuse.lpvData;
|
||||
wined3d_strided.diffuse.stride = D3DDrawPrimStrideData->diffuse.dwStride;
|
||||
}
|
||||
|
||||
if (VertexType & D3DFVF_SPECULAR)
|
||||
{
|
||||
wined3d_strided.specular.format = WINED3DFMT_B8G8R8A8_UNORM;
|
||||
wined3d_strided.specular.data = D3DDrawPrimStrideData->specular.lpvData;
|
||||
wined3d_strided.specular.stride = D3DDrawPrimStrideData->specular.dwStride;
|
||||
}
|
||||
|
||||
for (i = 0; i < GET_TEXCOUNT_FROM_FVF(VertexType); ++i)
|
||||
{
|
||||
switch (GET_TEXCOORD_SIZE_FROM_FVF(VertexType, i))
|
||||
{
|
||||
case 1: wined3d_strided.tex_coords[i].format = WINED3DFMT_R32_FLOAT; break;
|
||||
case 2: wined3d_strided.tex_coords[i].format = WINED3DFMT_R32G32_FLOAT; break;
|
||||
case 3: wined3d_strided.tex_coords[i].format = WINED3DFMT_R32G32B32_FLOAT; break;
|
||||
case 4: wined3d_strided.tex_coords[i].format = WINED3DFMT_R32G32B32A32_FLOAT; break;
|
||||
default: ERR("Unexpected texture coordinate size %d\n",
|
||||
GET_TEXCOORD_SIZE_FROM_FVF(VertexType, i));
|
||||
}
|
||||
WineD3DStrided.texCoords[i].data = D3DDrawPrimStrideData->textureCoords[i].lpvData;
|
||||
WineD3DStrided.texCoords[i].stride = D3DDrawPrimStrideData->textureCoords[i].dwStride;
|
||||
wined3d_strided.tex_coords[i].data = D3DDrawPrimStrideData->textureCoords[i].lpvData;
|
||||
wined3d_strided.tex_coords[i].stride = D3DDrawPrimStrideData->textureCoords[i].dwStride;
|
||||
}
|
||||
|
||||
/* WineD3D doesn't need the FVF here */
|
||||
wined3d_mutex_lock();
|
||||
wined3d_device_set_primitive_type(This->wined3d_device, PrimitiveType);
|
||||
hr = wined3d_device_draw_primitive_strided(This->wined3d_device, VertexCount, &WineD3DStrided);
|
||||
hr = wined3d_device_draw_primitive_strided(This->wined3d_device, VertexCount, &wined3d_strided);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -3990,74 +3993,76 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveStrided(IDirect3DDevice7 *iface,
|
|||
DWORD Flags)
|
||||
{
|
||||
IDirect3DDeviceImpl *This = impl_from_IDirect3DDevice7(iface);
|
||||
WineDirect3DVertexStridedData WineD3DStrided;
|
||||
struct wined3d_strided_data wined3d_strided;
|
||||
DWORD i;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, primitive_type %#x, FVF %#x, strided_data %p, vertex_count %u, indices %p, index_count %u, flags %#x.\n",
|
||||
iface, PrimitiveType, VertexType, D3DDrawPrimStrideData, VertexCount, Indices, IndexCount, Flags);
|
||||
|
||||
memset(&WineD3DStrided, 0, sizeof(WineD3DStrided));
|
||||
memset(&wined3d_strided, 0, sizeof(wined3d_strided));
|
||||
/* Get the strided data right. the wined3d structure is a bit bigger
|
||||
* Watch out: The contents of the strided data are determined by the fvf,
|
||||
* not by the members set in D3DDrawPrimStrideData. So it's valid
|
||||
* to have diffuse.lpvData set to 0xdeadbeef if the diffuse flag is
|
||||
* not set in the fvf.
|
||||
*/
|
||||
if(VertexType & D3DFVF_POSITION_MASK)
|
||||
* not set in the fvf. */
|
||||
if (VertexType & D3DFVF_POSITION_MASK)
|
||||
{
|
||||
WineD3DStrided.position.format = WINED3DFMT_R32G32B32_FLOAT;
|
||||
WineD3DStrided.position.data = D3DDrawPrimStrideData->position.lpvData;
|
||||
WineD3DStrided.position.stride = D3DDrawPrimStrideData->position.dwStride;
|
||||
wined3d_strided.position.format = WINED3DFMT_R32G32B32_FLOAT;
|
||||
wined3d_strided.position.data = D3DDrawPrimStrideData->position.lpvData;
|
||||
wined3d_strided.position.stride = D3DDrawPrimStrideData->position.dwStride;
|
||||
if (VertexType & D3DFVF_XYZRHW)
|
||||
{
|
||||
WineD3DStrided.position.format = WINED3DFMT_R32G32B32A32_FLOAT;
|
||||
WineD3DStrided.position_transformed = TRUE;
|
||||
} else
|
||||
WineD3DStrided.position_transformed = FALSE;
|
||||
}
|
||||
|
||||
if(VertexType & D3DFVF_NORMAL)
|
||||
{
|
||||
WineD3DStrided.normal.format = WINED3DFMT_R32G32B32_FLOAT;
|
||||
WineD3DStrided.normal.data = D3DDrawPrimStrideData->normal.lpvData;
|
||||
WineD3DStrided.normal.stride = D3DDrawPrimStrideData->normal.dwStride;
|
||||
}
|
||||
|
||||
if(VertexType & D3DFVF_DIFFUSE)
|
||||
{
|
||||
WineD3DStrided.diffuse.format = WINED3DFMT_B8G8R8A8_UNORM;
|
||||
WineD3DStrided.diffuse.data = D3DDrawPrimStrideData->diffuse.lpvData;
|
||||
WineD3DStrided.diffuse.stride = D3DDrawPrimStrideData->diffuse.dwStride;
|
||||
}
|
||||
|
||||
if(VertexType & D3DFVF_SPECULAR)
|
||||
{
|
||||
WineD3DStrided.specular.format = WINED3DFMT_B8G8R8A8_UNORM;
|
||||
WineD3DStrided.specular.data = D3DDrawPrimStrideData->specular.lpvData;
|
||||
WineD3DStrided.specular.stride = D3DDrawPrimStrideData->specular.dwStride;
|
||||
}
|
||||
|
||||
for( i = 0; i < GET_TEXCOUNT_FROM_FVF(VertexType); i++)
|
||||
{
|
||||
switch(GET_TEXCOORD_SIZE_FROM_FVF(VertexType, i))
|
||||
wined3d_strided.position.format = WINED3DFMT_R32G32B32A32_FLOAT;
|
||||
wined3d_strided.position_transformed = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
case 1: WineD3DStrided.texCoords[i].format = WINED3DFMT_R32_FLOAT; break;
|
||||
case 2: WineD3DStrided.texCoords[i].format = WINED3DFMT_R32G32_FLOAT; break;
|
||||
case 3: WineD3DStrided.texCoords[i].format = WINED3DFMT_R32G32B32_FLOAT; break;
|
||||
case 4: WineD3DStrided.texCoords[i].format = WINED3DFMT_R32G32B32A32_FLOAT; break;
|
||||
wined3d_strided.position_transformed = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (VertexType & D3DFVF_NORMAL)
|
||||
{
|
||||
wined3d_strided.normal.format = WINED3DFMT_R32G32B32_FLOAT;
|
||||
wined3d_strided.normal.data = D3DDrawPrimStrideData->normal.lpvData;
|
||||
wined3d_strided.normal.stride = D3DDrawPrimStrideData->normal.dwStride;
|
||||
}
|
||||
|
||||
if (VertexType & D3DFVF_DIFFUSE)
|
||||
{
|
||||
wined3d_strided.diffuse.format = WINED3DFMT_B8G8R8A8_UNORM;
|
||||
wined3d_strided.diffuse.data = D3DDrawPrimStrideData->diffuse.lpvData;
|
||||
wined3d_strided.diffuse.stride = D3DDrawPrimStrideData->diffuse.dwStride;
|
||||
}
|
||||
|
||||
if (VertexType & D3DFVF_SPECULAR)
|
||||
{
|
||||
wined3d_strided.specular.format = WINED3DFMT_B8G8R8A8_UNORM;
|
||||
wined3d_strided.specular.data = D3DDrawPrimStrideData->specular.lpvData;
|
||||
wined3d_strided.specular.stride = D3DDrawPrimStrideData->specular.dwStride;
|
||||
}
|
||||
|
||||
for (i = 0; i < GET_TEXCOUNT_FROM_FVF(VertexType); ++i)
|
||||
{
|
||||
switch (GET_TEXCOORD_SIZE_FROM_FVF(VertexType, i))
|
||||
{
|
||||
case 1: wined3d_strided.tex_coords[i].format = WINED3DFMT_R32_FLOAT; break;
|
||||
case 2: wined3d_strided.tex_coords[i].format = WINED3DFMT_R32G32_FLOAT; break;
|
||||
case 3: wined3d_strided.tex_coords[i].format = WINED3DFMT_R32G32B32_FLOAT; break;
|
||||
case 4: wined3d_strided.tex_coords[i].format = WINED3DFMT_R32G32B32A32_FLOAT; break;
|
||||
default: ERR("Unexpected texture coordinate size %d\n",
|
||||
GET_TEXCOORD_SIZE_FROM_FVF(VertexType, i));
|
||||
}
|
||||
WineD3DStrided.texCoords[i].data = D3DDrawPrimStrideData->textureCoords[i].lpvData;
|
||||
WineD3DStrided.texCoords[i].stride = D3DDrawPrimStrideData->textureCoords[i].dwStride;
|
||||
wined3d_strided.tex_coords[i].data = D3DDrawPrimStrideData->textureCoords[i].lpvData;
|
||||
wined3d_strided.tex_coords[i].stride = D3DDrawPrimStrideData->textureCoords[i].dwStride;
|
||||
}
|
||||
|
||||
/* WineD3D doesn't need the FVF here */
|
||||
wined3d_mutex_lock();
|
||||
wined3d_device_set_primitive_type(This->wined3d_device, PrimitiveType);
|
||||
hr = wined3d_device_draw_indexed_primitive_strided(This->wined3d_device,
|
||||
IndexCount, &WineD3DStrided, VertexCount, Indices, WINED3DFMT_R16_UINT);
|
||||
IndexCount, &wined3d_strided, VertexCount, Indices, WINED3DFMT_R16_UINT);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
|
|
@ -353,7 +353,7 @@ static void stream_info_element_from_strided(const struct wined3d_gl_info *gl_in
|
|||
}
|
||||
|
||||
static void device_stream_info_from_strided(const struct wined3d_gl_info *gl_info,
|
||||
const struct WineDirect3DVertexStridedData *strided, struct wined3d_stream_info *stream_info)
|
||||
const struct wined3d_strided_data *strided, struct wined3d_stream_info *stream_info)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
|
@ -370,8 +370,8 @@ static void device_stream_info_from_strided(const struct wined3d_gl_info *gl_inf
|
|||
|
||||
for (i = 0; i < WINED3DDP_MAXTEXCOORD; ++i)
|
||||
{
|
||||
if (strided->texCoords[i].data)
|
||||
stream_info_element_from_strided(gl_info, &strided->texCoords[i],
|
||||
if (strided->tex_coords[i].data)
|
||||
stream_info_element_from_strided(gl_info, &strided->tex_coords[i],
|
||||
&stream_info->elements[WINED3D_FFP_TEXCOORD0 + i]);
|
||||
}
|
||||
|
||||
|
@ -4249,7 +4249,7 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive_up(struct wined3d_device *de
|
|||
}
|
||||
|
||||
HRESULT CDECL wined3d_device_draw_primitive_strided(struct wined3d_device *device,
|
||||
UINT vertex_count, const WineDirect3DVertexStridedData *strided_data)
|
||||
UINT vertex_count, const struct wined3d_strided_data *strided_data)
|
||||
{
|
||||
/* Mark the state dirty until we have nicer tracking. It's fine to change
|
||||
* baseVertexIndex because that call is only called by ddraw which does
|
||||
|
@ -4274,7 +4274,7 @@ HRESULT CDECL wined3d_device_draw_primitive_strided(struct wined3d_device *devic
|
|||
}
|
||||
|
||||
HRESULT CDECL wined3d_device_draw_indexed_primitive_strided(struct wined3d_device *device,
|
||||
UINT index_count, const WineDirect3DVertexStridedData *strided_data,
|
||||
UINT index_count, const struct wined3d_strided_data *strided_data,
|
||||
UINT vertex_count, const void *index_data, enum wined3d_format_id index_data_format_id)
|
||||
{
|
||||
UINT index_size = index_data_format_id == WINED3DFMT_R32_UINT ? 4 : 2;
|
||||
|
|
|
@ -1136,11 +1136,11 @@ HRESULT tesselate_rectpatch(struct wined3d_device *This, struct WineD3DRectPatch
|
|||
}
|
||||
if (patch->has_texcoords)
|
||||
{
|
||||
patch->strided.texCoords[0].format = WINED3DFMT_R32G32B32A32_FLOAT;
|
||||
patch->strided.texCoords[0].data = (BYTE *)patch->mem + 3 * sizeof(float) /* pos */;
|
||||
patch->strided.tex_coords[0].format = WINED3DFMT_R32G32B32A32_FLOAT;
|
||||
patch->strided.tex_coords[0].data = (BYTE *)patch->mem + 3 * sizeof(float) /* pos */;
|
||||
if (patch->has_normals)
|
||||
patch->strided.texCoords[0].data += 3 * sizeof(float);
|
||||
patch->strided.texCoords[0].stride = vtxStride;
|
||||
patch->strided.tex_coords[0].data += 3 * sizeof(float);
|
||||
patch->strided.tex_coords[0].stride = vtxStride;
|
||||
}
|
||||
|
||||
return WINED3D_OK;
|
||||
|
|
|
@ -1555,7 +1555,7 @@ struct WineD3DRectPatch
|
|||
{
|
||||
UINT Handle;
|
||||
float *mem;
|
||||
WineDirect3DVertexStridedData strided;
|
||||
struct wined3d_strided_data strided;
|
||||
struct wined3d_rect_patch_info rect_patch_info;
|
||||
float numSegs[4];
|
||||
char has_normals, has_texcoords;
|
||||
|
@ -1746,7 +1746,7 @@ struct wined3d_device
|
|||
|
||||
/* Stream source management */
|
||||
struct wined3d_stream_info strided_streams;
|
||||
const WineDirect3DVertexStridedData *up_strided;
|
||||
const struct wined3d_strided_data *up_strided;
|
||||
struct wined3d_event_query *buffer_queries[MAX_ATTRIBS];
|
||||
unsigned int num_buffer_queries;
|
||||
|
||||
|
|
|
@ -1732,15 +1732,15 @@ struct wined3d_strided_element
|
|||
UINT stride; /* Stride between occurrences of this data */
|
||||
};
|
||||
|
||||
typedef struct WineDirect3DVertexStridedData
|
||||
struct wined3d_strided_data
|
||||
{
|
||||
struct wined3d_strided_element position;
|
||||
struct wined3d_strided_element normal;
|
||||
struct wined3d_strided_element diffuse;
|
||||
struct wined3d_strided_element specular;
|
||||
struct wined3d_strided_element texCoords[WINED3DDP_MAXTEXCOORD];
|
||||
struct wined3d_strided_element tex_coords[WINED3DDP_MAXTEXCOORD];
|
||||
BOOL position_transformed;
|
||||
} WineDirect3DVertexStridedData;
|
||||
};
|
||||
|
||||
typedef struct _WINED3DVSHADERCAPS2_0
|
||||
{
|
||||
|
@ -2109,14 +2109,14 @@ ULONG __cdecl wined3d_device_decref(struct wined3d_device *device);
|
|||
HRESULT __cdecl wined3d_device_delete_patch(struct wined3d_device *device, UINT handle);
|
||||
HRESULT __cdecl wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count);
|
||||
HRESULT __cdecl wined3d_device_draw_indexed_primitive_strided(struct wined3d_device *device, UINT index_count,
|
||||
const WineDirect3DVertexStridedData *strided_data, UINT vertex_count, const void *index_data,
|
||||
const struct wined3d_strided_data *strided_data, UINT vertex_count, const void *index_data,
|
||||
enum wined3d_format_id index_data_format_id);
|
||||
HRESULT __cdecl wined3d_device_draw_indexed_primitive_up(struct wined3d_device *device,
|
||||
UINT index_count, const void *index_data, enum wined3d_format_id index_data_format_id,
|
||||
const void *stream_data, UINT stream_stride);
|
||||
HRESULT __cdecl wined3d_device_draw_primitive(struct wined3d_device *device, UINT start_vertex, UINT vertex_count);
|
||||
HRESULT __cdecl wined3d_device_draw_primitive_strided(struct wined3d_device *device,
|
||||
UINT vertex_count, const WineDirect3DVertexStridedData *strided_data);
|
||||
UINT vertex_count, const struct wined3d_strided_data *strided_data);
|
||||
HRESULT __cdecl wined3d_device_draw_primitive_up(struct wined3d_device *device,
|
||||
UINT vertex_count, const void *stream_data, UINT stream_stride);
|
||||
HRESULT __cdecl wined3d_device_draw_rect_patch(struct wined3d_device *device, UINT handle,
|
||||
|
|
Loading…
Reference in New Issue