Commit 4434d00f authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Unify vertex and texture formats.

Some fields should be redundant now, eg. gl_vtx_type and glType. I'll leave that for a different patch to fix though.
parent 6f206c75
......@@ -228,7 +228,8 @@ void load_local_constants(const DWORD *d3d8_elements, IWineD3DVertexShader *wine
}
/* NOTE: Make sure these are in the correct numerical order. (see /include/wined3d_types.h) */
static const size_t wined3d_type_sizes[WINED3DDECLTYPE_UNUSED] = {
static const size_t wined3d_type_sizes[] =
{
/*WINED3DDECLTYPE_FLOAT1*/ 1 * sizeof(float),
/*WINED3DDECLTYPE_FLOAT2*/ 2 * sizeof(float),
/*WINED3DDECLTYPE_FLOAT3*/ 3 * sizeof(float),
......@@ -248,6 +249,27 @@ static const size_t wined3d_type_sizes[WINED3DDECLTYPE_UNUSED] = {
/*WINED3DDECLTYPE_FLOAT16_4*/ 4 * sizeof(short int)
};
static const WINED3DFORMAT wined3d_format_lookup[] =
{
/*WINED3DDECLTYPE_FLOAT1*/ WINED3DFMT_R32_FLOAT,
/*WINED3DDECLTYPE_FLOAT2*/ WINED3DFMT_R32G32_FLOAT,
/*WINED3DDECLTYPE_FLOAT3*/ WINED3DFMT_R32G32B32_FLOAT,
/*WINED3DDECLTYPE_FLOAT4*/ WINED3DFMT_R32G32B32A32_FLOAT,
/*WINED3DDECLTYPE_D3DCOLOR*/ WINED3DFMT_A8R8G8B8,
/*WINED3DDECLTYPE_UBYTE4*/ WINED3DFMT_R8G8B8A8_UINT,
/*WINED3DDECLTYPE_SHORT2*/ WINED3DFMT_R16G16_SINT,
/*WINED3DDECLTYPE_SHORT4*/ WINED3DFMT_R16G16B16A16_SINT,
/*WINED3DDECLTYPE_UBYTE4N*/ WINED3DFMT_R8G8B8A8_UNORM,
/*WINED3DDECLTYPE_SHORT2N*/ WINED3DFMT_R16G16_SNORM,
/*WINED3DDECLTYPE_SHORT4N*/ WINED3DFMT_R16G16B16A16_SNORM,
/*WINED3DDECLTYPE_USHORT2N*/ WINED3DFMT_R16G16_UNORM,
/*WINED3DDECLTYPE_USHORT4N*/ WINED3DFMT_R16G16B16A16_UNORM,
/*WINED3DDECLTYPE_UDEC3*/ WINED3DFMT_R10G10B10A2_UINT,
/*WINED3DDECLTYPE_DEC3N*/ WINED3DFMT_R10G10B10A2_SNORM,
/*WINED3DDECLTYPE_FLOAT16_2*/ WINED3DFMT_R16G16_FLOAT,
/*WINED3DDECLTYPE_FLOAT16_4*/ WINED3DFMT_R16G16B16A16_FLOAT,
};
typedef struct {
BYTE usage;
BYTE usage_idx;
......@@ -302,13 +324,13 @@ UINT convert_to_wined3d_declaration(const DWORD *d3d8_elements, DWORD *d3d8_elem
TRACE("Adding element %d:\n", element_count);
element = *wined3d_elements + element_count++;
element->Stream = stream;
element->Method = WINED3DDECLMETHOD_DEFAULT;
element->Usage = wined3d_usage_lookup[reg].usage;
element->UsageIndex = wined3d_usage_lookup[reg].usage_idx;
element->Type = type;
element->Offset = offset;
element->Reg = reg;
element->format = wined3d_format_lookup[type];
element->input_slot = stream;
element->offset = offset;
element->output_slot = reg;
element->method = WINED3DDECLMETHOD_DEFAULT;
element->usage = wined3d_usage_lookup[reg].usage;
element->usage_idx = wined3d_usage_lookup[reg].usage_idx;
offset += wined3d_type_sizes[type];
} else if (token_type == D3DVSD_TOKEN_STREAMDATA && (token_type & 0x10000000)) {
......
......@@ -26,28 +26,29 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d9);
typedef struct _D3DDECLTYPE_INFO {
D3DDECLTYPE d3dType;
WINED3DFORMAT format;
int size;
int typesize;
} D3DDECLTYPE_INFO;
static D3DDECLTYPE_INFO const d3d_dtype_lookup[D3DDECLTYPE_UNUSED] = {
{D3DDECLTYPE_FLOAT1, 1, sizeof(float)},
{D3DDECLTYPE_FLOAT2, 2, sizeof(float)},
{D3DDECLTYPE_FLOAT3, 3, sizeof(float)},
{D3DDECLTYPE_FLOAT4, 4, sizeof(float)},
{D3DDECLTYPE_D3DCOLOR, 4, sizeof(BYTE)},
{D3DDECLTYPE_UBYTE4, 4, sizeof(BYTE)},
{D3DDECLTYPE_SHORT2, 2, sizeof(short int)},
{D3DDECLTYPE_SHORT4, 4, sizeof(short int)},
{D3DDECLTYPE_UBYTE4N, 4, sizeof(BYTE)},
{D3DDECLTYPE_SHORT2N, 2, sizeof(short int)},
{D3DDECLTYPE_SHORT4N, 4, sizeof(short int)},
{D3DDECLTYPE_USHORT2N, 2, sizeof(short int)},
{D3DDECLTYPE_USHORT4N, 4, sizeof(short int)},
{D3DDECLTYPE_UDEC3, 3, sizeof(short int)},
{D3DDECLTYPE_DEC3N, 3, sizeof(short int)},
{D3DDECLTYPE_FLOAT16_2, 2, sizeof(short int)},
{D3DDECLTYPE_FLOAT16_4, 4, sizeof(short int)}};
{D3DDECLTYPE_FLOAT1, WINED3DFMT_R32_FLOAT, 1, sizeof(float)},
{D3DDECLTYPE_FLOAT2, WINED3DFMT_R32G32_FLOAT, 2, sizeof(float)},
{D3DDECLTYPE_FLOAT3, WINED3DFMT_R32G32B32_FLOAT, 3, sizeof(float)},
{D3DDECLTYPE_FLOAT4, WINED3DFMT_R32G32B32A32_FLOAT, 4, sizeof(float)},
{D3DDECLTYPE_D3DCOLOR, WINED3DFMT_A8R8G8B8, 4, sizeof(BYTE)},
{D3DDECLTYPE_UBYTE4, WINED3DFMT_R8G8B8A8_UINT, 4, sizeof(BYTE)},
{D3DDECLTYPE_SHORT2, WINED3DFMT_R16G16_SINT, 2, sizeof(short int)},
{D3DDECLTYPE_SHORT4, WINED3DFMT_R16G16B16A16_SINT, 4, sizeof(short int)},
{D3DDECLTYPE_UBYTE4N, WINED3DFMT_R8G8B8A8_UNORM, 4, sizeof(BYTE)},
{D3DDECLTYPE_SHORT2N, WINED3DFMT_R16G16_SNORM, 2, sizeof(short int)},
{D3DDECLTYPE_SHORT4N, WINED3DFMT_R16G16B16A16_SNORM, 4, sizeof(short int)},
{D3DDECLTYPE_USHORT2N, WINED3DFMT_R16G16_UNORM, 2, sizeof(short int)},
{D3DDECLTYPE_USHORT4N, WINED3DFMT_R16G16B16A16_UNORM, 4, sizeof(short int)},
{D3DDECLTYPE_UDEC3, WINED3DFMT_R10G10B10A2_UINT, 3, sizeof(short int)},
{D3DDECLTYPE_DEC3N, WINED3DFMT_R10G10B10A2_SNORM, 3, sizeof(short int)},
{D3DDECLTYPE_FLOAT16_2, WINED3DFMT_R16G16_FLOAT, 2, sizeof(short int)},
{D3DDECLTYPE_FLOAT16_4, WINED3DFMT_R16G16B16A16_FLOAT, 4, sizeof(short int)}};
#define D3D_DECL_SIZE(type) d3d_dtype_lookup[type].size
#define D3D_DECL_TYPESIZE(type) d3d_dtype_lookup[type].typesize
......@@ -301,35 +302,49 @@ static const IDirect3DVertexDeclaration9Vtbl Direct3DVertexDeclaration9_Vtbl =
IDirect3DVertexDeclaration9Impl_GetDeclaration
};
static UINT convert_to_wined3d_declaration(const D3DVERTEXELEMENT9* d3d9_elements, WINED3DVERTEXELEMENT **wined3d_elements) {
static HRESULT convert_to_wined3d_declaration(const D3DVERTEXELEMENT9* d3d9_elements,
WINED3DVERTEXELEMENT **wined3d_elements, UINT *element_count)
{
const D3DVERTEXELEMENT9* element;
UINT element_count = 1;
UINT count = 1;
UINT i;
TRACE("d3d9_elements %p, wined3d_elements %p\n", d3d9_elements, wined3d_elements);
element = d3d9_elements;
while (element++->Stream != 0xff && element_count++ < 128);
while (element++->Stream != 0xff && count++ < 128);
if (element_count == 128) {
return ~0U;
}
if (count == 128) return E_FAIL;
/* Skip the END element */
--element_count;
--count;
*wined3d_elements = HeapAlloc(GetProcessHeap(), 0, element_count * sizeof(WINED3DVERTEXELEMENT));
*wined3d_elements = HeapAlloc(GetProcessHeap(), 0, count * sizeof(WINED3DVERTEXELEMENT));
if (!*wined3d_elements) {
FIXME("Memory allocation failed\n");
return ~0U;
return D3DERR_OUTOFVIDEOMEMORY;
}
for (i = 0; i < element_count; ++i) {
CopyMemory(*wined3d_elements + i, d3d9_elements + i, sizeof(D3DVERTEXELEMENT9));
(*wined3d_elements)[i].Reg = -1;
for (i = 0; i < count; ++i)
{
if (d3d9_elements[i].Type >= (sizeof(d3d_dtype_lookup) / sizeof(*d3d_dtype_lookup)))
{
WARN("Invalid element type %#x.\n", d3d9_elements[i].Type);
HeapFree(GetProcessHeap(), 0, *wined3d_elements);
return E_FAIL;
}
(*wined3d_elements)[i].format = d3d_dtype_lookup[d3d9_elements[i].Type].format;
(*wined3d_elements)[i].input_slot = d3d9_elements[i].Stream;
(*wined3d_elements)[i].offset = d3d9_elements[i].Offset;
(*wined3d_elements)[i].output_slot = ~0U;
(*wined3d_elements)[i].method = d3d9_elements[i].Method;
(*wined3d_elements)[i].usage = d3d9_elements[i].Usage;
(*wined3d_elements)[i].usage_idx = d3d9_elements[i].UsageIndex;
}
return element_count;
*element_count = count;
return D3D_OK;
}
/* IDirect3DDevice9 IDirect3DVertexDeclaration9 Methods follow: */
......@@ -340,7 +355,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexDeclaration(LPDIRECT3DDEVICE9E
WINED3DVERTEXELEMENT* wined3d_elements;
UINT wined3d_element_count;
UINT element_count;
HRESULT hr = D3D_OK;
HRESULT hr;
TRACE("(%p) : Relay\n", iface);
if (NULL == ppDecl) {
......@@ -348,11 +363,11 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexDeclaration(LPDIRECT3DDEVICE9E
return D3DERR_INVALIDCALL;
}
wined3d_element_count = convert_to_wined3d_declaration(pVertexElements, &wined3d_elements);
if (wined3d_element_count == ~0U)
hr = convert_to_wined3d_declaration(pVertexElements, &wined3d_elements, &wined3d_element_count);
if (FAILED(hr))
{
FIXME("(%p) : Error parsing vertex declaration\n", This);
return D3DERR_INVALIDCALL;
WARN("(%p) : Error parsing vertex declaration\n", This);
return hr;
}
/* Allocate the storage for the device */
......
......@@ -3827,12 +3827,12 @@ IDirect3DDeviceImpl_7_DrawPrimitiveStrided(IDirect3DDevice7 *iface,
*/
if(VertexType & D3DFVF_POSITION_MASK)
{
WineD3DStrided.position.format = WINED3DFMT_R32G32B32_FLOAT;
WineD3DStrided.position.lpData = D3DDrawPrimStrideData->position.lpvData;
WineD3DStrided.position.dwStride = D3DDrawPrimStrideData->position.dwStride;
WineD3DStrided.position.dwType = WINED3DDECLTYPE_FLOAT3;
if (VertexType & D3DFVF_XYZRHW)
{
WineD3DStrided.position.dwType = WINED3DDECLTYPE_FLOAT4;
WineD3DStrided.position.format = WINED3DFMT_R32G32B32A32_FLOAT;
WineD3DStrided.position_transformed = TRUE;
} else
WineD3DStrided.position_transformed = FALSE;
......@@ -3840,38 +3840,38 @@ IDirect3DDeviceImpl_7_DrawPrimitiveStrided(IDirect3DDevice7 *iface,
if(VertexType & D3DFVF_NORMAL)
{
WineD3DStrided.normal.format = WINED3DFMT_R32G32B32_FLOAT;
WineD3DStrided.normal.lpData = D3DDrawPrimStrideData->normal.lpvData;
WineD3DStrided.normal.dwStride = D3DDrawPrimStrideData->normal.dwStride;
WineD3DStrided.normal.dwType = WINED3DDECLTYPE_FLOAT3;
}
if(VertexType & D3DFVF_DIFFUSE)
{
WineD3DStrided.diffuse.format = WINED3DFMT_A8R8G8B8;
WineD3DStrided.diffuse.lpData = D3DDrawPrimStrideData->diffuse.lpvData;
WineD3DStrided.diffuse.dwStride = D3DDrawPrimStrideData->diffuse.dwStride;
WineD3DStrided.diffuse.dwType = WINED3DDECLTYPE_D3DCOLOR;
}
if(VertexType & D3DFVF_SPECULAR)
{
WineD3DStrided.specular.format = WINED3DFMT_A8R8G8B8;
WineD3DStrided.specular.lpData = D3DDrawPrimStrideData->specular.lpvData;
WineD3DStrided.specular.dwStride = D3DDrawPrimStrideData->specular.dwStride;
WineD3DStrided.specular.dwType = WINED3DDECLTYPE_D3DCOLOR;
}
for( i = 0; i < GET_TEXCOUNT_FROM_FVF(VertexType); i++)
{
WineD3DStrided.texCoords[i].lpData = D3DDrawPrimStrideData->textureCoords[i].lpvData;
WineD3DStrided.texCoords[i].dwStride = D3DDrawPrimStrideData->textureCoords[i].dwStride;
switch(GET_TEXCOORD_SIZE_FROM_FVF(VertexType, i))
{
case 1: WineD3DStrided.texCoords[i].dwType = WINED3DDECLTYPE_FLOAT1; break;
case 2: WineD3DStrided.texCoords[i].dwType = WINED3DDECLTYPE_FLOAT2; break;
case 3: WineD3DStrided.texCoords[i].dwType = WINED3DDECLTYPE_FLOAT3; break;
case 4: WineD3DStrided.texCoords[i].dwType = WINED3DDECLTYPE_FLOAT4; break;
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;
default: ERR("Unexpected texture coordinate size %d\n",
GET_TEXCOORD_SIZE_FROM_FVF(VertexType, i));
}
WineD3DStrided.texCoords[i].lpData = D3DDrawPrimStrideData->textureCoords[i].lpvData;
WineD3DStrided.texCoords[i].dwStride = D3DDrawPrimStrideData->textureCoords[i].dwStride;
}
/* WineD3D doesn't need the FVF here */
......@@ -3968,12 +3968,12 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveStrided(IDirect3DDevice7 *iface,
*/
if(VertexType & D3DFVF_POSITION_MASK)
{
WineD3DStrided.position.format = WINED3DFMT_R32G32B32_FLOAT;
WineD3DStrided.position.lpData = D3DDrawPrimStrideData->position.lpvData;
WineD3DStrided.position.dwStride = D3DDrawPrimStrideData->position.dwStride;
WineD3DStrided.position.dwType = WINED3DDECLTYPE_FLOAT3;
if (VertexType & D3DFVF_XYZRHW)
{
WineD3DStrided.position.dwType = WINED3DDECLTYPE_FLOAT4;
WineD3DStrided.position.format = WINED3DFMT_R32G32B32A32_FLOAT;
WineD3DStrided.position_transformed = TRUE;
} else
WineD3DStrided.position_transformed = FALSE;
......@@ -3981,38 +3981,38 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveStrided(IDirect3DDevice7 *iface,
if(VertexType & D3DFVF_NORMAL)
{
WineD3DStrided.normal.format = WINED3DFMT_R32G32B32_FLOAT;
WineD3DStrided.normal.lpData = D3DDrawPrimStrideData->normal.lpvData;
WineD3DStrided.normal.dwStride = D3DDrawPrimStrideData->normal.dwStride;
WineD3DStrided.normal.dwType = WINED3DDECLTYPE_FLOAT3;
}
if(VertexType & D3DFVF_DIFFUSE)
{
WineD3DStrided.diffuse.format = WINED3DFMT_A8R8G8B8;
WineD3DStrided.diffuse.lpData = D3DDrawPrimStrideData->diffuse.lpvData;
WineD3DStrided.diffuse.dwStride = D3DDrawPrimStrideData->diffuse.dwStride;
WineD3DStrided.diffuse.dwType = WINED3DDECLTYPE_D3DCOLOR;
}
if(VertexType & D3DFVF_SPECULAR)
{
WineD3DStrided.specular.format = WINED3DFMT_A8R8G8B8;
WineD3DStrided.specular.lpData = D3DDrawPrimStrideData->specular.lpvData;
WineD3DStrided.specular.dwStride = D3DDrawPrimStrideData->specular.dwStride;
WineD3DStrided.specular.dwType = WINED3DDECLTYPE_D3DCOLOR;
}
for( i = 0; i < GET_TEXCOUNT_FROM_FVF(VertexType); i++)
{
WineD3DStrided.texCoords[i].lpData = D3DDrawPrimStrideData->textureCoords[i].lpvData;
WineD3DStrided.texCoords[i].dwStride = D3DDrawPrimStrideData->textureCoords[i].dwStride;
switch(GET_TEXCOORD_SIZE_FROM_FVF(VertexType, i))
{
case 1: WineD3DStrided.texCoords[i].dwType = WINED3DDECLTYPE_FLOAT1; break;
case 2: WineD3DStrided.texCoords[i].dwType = WINED3DDECLTYPE_FLOAT2; break;
case 3: WineD3DStrided.texCoords[i].dwType = WINED3DDECLTYPE_FLOAT3; break;
case 4: WineD3DStrided.texCoords[i].dwType = WINED3DDECLTYPE_FLOAT4; break;
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;
default: ERR("Unexpected texture coordinate size %d\n",
GET_TEXCOORD_SIZE_FROM_FVF(VertexType, i));
}
WineD3DStrided.texCoords[i].lpData = D3DDrawPrimStrideData->textureCoords[i].lpvData;
WineD3DStrided.texCoords[i].dwStride = D3DDrawPrimStrideData->textureCoords[i].dwStride;
}
/* WineD3D doesn't need the FVF here */
......
......@@ -129,7 +129,7 @@ fail:
static BOOL buffer_process_converted_attribute(struct wined3d_buffer *This,
const enum wined3d_buffer_conversion_type conversion_type,
const struct wined3d_stream_info_element *attrib, DWORD *stride_this_run, const DWORD type)
const struct wined3d_stream_info_element *attrib, DWORD *stride_this_run)
{
DWORD attrib_size;
BOOL ret = FALSE;
......@@ -145,7 +145,7 @@ static BOOL buffer_process_converted_attribute(struct wined3d_buffer *This,
if (!attrib->stride)
{
FIXME("%s used with stride 0, let's hope we get the vertex stride from somewhere else\n",
debug_d3ddecltype(type));
debug_d3dformat(attrib->d3d_format));
}
else if(attrib->stride != *stride_this_run && *stride_this_run)
{
......@@ -169,7 +169,7 @@ static BOOL buffer_process_converted_attribute(struct wined3d_buffer *This,
}
data = (((DWORD_PTR)attrib->data) + offset) % This->stride;
attrib_size = WINED3D_ATR_SIZE(type) * WINED3D_ATR_TYPESIZE(type);
attrib_size = attrib->size * attrib->type_size;
for (i = 0; i < attrib_size; ++i)
{
if (This->conversion_map[data + i] != conversion_type)
......@@ -189,39 +189,36 @@ static BOOL buffer_check_attribute(struct wined3d_buffer *This,
const BOOL is_ffp_color, DWORD *stride_this_run, BOOL *float16_used)
{
BOOL ret = FALSE;
WINED3DDECLTYPE type;
WINED3DFORMAT format;
/* Ignore attributes that do not have our vbo. After that check we can be sure that the attribute is
* there, on nonexistent attribs the vbo is 0.
*/
if (attrib->buffer_object != This->buffer_object) return FALSE;
type = attrib->d3d_type;
format = attrib->d3d_format;
/* Look for newly appeared conversion */
if (!GL_SUPPORT(NV_HALF_FLOAT) && (type == WINED3DDECLTYPE_FLOAT16_2 || type == WINED3DDECLTYPE_FLOAT16_4))
if (!GL_SUPPORT(NV_HALF_FLOAT) && (format == WINED3DFMT_R16G16_FLOAT || format == WINED3DFMT_R16G16B16A16_FLOAT))
{
ret = buffer_process_converted_attribute(This, CONV_FLOAT16_2, attrib, stride_this_run, type);
ret = buffer_process_converted_attribute(This, CONV_FLOAT16_2, attrib, stride_this_run);
if (is_ffp_position) FIXME("Test FLOAT16 fixed function processing positions\n");
else if (is_ffp_color) FIXME("test FLOAT16 fixed function processing colors\n");
*float16_used = TRUE;
}
else if (check_d3dcolor && type == WINED3DDECLTYPE_D3DCOLOR)
else if (check_d3dcolor && format == WINED3DFMT_A8R8G8B8)
{
ret = buffer_process_converted_attribute(This, CONV_D3DCOLOR,
attrib, stride_this_run, WINED3DDECLTYPE_D3DCOLOR);
ret = buffer_process_converted_attribute(This, CONV_D3DCOLOR, attrib, stride_this_run);
if (!is_ffp_color) FIXME("Test for non-color fixed function D3DCOLOR type\n");
if (!is_ffp_color) FIXME("Test for non-color fixed function WINED3DFMT_A8R8G8B8 format\n");
}
else if (is_ffp_position && type == WINED3DDECLTYPE_FLOAT4)
else if (is_ffp_position && format == WINED3DFMT_R32G32B32A32_FLOAT)
{
ret = buffer_process_converted_attribute(This, CONV_POSITIONT,
attrib, stride_this_run, WINED3DDECLTYPE_FLOAT4);
ret = buffer_process_converted_attribute(This, CONV_POSITIONT, attrib, stride_this_run);
}
else if (This->conversion_map)
{
ret = buffer_process_converted_attribute(This, CONV_NONE,
attrib, stride_this_run, type);
ret = buffer_process_converted_attribute(This, CONV_NONE, attrib, stride_this_run);
}
return ret;
......@@ -231,7 +228,6 @@ static UINT *find_conversion_shift(struct wined3d_buffer *This,
const struct wined3d_stream_info *strided, UINT stride)
{
UINT *ret, i, j, shift, orig_type_size;
DWORD type;
if (!stride)
{
......@@ -243,14 +239,16 @@ static UINT *find_conversion_shift(struct wined3d_buffer *This,
ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DWORD) * stride);
for (i = 0; i < MAX_ATTRIBS; ++i)
{
WINED3DFORMAT format;
if (strided->elements[i].buffer_object != This->buffer_object) continue;
type = strided->elements[i].d3d_type;
if (type == WINED3DDECLTYPE_FLOAT16_2)
format = strided->elements[i].d3d_format;
if (format == WINED3DFMT_R16G16_FLOAT)
{
shift = 4;
}
else if (type == WINED3DDECLTYPE_FLOAT16_4)
else if (format == WINED3DFMT_R16G16B16A16_FLOAT)
{
shift = 8;
/* Pre-shift the last 4 bytes in the FLOAT16_4 by 4 bytes - this makes FLOAT16_2 and FLOAT16_4 conversions
......@@ -269,7 +267,7 @@ static UINT *find_conversion_shift(struct wined3d_buffer *This,
if (shift)
{
orig_type_size = WINED3D_ATR_TYPESIZE(type) * WINED3D_ATR_SIZE(type);
orig_type_size = strided->elements[i].type_size * strided->elements[i].size;
for (j = (DWORD_PTR)strided->elements[i].data + orig_type_size; j < stride; ++j)
{
ret[j] += shift;
......
......@@ -3013,8 +3013,8 @@ static void transform_texture(DWORD state, IWineD3DStateBlockImpl *stateblock, W
set_texture_matrix(&stateblock->transforms[WINED3DTS_TEXTURE0 + texUnit].u.m[0][0],
stateblock->textureState[texUnit][WINED3DTSS_TEXTURETRANSFORMFLAGS], generated, context->last_was_rhw,
stateblock->wineD3DDevice->strided_streams.elements[WINED3D_FFP_TEXCOORD0 + coordIdx].stride
? stateblock->wineD3DDevice->strided_streams.elements[WINED3D_FFP_TEXCOORD0 + coordIdx].d3d_type
: WINED3DDECLTYPE_UNUSED,
? stateblock->wineD3DDevice->strided_streams.elements[WINED3D_FFP_TEXCOORD0 + coordIdx].d3d_format
: WINED3DFMT_UNKNOWN,
stateblock->wineD3DDevice->frag_pipe->ffp_proj_control);
/* The sampler applying function calls us if this changes */
......@@ -3920,25 +3920,25 @@ static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock,
if (context->numbered_array_mask & (1 << i)) unload_numbered_array(stateblock, context, i);
switch(stream_info->elements[i].d3d_type)
switch(stream_info->elements[i].d3d_format)
{
case WINED3DDECLTYPE_FLOAT1:
case WINED3DFMT_R32_FLOAT:
GL_EXTCALL(glVertexAttrib1fvARB(i, (const GLfloat *)ptr));
break;
case WINED3DDECLTYPE_FLOAT2:
case WINED3DFMT_R32G32_FLOAT:
GL_EXTCALL(glVertexAttrib2fvARB(i, (const GLfloat *)ptr));
break;
case WINED3DDECLTYPE_FLOAT3:
case WINED3DFMT_R32G32B32_FLOAT:
GL_EXTCALL(glVertexAttrib3fvARB(i, (const GLfloat *)ptr));
break;
case WINED3DDECLTYPE_FLOAT4:
case WINED3DFMT_R32G32B32A32_FLOAT:
GL_EXTCALL(glVertexAttrib4fvARB(i, (const GLfloat *)ptr));
break;
case WINED3DDECLTYPE_UBYTE4:
case WINED3DFMT_R8G8B8A8_UINT:
GL_EXTCALL(glVertexAttrib4NubvARB(i, ptr));
break;
case WINED3DDECLTYPE_D3DCOLOR:
case WINED3DFMT_A8R8G8B8:
if (GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA))
{
const DWORD *src = (const DWORD *)ptr;
......@@ -3949,56 +3949,55 @@ static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock,
break;
}
/* else fallthrough */
case WINED3DDECLTYPE_UBYTE4N:
case WINED3DFMT_R8G8B8A8_UNORM:
GL_EXTCALL(glVertexAttrib4NubvARB(i, ptr));
break;
case WINED3DDECLTYPE_SHORT2:
case WINED3DFMT_R16G16_SINT:
GL_EXTCALL(glVertexAttrib4svARB(i, (const GLshort *)ptr));
break;
case WINED3DDECLTYPE_SHORT4:
case WINED3DFMT_R16G16B16A16_SINT:
GL_EXTCALL(glVertexAttrib4svARB(i, (const GLshort *)ptr));
break;
case WINED3DDECLTYPE_SHORT2N:
case WINED3DFMT_R16G16_SNORM:
{
const GLshort s[4] = {((const GLshort *)ptr)[0], ((const GLshort *)ptr)[1], 0, 1};
GL_EXTCALL(glVertexAttrib4NsvARB(i, s));
break;
}
case WINED3DDECLTYPE_USHORT2N:
case WINED3DFMT_R16G16_UNORM:
{
const GLushort s[4] = {((const GLushort *)ptr)[0], ((const GLushort *)ptr)[1], 0, 1};
GL_EXTCALL(glVertexAttrib4NusvARB(i, s));
break;
}
case WINED3DDECLTYPE_SHORT4N:
case WINED3DFMT_R16G16B16A16_SNORM:
GL_EXTCALL(glVertexAttrib4NsvARB(i, (const GLshort *)ptr));
break;
case WINED3DDECLTYPE_USHORT4N:
case WINED3DFMT_R16G16B16A16_UNORM:
GL_EXTCALL(glVertexAttrib4NusvARB(i, (const GLushort *)ptr));
break;
case WINED3DDECLTYPE_UDEC3:
case WINED3DFMT_R10G10B10A2_UINT:
FIXME("Unsure about WINED3DDECLTYPE_UDEC3\n");
/*glVertexAttrib3usvARB(i, (const GLushort *)ptr); Does not exist */
break;
case WINED3DDECLTYPE_DEC3N:
case WINED3DFMT_R10G10B10A2_SNORM:
FIXME("Unsure about WINED3DDECLTYPE_DEC3N\n");
/*glVertexAttrib3NusvARB(i, (const GLushort *)ptr); Does not exist */
break;
case WINED3DDECLTYPE_FLOAT16_2:
case WINED3DFMT_R16G16_FLOAT:
/* Are those 16 bit floats. C doesn't have a 16 bit float type. I could read the single bits and calculate a 4
* byte float according to the IEEE standard
*/
FIXME("Unsupported WINED3DDECLTYPE_FLOAT16_2\n");
break;
case WINED3DDECLTYPE_FLOAT16_4:
case WINED3DFMT_R16G16B16A16_FLOAT:
FIXME("Unsupported WINED3DDECLTYPE_FLOAT16_4\n");
break;
case WINED3DDECLTYPE_UNUSED:
default:
ERR("Unexpected declaration in stride 0 attributes\n");
break;
......
......@@ -29,13 +29,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_decl);
#define GLINFO_LOCATION This->wineD3DDevice->adapter->gl_info
static void dump_wined3dvertexelement(const WINED3DVERTEXELEMENT *element) {
TRACE(" Stream: %d\n", element->Stream);
TRACE(" Offset: %d\n", element->Offset);
TRACE(" Type: %s (%#x)\n", debug_d3ddecltype(element->Type), element->Type);
TRACE(" Method: %s (%#x)\n", debug_d3ddeclmethod(element->Method), element->Method);
TRACE(" Usage: %s (%#x)\n", debug_d3ddeclusage(element->Usage), element->Usage);
TRACE("Usage index: %d\n", element->UsageIndex);
TRACE(" Register: %d\n", element->Reg);
TRACE(" format: %s (%#x)\n", debug_d3dformat(element->format), element->format);
TRACE(" input_slot: %u\n", element->input_slot);
TRACE(" offset: %u\n", element->offset);
TRACE("output_slot: %u\n", element->output_slot);
TRACE(" method: %s (%#x)\n", debug_d3ddeclmethod(element->method), element->method);
TRACE(" usage: %s (%#x)\n", debug_d3ddeclusage(element->usage), element->usage);
TRACE(" usage_idx: %u\n", element->usage_idx);
}
/* *******************************************
......@@ -104,82 +104,82 @@ static HRESULT WINAPI IWineD3DVertexDeclarationImpl_GetDevice(IWineD3DVertexDecl
static BOOL declaration_element_valid_ffp(const WINED3DVERTEXELEMENT *element)
{
switch(element->Usage)
switch(element->usage)
{
case WINED3DDECLUSAGE_POSITION:
case WINED3DDECLUSAGE_POSITIONT:
switch(element->Type)
switch(element->format)
{
case WINED3DDECLTYPE_FLOAT2:
case WINED3DDECLTYPE_FLOAT3:
case WINED3DDECLTYPE_FLOAT4:
case WINED3DDECLTYPE_SHORT2:
case WINED3DDECLTYPE_SHORT4:
case WINED3DDECLTYPE_FLOAT16_2:
case WINED3DDECLTYPE_FLOAT16_4:
case WINED3DFMT_R32G32_FLOAT:
case WINED3DFMT_R32G32B32_FLOAT:
case WINED3DFMT_R32G32B32A32_FLOAT:
case WINED3DFMT_R16G16_SINT:
case WINED3DFMT_R16G16B16A16_SINT:
case WINED3DFMT_R16G16_FLOAT:
case WINED3DFMT_R16G16B16A16_FLOAT:
return TRUE;
default:
return FALSE;
}
case WINED3DDECLUSAGE_BLENDWEIGHT:
switch(element->Type)
switch(element->format)
{
case WINED3DDECLTYPE_FLOAT1:
case WINED3DDECLTYPE_FLOAT2:
case WINED3DDECLTYPE_FLOAT3:
case WINED3DDECLTYPE_FLOAT4:
case WINED3DDECLTYPE_D3DCOLOR:
case WINED3DDECLTYPE_UBYTE4:
case WINED3DDECLTYPE_SHORT2:
case WINED3DDECLTYPE_SHORT4:
case WINED3DDECLTYPE_FLOAT16_2:
case WINED3DDECLTYPE_FLOAT16_4:
case WINED3DFMT_R32_FLOAT:
case WINED3DFMT_R32G32_FLOAT:
case WINED3DFMT_R32G32B32_FLOAT:
case WINED3DFMT_R32G32B32A32_FLOAT:
case WINED3DFMT_A8R8G8B8:
case WINED3DFMT_R8G8B8A8_UINT:
case WINED3DFMT_R16G16_SINT:
case WINED3DFMT_R16G16B16A16_SINT:
case WINED3DFMT_R16G16_FLOAT:
case WINED3DFMT_R16G16B16A16_FLOAT:
return TRUE;
default:
return FALSE;
}
case WINED3DDECLUSAGE_NORMAL:
switch(element->Type)
switch(element->format)
{
case WINED3DDECLTYPE_FLOAT3:
case WINED3DDECLTYPE_FLOAT4:
case WINED3DDECLTYPE_SHORT4:
case WINED3DDECLTYPE_FLOAT16_4:
case WINED3DFMT_R32G32B32_FLOAT:
case WINED3DFMT_R32G32B32A32_FLOAT:
case WINED3DFMT_R16G16B16A16_SINT:
case WINED3DFMT_R16G16B16A16_FLOAT:
return TRUE;
default:
return FALSE;
}
case WINED3DDECLUSAGE_TEXCOORD:
switch(element->Type)
switch(element->format)
{
case WINED3DDECLTYPE_FLOAT1:
case WINED3DDECLTYPE_FLOAT2:
case WINED3DDECLTYPE_FLOAT3:
case WINED3DDECLTYPE_FLOAT4:
case WINED3DDECLTYPE_SHORT2:
case WINED3DDECLTYPE_SHORT4:
case WINED3DDECLTYPE_FLOAT16_2:
case WINED3DDECLTYPE_FLOAT16_4:
case WINED3DFMT_R32_FLOAT:
case WINED3DFMT_R32G32_FLOAT:
case WINED3DFMT_R32G32B32_FLOAT:
case WINED3DFMT_R32G32B32A32_FLOAT:
case WINED3DFMT_R16G16_SINT:
case WINED3DFMT_R16G16B16A16_SINT:
case WINED3DFMT_R16G16_FLOAT:
case WINED3DFMT_R16G16B16A16_FLOAT:
return TRUE;
default:
return FALSE;
}
case WINED3DDECLUSAGE_COLOR:
switch(element->Type)
switch(element->format)
{
case WINED3DDECLTYPE_FLOAT3:
case WINED3DDECLTYPE_FLOAT4:
case WINED3DDECLTYPE_D3DCOLOR:
case WINED3DDECLTYPE_UBYTE4:
case WINED3DDECLTYPE_SHORT4:
case WINED3DDECLTYPE_UBYTE4N:
case WINED3DDECLTYPE_SHORT4N:
case WINED3DDECLTYPE_USHORT4N:
case WINED3DDECLTYPE_FLOAT16_4:
case WINED3DFMT_R32G32B32_FLOAT:
case WINED3DFMT_R32G32B32A32_FLOAT:
case WINED3DFMT_A8R8G8B8:
case WINED3DFMT_R8G8B8A8_UINT:
case WINED3DFMT_R16G16B16A16_SINT:
case WINED3DFMT_R8G8B8A8_UNORM:
case WINED3DFMT_R16G16B16A16_SNORM:
case WINED3DFMT_R16G16B16A16_UNORM:
case WINED3DFMT_R16G16B16A16_FLOAT:
return TRUE;
default:
return FALSE;
......@@ -222,14 +222,14 @@ HRESULT vertexdeclaration_init(IWineD3DVertexDeclarationImpl *This,
for (i = 0; i < element_count; ++i) {
struct wined3d_vertex_declaration_element *e = &This->elements[i];
e->type = elements[i].Type;
e->format_desc = getFormatDescEntry(elements[i].format, &This->wineD3DDevice->adapter->gl_info);
e->ffp_valid = declaration_element_valid_ffp(&elements[i]);
e->input_slot = elements[i].Stream;
e->offset = elements[i].Offset;
e->output_slot = elements[i].Reg;
e->method = elements[i].Method;
e->usage = elements[i].Usage;
e->usage_idx = elements[i].UsageIndex;
e->input_slot = elements[i].input_slot;
e->offset = elements[i].offset;
e->output_slot = elements[i].output_slot;
e->method = elements[i].method;
e->usage = elements[i].usage;
e->usage_idx = elements[i].usage_idx;
if (e->usage == WINED3DDECLUSAGE_POSITIONT) This->position_transformed = TRUE;
......@@ -238,9 +238,10 @@ HRESULT vertexdeclaration_init(IWineD3DVertexDeclarationImpl *This,
*/
if (e->input_slot >= MAX_STREAMS) continue;
if (e->type == WINED3DDECLTYPE_UNUSED)
if (!e->format_desc->gl_vtx_format)
{
WARN("The application tries to use WINED3DDECLTYPE_UNUSED, returning E_FAIL\n");
FIXME("The application tries to use an unsupported format (%s), returning E_FAIL\n",
debug_d3dformat(elements[i].format));
/* The caller will release the vdecl, which will free This->elements */
return E_FAIL;
}
......@@ -258,7 +259,7 @@ HRESULT vertexdeclaration_init(IWineD3DVertexDeclarationImpl *This,
isPreLoaded[e->input_slot] = 1;
}
if (e->type == WINED3DDECLTYPE_FLOAT16_2 || e->type == WINED3DDECLTYPE_FLOAT16_4)
if (elements[i].format == WINED3DFMT_R16G16_FLOAT || elements[i].format == WINED3DFMT_R16G16B16A16_FLOAT)
{
if (!GL_SUPPORT(NV_HALF_FLOAT)) This->half_float_conv_needed = TRUE;
}
......
......@@ -3892,15 +3892,6 @@ typedef BOOL (WINAPI * WINED3D_PFNWGLSETPIXELFORMATWINE) (HDC hdc, int iPixelFor
* Structures
****************************************************/
typedef struct _WINED3DGLTYPE {
int d3dType;
GLint size;
GLenum glType;
GLint format;
GLboolean normalized;
int typesize;
} WINED3DGLTYPE;
#define USE_GL_FUNC(type, pfn, ext, replace) type pfn;
typedef struct _WineD3D_GL_Info {
......@@ -3963,9 +3954,6 @@ typedef struct _WineD3D_GL_Info {
WGL_EXT_FUNCS_GEN
struct GlPixelFormatDesc *gl_formats;
/* Vertex data types */
WINED3DGLTYPE glTypeLookup[WINED3DDECLTYPE_UNUSED];
} WineD3D_GL_Info;
#undef USE_GL_FUNC
......
......@@ -209,14 +209,6 @@ const GLenum magLookup_noFilter[WINED3DTEXF_ANISOTROPIC + 1];
extern const struct filter_lookup filter_lookup_nofilter;
extern struct filter_lookup filter_lookup;
void init_type_lookup(WineD3D_GL_Info *gl_info);
#define WINED3D_ATR_TYPE(type) GLINFO_LOCATION.glTypeLookup[type].d3dType
#define WINED3D_ATR_SIZE(type) GLINFO_LOCATION.glTypeLookup[type].size
#define WINED3D_ATR_GLTYPE(type) GLINFO_LOCATION.glTypeLookup[type].glType
#define WINED3D_ATR_FORMAT(type) GLINFO_LOCATION.glTypeLookup[type].format
#define WINED3D_ATR_NORMALIZED(type) GLINFO_LOCATION.glTypeLookup[type].normalized
#define WINED3D_ATR_TYPESIZE(type) GLINFO_LOCATION.glTypeLookup[type].typesize
/* float_16_to_32() and float_32_to_16() (see implementation in
* surface_base.c) convert 16 bit floats in the FLOAT16 data type
* to standard C floats and vice versa. They do not depend on the encoding
......@@ -591,8 +583,8 @@ do { \
/* Trace vector and strided data information */
#define TRACE_VECTOR(name) TRACE( #name "=(%f, %f, %f, %f)\n", name.x, name.y, name.z, name.w);
#define TRACE_STRIDED(si, name) TRACE( #name "=(data:%p, stride:%d, type:%d, vbo %d, stream %u)\n", \
si->elements[name].data, si->elements[name].stride, si->elements[name].d3d_type, \
#define TRACE_STRIDED(si, name) TRACE( #name "=(data:%p, stride:%d, format:%#x, vbo %d, stream %u)\n", \
si->elements[name].data, si->elements[name].stride, si->elements[name].d3d_format, \
si->elements[name].buffer_object, si->elements[name].stream_idx);
/* Defines used for optimizations */
......@@ -670,9 +662,32 @@ enum wined3d_ffp_idx
WINED3D_FFP_TEXCOORD7 = 14,
};
enum wined3d_ffp_emit_idx
{
WINED3D_FFP_EMIT_FLOAT1 = 0,
WINED3D_FFP_EMIT_FLOAT2 = 1,
WINED3D_FFP_EMIT_FLOAT3 = 2,
WINED3D_FFP_EMIT_FLOAT4 = 3,
WINED3D_FFP_EMIT_D3DCOLOR = 4,
WINED3D_FFP_EMIT_UBYTE4 = 5,
WINED3D_FFP_EMIT_SHORT2 = 6,
WINED3D_FFP_EMIT_SHORT4 = 7,
WINED3D_FFP_EMIT_UBYTE4N = 8,
WINED3D_FFP_EMIT_SHORT2N = 9,
WINED3D_FFP_EMIT_SHORT4N = 10,
WINED3D_FFP_EMIT_USHORT2N = 11,
WINED3D_FFP_EMIT_USHORT4N = 12,
WINED3D_FFP_EMIT_UDEC3 = 13,
WINED3D_FFP_EMIT_DEC3N = 14,
WINED3D_FFP_EMIT_FLOAT16_2 = 15,
WINED3D_FFP_EMIT_FLOAT16_4 = 16,
WINED3D_FFP_EMIT_COUNT = 17
};
struct wined3d_stream_info_element
{
WINED3DDECLTYPE d3d_type;
WINED3DFORMAT d3d_format;
enum wined3d_ffp_emit_idx emit_idx;
GLint size;
GLint format;
GLenum type;
......@@ -703,12 +718,12 @@ DWORD get_flexible_vertex_size(DWORD d3dvtVertexType);
typedef void (WINE_GLAPI *glAttribFunc)(const void *data);
typedef void (WINE_GLAPI *glMultiTexCoordFunc)(GLenum unit, const void *data);
extern glAttribFunc position_funcs[WINED3DDECLTYPE_UNUSED];
extern glAttribFunc diffuse_funcs[WINED3DDECLTYPE_UNUSED];
extern glAttribFunc position_funcs[WINED3D_FFP_EMIT_COUNT];
extern glAttribFunc diffuse_funcs[WINED3D_FFP_EMIT_COUNT];
extern glAttribFunc specular_func_3ubv;
extern glAttribFunc specular_funcs[WINED3DDECLTYPE_UNUSED];
extern glAttribFunc normal_funcs[WINED3DDECLTYPE_UNUSED];
extern glMultiTexCoordFunc multi_texcoord_funcs[WINED3DDECLTYPE_UNUSED];
extern glAttribFunc specular_funcs[WINED3D_FFP_EMIT_COUNT];
extern glAttribFunc normal_funcs[WINED3D_FFP_EMIT_COUNT];
extern glMultiTexCoordFunc multi_texcoord_funcs[WINED3D_FFP_EMIT_COUNT];
#define eps 1e-8
......@@ -1747,7 +1762,7 @@ BOOL palette9_changed(IWineD3DSurfaceImpl *This);
struct wined3d_vertex_declaration_element
{
WINED3DDECLTYPE type;
const struct GlPixelFormatDesc *format_desc;
BOOL ffp_valid;
WORD input_slot;
WORD offset;
......@@ -2104,7 +2119,6 @@ const char* debug_d3dresourcetype(WINED3DRESOURCETYPE res);
const char* debug_d3dusage(DWORD usage);
const char* debug_d3dusagequery(DWORD usagequery);
const char* debug_d3ddeclmethod(WINED3DDECLMETHOD method);
const char* debug_d3ddecltype(WINED3DDECLTYPE type);
const char* debug_d3ddeclusage(BYTE usage);
const char* debug_d3dprimitivetype(WINED3DPRIMITIVETYPE PrimitiveType);
const char* debug_d3drenderstate(DWORD state);
......@@ -2539,6 +2553,13 @@ struct GlPixelFormatDesc
WORD depth_size;
WORD stencil_size;
enum wined3d_ffp_emit_idx emit_idx;
GLint component_count;
GLenum gl_vtx_type;
GLint gl_vtx_format;
GLboolean gl_normalized;
unsigned int component_size;
GLint glInternal;
GLint glGammaInternal;
GLint rtInternal;
......
......@@ -190,6 +190,7 @@ typedef enum _WINED3DFORMAT
WINED3DFMT_R10G10B10A2_TYPELESS,
WINED3DFMT_R10G10B10A2_UNORM,
WINED3DFMT_R10G10B10A2_UINT,
WINED3DFMT_R10G10B10A2_SNORM,
WINED3DFMT_R11G11B10_FLOAT,
WINED3DFMT_R8G8B8A8_TYPELESS,
WINED3DFMT_R8G8B8A8_UNORM,
......@@ -824,29 +825,6 @@ typedef enum _WINED3DDECLMETHOD
WINED3DDECLMETHOD_LOOKUPPRESAMPLED = 6
} WINED3DDECLMETHOD;
typedef enum _WINED3DDECLTYPE
{
WINED3DDECLTYPE_FLOAT1 = 0,
WINED3DDECLTYPE_FLOAT2 = 1,
WINED3DDECLTYPE_FLOAT3 = 2,
WINED3DDECLTYPE_FLOAT4 = 3,
WINED3DDECLTYPE_D3DCOLOR = 4,
WINED3DDECLTYPE_UBYTE4 = 5,
WINED3DDECLTYPE_SHORT2 = 6,
WINED3DDECLTYPE_SHORT4 = 7,
/* VS 2.0 */
WINED3DDECLTYPE_UBYTE4N = 8,
WINED3DDECLTYPE_SHORT2N = 9,
WINED3DDECLTYPE_SHORT4N = 10,
WINED3DDECLTYPE_USHORT2N = 11,
WINED3DDECLTYPE_USHORT4N = 12,
WINED3DDECLTYPE_UDEC3 = 13,
WINED3DDECLTYPE_DEC3N = 14,
WINED3DDECLTYPE_FLOAT16_2 = 15,
WINED3DDECLTYPE_FLOAT16_4 = 16,
WINED3DDECLTYPE_UNUSED = 17,
} WINED3DDECLTYPE;
typedef enum _WINED3DDECLUSAGE
{
WINED3DDECLUSAGE_POSITION = 0,
......@@ -1766,14 +1744,14 @@ typedef struct _WINED3DCLIPSTATUS
typedef struct _WINED3DVERTEXELEMENT
{
WORD Stream;
WORD Offset;
BYTE Type;
BYTE Method;
BYTE Usage;
BYTE UsageIndex;
int Reg; /* DirectX 8 */
} WINED3DVERTEXELEMENT, *LPWINED3DVERTEXELEMENT;
WINED3DFORMAT format;
WORD input_slot;
WORD offset;
UINT output_slot; /* D3D 8 & 10 */
BYTE method;
BYTE usage;
BYTE usage_idx;
} WINED3DVERTEXELEMENT;
typedef struct _WINED3DDEVICE_CREATION_PARAMETERS
{
......@@ -1914,9 +1892,9 @@ typedef struct glDescriptor
typedef struct WineDirect3DStridedData
{
const BYTE *lpData; /* Pointer to start of data */
DWORD dwStride; /* Stride between occurrences of this data */
DWORD dwType; /* Type (as in D3DVSDT_TYPE) */
WINED3DFORMAT format; /* Format of the data */
const BYTE *lpData; /* Pointer to start of data */
DWORD dwStride; /* Stride between occurrences of this data */
} WineDirect3DStridedData;
typedef struct WineDirect3DVertexStridedData
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment