Skip to content

Commit

Permalink
[WINESYNC] wined3d: Move get_flexible_vertex_size() to device.c.
Browse files Browse the repository at this point in the history
Signed-off-by: Józef Kucia <[email protected]>
Signed-off-by: Henri Verbeet <[email protected]>
Signed-off-by: Alexandre Julliard <[email protected]>

wine commit id 51db33ca070e16f7e2f3fc6e0c7cb9e432c0e0da by Józef Kucia <[email protected]>
  • Loading branch information
winesync authored and DarkFire01 committed Sep 14, 2023
1 parent 811a744 commit 38699e9
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 39 deletions.
30 changes: 30 additions & 0 deletions dll/directx/wine/wined3d/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -3043,6 +3043,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,
Expand Down
10 changes: 0 additions & 10 deletions dll/directx/wine/wined3d/stateblock.c.rej

This file was deleted.

27 changes: 0 additions & 27 deletions dll/directx/wine/wined3d/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -5873,33 +5873,6 @@ void transpose_matrix(struct wined3d_matrix *out, const struct wined3d_matrix *m
*out = temp;
}

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
Expand Down
1 change: 0 additions & 1 deletion dll/directx/wine/wined3d/wined3d_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -1549,7 +1549,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

Expand Down
2 changes: 1 addition & 1 deletion sdk/tools/winesync/wined3d.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ directories:
files:
include/wine/wined3d.h: sdk/include/reactos/wine/wined3d.h
tags:
wine: 454f87980a8e19f20c56755a686406baf4dd203e
wine: 51db33ca070e16f7e2f3fc6e0c7cb9e432c0e0da

0 comments on commit 38699e9

Please sign in to comment.