Module: wine Branch: master Commit: 51db33ca070e16f7e2f3fc6e0c7cb9e432c0e0da URL: https://source.winehq.org/git/wine.git/?a=commit;h=51db33ca070e16f7e2f3fc6e0...
Author: Józef Kucia jkucia@codeweavers.com Date: Mon Sep 17 11:06:27 2018 +0200
wined3d: Move get_flexible_vertex_size() to device.c.
Signed-off-by: Józef Kucia jkucia@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/wined3d/device.c | 30 ++++++++++++++++++++++++++++++ dlls/wined3d/utils.c | 27 --------------------------- dlls/wined3d/wined3d_private.h | 1 - 3 files changed, 30 insertions(+), 28 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index f6a0b39..667b90b 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 b19f18f..db27270 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 aea874f..19341a5 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