Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
030b92a2
Commit
030b92a2
authored
Jun 04, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jun 21, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Remove the FVF codepath from drawprim.
parent
527295e5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
191 deletions
+3
-191
device.c
dlls/wined3d/device.c
+1
-5
drawprim.c
dlls/wined3d/drawprim.c
+0
-164
state.c
dlls/wined3d/state.c
+2
-13
wined3d_private.h
dlls/wined3d/wined3d_private.h
+0
-9
No files found.
dlls/wined3d/device.c
View file @
030b92a2
...
...
@@ -3861,11 +3861,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ProcessVertices(IWineD3DDevice *iface,
*/
This
->
stateBlock
->
streamIsUP
=
FALSE
;
memset
(
&
strided
,
0
,
sizeof
(
strided
));
if
(
This
->
stateBlock
->
vertexDecl
)
{
primitiveDeclarationConvertToStridedData
(
iface
,
FALSE
,
&
strided
,
&
vbo
);
}
else
{
primitiveConvertToStridedData
(
iface
,
&
strided
,
&
vbo
);
}
primitiveDeclarationConvertToStridedData
(
iface
,
FALSE
,
&
strided
,
&
vbo
);
This
->
stateBlock
->
streamIsUP
=
streamWasUP
;
if
(
vbo
||
SrcStartIndex
)
{
...
...
dlls/wined3d/drawprim.c
View file @
030b92a2
...
...
@@ -244,170 +244,6 @@ void primitiveDeclarationConvertToStridedData(
}
}
void
primitiveConvertFVFtoOffset
(
DWORD
thisFVF
,
DWORD
stride
,
BYTE
*
data
,
WineDirect3DVertexStridedData
*
strided
,
GLint
streamVBO
,
UINT
streamNo
)
{
int
numBlends
;
int
numTextures
;
int
textureNo
;
int
coordIdxInfo
=
0x00
;
/* Information on number of coords supplied */
int
numCoords
[
8
];
/* Holding place for WINED3DFVF_TEXTUREFORMATx */
/* Either 3 or 4 floats depending on the FVF */
/* FIXME: Can blending data be in a different stream to the position data?
and if so using the fixed pipeline how do we handle it */
if
(
thisFVF
&
WINED3DFVF_POSITION_MASK
)
{
strided
->
u
.
s
.
position
.
lpData
=
data
;
strided
->
u
.
s
.
position
.
dwType
=
WINED3DDECLTYPE_FLOAT3
;
strided
->
u
.
s
.
position
.
dwStride
=
stride
;
strided
->
u
.
s
.
position
.
VBO
=
streamVBO
;
strided
->
u
.
s
.
position
.
streamNo
=
streamNo
;
data
+=
3
*
sizeof
(
float
);
if
((
thisFVF
&
WINED3DFVF_POSITION_MASK
)
==
WINED3DFVF_XYZRHW
)
{
strided
->
u
.
s
.
position
.
dwType
=
WINED3DDECLTYPE_FLOAT4
;
strided
->
u
.
s
.
position_transformed
=
TRUE
;
data
+=
sizeof
(
float
);
}
else
strided
->
u
.
s
.
position_transformed
=
FALSE
;
}
/* Blending is numBlends * FLOATs followed by a DWORD for UBYTE4 */
/** do we have to Check This->stateBlock->renderState[D3DRS_INDEXEDVERTEXBLENDENABLE] ? */
numBlends
=
1
+
(((
thisFVF
&
WINED3DFVF_XYZB5
)
-
WINED3DFVF_XYZB1
)
>>
1
);
if
(
thisFVF
&
WINED3DFVF_LASTBETA_UBYTE4
)
numBlends
--
;
if
((
thisFVF
&
WINED3DFVF_POSITION_MASK
)
>
WINED3DFVF_XYZRHW
)
{
TRACE
(
"Setting blend Weights to %p
\n
"
,
data
);
strided
->
u
.
s
.
blendWeights
.
lpData
=
data
;
strided
->
u
.
s
.
blendWeights
.
dwType
=
WINED3DDECLTYPE_FLOAT1
+
numBlends
-
1
;
strided
->
u
.
s
.
blendWeights
.
dwStride
=
stride
;
strided
->
u
.
s
.
blendWeights
.
VBO
=
streamVBO
;
strided
->
u
.
s
.
blendWeights
.
streamNo
=
streamNo
;
data
+=
numBlends
*
sizeof
(
FLOAT
);
if
(
thisFVF
&
WINED3DFVF_LASTBETA_UBYTE4
)
{
strided
->
u
.
s
.
blendMatrixIndices
.
lpData
=
data
;
strided
->
u
.
s
.
blendMatrixIndices
.
dwType
=
WINED3DDECLTYPE_UBYTE4
;
strided
->
u
.
s
.
blendMatrixIndices
.
dwStride
=
stride
;
strided
->
u
.
s
.
blendMatrixIndices
.
VBO
=
streamVBO
;
strided
->
u
.
s
.
blendMatrixIndices
.
streamNo
=
streamNo
;
data
+=
sizeof
(
DWORD
);
}
}
/* Normal is always 3 floats */
if
(
thisFVF
&
WINED3DFVF_NORMAL
)
{
strided
->
u
.
s
.
normal
.
lpData
=
data
;
strided
->
u
.
s
.
normal
.
dwType
=
WINED3DDECLTYPE_FLOAT3
;
strided
->
u
.
s
.
normal
.
dwStride
=
stride
;
strided
->
u
.
s
.
normal
.
VBO
=
streamVBO
;
strided
->
u
.
s
.
normal
.
streamNo
=
streamNo
;
data
+=
3
*
sizeof
(
FLOAT
);
}
/* Pointsize is a single float */
if
(
thisFVF
&
WINED3DFVF_PSIZE
)
{
strided
->
u
.
s
.
pSize
.
lpData
=
data
;
strided
->
u
.
s
.
pSize
.
dwType
=
WINED3DDECLTYPE_FLOAT1
;
strided
->
u
.
s
.
pSize
.
dwStride
=
stride
;
strided
->
u
.
s
.
pSize
.
VBO
=
streamVBO
;
strided
->
u
.
s
.
pSize
.
streamNo
=
streamNo
;
data
+=
sizeof
(
FLOAT
);
}
/* Diffuse is 4 unsigned bytes */
if
(
thisFVF
&
WINED3DFVF_DIFFUSE
)
{
strided
->
u
.
s
.
diffuse
.
lpData
=
data
;
strided
->
u
.
s
.
diffuse
.
dwType
=
WINED3DDECLTYPE_SHORT4
;
strided
->
u
.
s
.
diffuse
.
dwStride
=
stride
;
strided
->
u
.
s
.
diffuse
.
VBO
=
streamVBO
;
strided
->
u
.
s
.
diffuse
.
streamNo
=
streamNo
;
data
+=
sizeof
(
DWORD
);
}
/* Specular is 4 unsigned bytes */
if
(
thisFVF
&
WINED3DFVF_SPECULAR
)
{
strided
->
u
.
s
.
specular
.
lpData
=
data
;
strided
->
u
.
s
.
specular
.
dwType
=
WINED3DDECLTYPE_SHORT4
;
strided
->
u
.
s
.
specular
.
dwStride
=
stride
;
strided
->
u
.
s
.
specular
.
VBO
=
streamVBO
;
strided
->
u
.
s
.
specular
.
streamNo
=
streamNo
;
data
+=
sizeof
(
DWORD
);
}
/* Texture coords */
numTextures
=
(
thisFVF
&
WINED3DFVF_TEXCOUNT_MASK
)
>>
WINED3DFVF_TEXCOUNT_SHIFT
;
coordIdxInfo
=
(
thisFVF
&
0x00FF0000
)
>>
16
;
/* 16 is from definition of WINED3DFVF_TEXCOORDSIZE1, and is 8 (0-7 stages) * 2bits long */
/* numTextures indicates the number of texture coordinates supplied */
/* However, the first set may not be for stage 0 texture - it all */
/* depends on WINED3DTSS_TEXCOORDINDEX. */
/* The number of bytes for each coordinate set is based off */
/* WINED3DFVF_TEXCOORDSIZEn, which are the bottom 2 bits */
/* So, for each supplied texture extract the coords */
for
(
textureNo
=
0
;
textureNo
<
numTextures
;
++
textureNo
)
{
strided
->
u
.
s
.
texCoords
[
textureNo
].
lpData
=
data
;
strided
->
u
.
s
.
texCoords
[
textureNo
].
dwType
=
WINED3DDECLTYPE_FLOAT1
;
strided
->
u
.
s
.
texCoords
[
textureNo
].
dwStride
=
stride
;
strided
->
u
.
s
.
texCoords
[
textureNo
].
VBO
=
streamVBO
;
strided
->
u
.
s
.
texCoords
[
textureNo
].
streamNo
=
streamNo
;
numCoords
[
textureNo
]
=
coordIdxInfo
&
0x03
;
/* Always one set */
data
+=
sizeof
(
float
);
if
(
numCoords
[
textureNo
]
!=
WINED3DFVF_TEXTUREFORMAT1
)
{
strided
->
u
.
s
.
texCoords
[
textureNo
].
dwType
=
WINED3DDECLTYPE_FLOAT2
;
data
+=
sizeof
(
float
);
if
(
numCoords
[
textureNo
]
!=
WINED3DFVF_TEXTUREFORMAT2
)
{
strided
->
u
.
s
.
texCoords
[
textureNo
].
dwType
=
WINED3DDECLTYPE_FLOAT3
;
data
+=
sizeof
(
float
);
if
(
numCoords
[
textureNo
]
!=
WINED3DFVF_TEXTUREFORMAT3
)
{
strided
->
u
.
s
.
texCoords
[
textureNo
].
dwType
=
WINED3DDECLTYPE_FLOAT4
;
data
+=
sizeof
(
float
);
}
}
}
coordIdxInfo
=
coordIdxInfo
>>
2
;
/* Drop bottom two bits */
}
}
void
primitiveConvertToStridedData
(
IWineD3DDevice
*
iface
,
WineDirect3DVertexStridedData
*
strided
,
BOOL
*
fixup
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
GLint
streamVBO
=
0
;
DWORD
stride
=
This
->
stateBlock
->
streamStride
[
0
];
BYTE
*
data
=
NULL
;
DWORD
thisFVF
=
0
;
/* Retrieve appropriate FVF */
thisFVF
=
This
->
stateBlock
->
fvf
;
/* Handle memory passed directly as well as vertex buffers */
if
(
This
->
stateBlock
->
streamIsUP
)
{
streamVBO
=
0
;
data
=
(
BYTE
*
)
This
->
stateBlock
->
streamSource
[
0
];
}
else
{
/* The for loop should iterate through here only once per stream, so we don't need magic to prevent double loading
* buffers
*/
data
=
IWineD3DVertexBufferImpl_GetMemory
(
This
->
stateBlock
->
streamSource
[
0
],
0
,
&
streamVBO
);
if
(
fixup
)
{
if
(
streamVBO
!=
0
)
*
fixup
=
TRUE
;
}
}
VTRACE
((
"FVF for stream 0 is %lx
\n
"
,
thisFVF
));
/* Now convert the stream into pointers */
primitiveConvertFVFtoOffset
(
thisFVF
,
stride
,
data
,
strided
,
streamVBO
,
0
);
/* Now call PreLoad on the vertex buffer. In the very rare case
* that the buffers stopps converting PreLoad will dirtify the VDECL again.
* The vertex buffer can now use the strided structure in the device instead of finding its
* own again.
*/
if
(
!
This
->
stateBlock
->
streamIsUP
)
{
IWineD3DVertexBuffer_PreLoad
(
This
->
stateBlock
->
streamSource
[
0
]);
}
}
static
void
drawStridedFast
(
IWineD3DDevice
*
iface
,
UINT
numberOfVertices
,
GLenum
glPrimitiveType
,
const
void
*
idxData
,
short
idxSize
,
ULONG
minIndex
,
ULONG
startIdx
,
ULONG
startVertex
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
...
...
dlls/wined3d/state.c
View file @
030b92a2
...
...
@@ -3067,7 +3067,7 @@ static inline void handleStreams(IWineD3DStateBlockImpl *stateblock, BOOL useVer
if
(
TRACE_ON
(
d3d
))
{
drawPrimitiveTraceDataLocations
(
dataLocations
);
}
}
else
if
(
stateblock
->
vertexDecl
)
{
}
else
{
/* Note: This is a fixed function or shader codepath.
* This means it must handle both types of strided data.
* Shaders must go through here to zero the strided data, even if they
...
...
@@ -3077,18 +3077,7 @@ static inline void handleStreams(IWineD3DStateBlockImpl *stateblock, BOOL useVer
memset
(
dataLocations
,
0
,
sizeof
(
*
dataLocations
));
primitiveDeclarationConvertToStridedData
((
IWineD3DDevice
*
)
device
,
useVertexShaderFunction
,
dataLocations
,
&
fixup
);
}
else
{
/* Note: This codepath is not reachable from d3d9 (see fvf->decl9 conversion)
* It is reachable through d3d8, but only for fixed-function.
* It will not work properly for shaders.
*/
TRACE
(
"================ FVF ===================
\n
"
);
memset
(
dataLocations
,
0
,
sizeof
(
*
dataLocations
));
primitiveConvertToStridedData
((
IWineD3DDevice
*
)
device
,
dataLocations
,
&
fixup
);
if
(
TRACE_ON
(
d3d
))
{
drawPrimitiveTraceDataLocations
(
dataLocations
);
}
}
}
if
(
dataLocations
->
u
.
s
.
position_transformed
)
{
useVertexShaderFunction
=
FALSE
;
...
...
dlls/wined3d/wined3d_private.h
View file @
030b92a2
...
...
@@ -410,21 +410,12 @@ void drawPrimitive(IWineD3DDevice *iface,
const
void
*
idxData
,
int
minIndex
);
void
primitiveConvertToStridedData
(
IWineD3DDevice
*
iface
,
WineDirect3DVertexStridedData
*
strided
,
BOOL
*
fixup
);
void
primitiveDeclarationConvertToStridedData
(
IWineD3DDevice
*
iface
,
BOOL
useVertexShaderFunction
,
WineDirect3DVertexStridedData
*
strided
,
BOOL
*
fixup
);
void
primitiveConvertFVFtoOffset
(
DWORD
thisFVF
,
DWORD
stride
,
BYTE
*
data
,
WineDirect3DVertexStridedData
*
strided
,
GLint
streamVBO
,
UINT
streamNo
);
DWORD
get_flexible_vertex_size
(
DWORD
d3dvtVertexType
);
void
blt_to_drawable
(
IWineD3DDeviceImpl
*
This
,
IWineD3DSurfaceImpl
*
surface
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment