diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index f6a0b39cecd..667b90b51bb 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -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, diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index b19f18fea45..db27270ba8a 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -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 diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index aea874f84ea..19341a59b75 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -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