Commit 51db33ca authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Move get_flexible_vertex_size() to device.c.

parent 454f8798
......@@ -3016,6 +3016,36 @@ unsigned int CDECL wined3d_device_get_max_frame_latency(const struct wined3d_dev
return device->max_frame_latency;
}
static DWORD get_flexible_vertex_size(DWORD d3dvtVertexType)
{
DWORD size = 0;
int i;
int numTextures = (d3dvtVertexType & WINED3DFVF_TEXCOUNT_MASK) >> WINED3DFVF_TEXCOUNT_SHIFT;
if (d3dvtVertexType & WINED3DFVF_NORMAL) size += 3 * sizeof(float);
if (d3dvtVertexType & WINED3DFVF_DIFFUSE) size += sizeof(DWORD);
if (d3dvtVertexType & WINED3DFVF_SPECULAR) size += sizeof(DWORD);
if (d3dvtVertexType & WINED3DFVF_PSIZE) size += sizeof(DWORD);
switch (d3dvtVertexType & WINED3DFVF_POSITION_MASK)
{
case WINED3DFVF_XYZ: size += 3 * sizeof(float); break;
case WINED3DFVF_XYZRHW: size += 4 * sizeof(float); break;
case WINED3DFVF_XYZB1: size += 4 * sizeof(float); break;
case WINED3DFVF_XYZB2: size += 5 * sizeof(float); break;
case WINED3DFVF_XYZB3: size += 6 * sizeof(float); break;
case WINED3DFVF_XYZB4: size += 7 * sizeof(float); break;
case WINED3DFVF_XYZB5: size += 8 * sizeof(float); break;
case WINED3DFVF_XYZW: size += 4 * sizeof(float); break;
default: FIXME("Unexpected position mask %#x.\n", d3dvtVertexType & WINED3DFVF_POSITION_MASK);
}
for (i = 0; i < numTextures; i++)
{
size += GET_TEXCOORD_SIZE_FROM_FVF(d3dvtVertexType, i) * sizeof(float);
}
return size;
}
/* Context activation is done by the caller. */
#define copy_and_next(dest, src, size) memcpy(dest, src, size); dest += (size)
static HRESULT process_vertices_strided(const struct wined3d_device *device, DWORD dwDestIndex, DWORD dwCount,
......
......@@ -5563,33 +5563,6 @@ void multiply_matrix(struct wined3d_matrix *dst, const struct wined3d_matrix *sr
*dst = tmp;
}
DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) {
DWORD size = 0;
int i;
int numTextures = (d3dvtVertexType & WINED3DFVF_TEXCOUNT_MASK) >> WINED3DFVF_TEXCOUNT_SHIFT;
if (d3dvtVertexType & WINED3DFVF_NORMAL) size += 3 * sizeof(float);
if (d3dvtVertexType & WINED3DFVF_DIFFUSE) size += sizeof(DWORD);
if (d3dvtVertexType & WINED3DFVF_SPECULAR) size += sizeof(DWORD);
if (d3dvtVertexType & WINED3DFVF_PSIZE) size += sizeof(DWORD);
switch (d3dvtVertexType & WINED3DFVF_POSITION_MASK) {
case WINED3DFVF_XYZ: size += 3 * sizeof(float); break;
case WINED3DFVF_XYZRHW: size += 4 * sizeof(float); break;
case WINED3DFVF_XYZB1: size += 4 * sizeof(float); break;
case WINED3DFVF_XYZB2: size += 5 * sizeof(float); break;
case WINED3DFVF_XYZB3: size += 6 * sizeof(float); break;
case WINED3DFVF_XYZB4: size += 7 * sizeof(float); break;
case WINED3DFVF_XYZB5: size += 8 * sizeof(float); break;
case WINED3DFVF_XYZW: size += 4 * sizeof(float); break;
default: ERR("Unexpected position mask\n");
}
for (i = 0; i < numTextures; i++) {
size += GET_TEXCOORD_SIZE_FROM_FVF(d3dvtVertexType, i) * sizeof(float);
}
return size;
}
unsigned int wined3d_max_compat_varyings(const struct wined3d_gl_info *gl_info)
{
/* On core profile we have to also count diffuse and specular colors and the
......
......@@ -1540,7 +1540,6 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
const struct wined3d_draw_parameters *draw_parameters) DECLSPEC_HIDDEN;
void dispatch_compute(struct wined3d_device *device, const struct wined3d_state *state,
const struct wined3d_dispatch_parameters *dispatch_parameters) DECLSPEC_HIDDEN;
DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) DECLSPEC_HIDDEN;
#define eps 1e-8f
......
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