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
06e51c21
Commit
06e51c21
authored
Aug 03, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Aug 08, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Determine used streams at vdecl creation.
parent
ca0d92f3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
11 deletions
+28
-11
drawprim.c
dlls/wined3d/drawprim.c
+3
-10
vertexdeclaration.c
dlls/wined3d/vertexdeclaration.c
+22
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+3
-0
No files found.
dlls/wined3d/drawprim.c
View file @
06e51c21
...
...
@@ -156,10 +156,8 @@ void primitiveDeclarationConvertToStridedData(
WINED3DVERTEXELEMENT
*
element
;
DWORD
stride
;
int
reg
;
char
isPreLoaded
[
MAX_STREAMS
];
DWORD
preLoadStreams
[
MAX_STREAMS
],
numPreloadStreams
=
0
;
memset
(
isPreLoaded
,
0
,
sizeof
(
isPreLoaded
));
DWORD
numPreloadStreams
=
This
->
stateBlock
->
streamIsUP
?
0
:
vertexDeclaration
->
num_streams
;
DWORD
*
streams
=
vertexDeclaration
->
streams
;
/* Check for transformed vertices, disable vertex shader if present */
strided
->
u
.
s
.
position_transformed
=
FALSE
;
...
...
@@ -191,11 +189,6 @@ void primitiveDeclarationConvertToStridedData(
data
=
(
BYTE
*
)
This
->
stateBlock
->
streamSource
[
element
->
Stream
];
}
else
{
TRACE
(
"Stream isn't up %d, %p
\n
"
,
element
->
Stream
,
This
->
stateBlock
->
streamSource
[
element
->
Stream
]);
if
(
!
isPreLoaded
[
element
->
Stream
])
{
preLoadStreams
[
numPreloadStreams
]
=
element
->
Stream
;
numPreloadStreams
++
;
isPreLoaded
[
element
->
Stream
]
=
1
;
}
data
=
IWineD3DVertexBufferImpl_GetMemory
(
This
->
stateBlock
->
streamSource
[
element
->
Stream
],
0
,
&
streamVBO
);
if
(
fixup
)
{
if
(
streamVBO
!=
0
)
*
fixup
=
TRUE
;
...
...
@@ -242,7 +235,7 @@ void primitiveDeclarationConvertToStridedData(
* once in there.
*/
for
(
i
=
0
;
i
<
numPreloadStreams
;
i
++
)
{
IWineD3DVertexBuffer_PreLoad
(
This
->
stateBlock
->
streamSource
[
preLoadS
treams
[
i
]]);
IWineD3DVertexBuffer_PreLoad
(
This
->
stateBlock
->
streamSource
[
s
treams
[
i
]]);
}
}
...
...
dlls/wined3d/vertexdeclaration.c
View file @
06e51c21
...
...
@@ -120,11 +120,13 @@ static HRESULT WINAPI IWineD3DVertexDeclarationImpl_SetDeclaration(IWineD3DVerte
const
WINED3DVERTEXELEMENT
*
elements
,
size_t
element_count
)
{
IWineD3DVertexDeclarationImpl
*
This
=
(
IWineD3DVertexDeclarationImpl
*
)
iface
;
HRESULT
hr
=
WINED3D_OK
;
int
i
;
char
isPreLoaded
[
MAX_STREAMS
];
TRACE
(
"(%p) : d3d version %d
\n
"
,
This
,
((
IWineD3DImpl
*
)
This
->
wineD3DDevice
->
wineD3D
)
->
dxVersion
);
memset
(
isPreLoaded
,
0
,
sizeof
(
isPreLoaded
));
if
(
TRACE_ON
(
d3d_decl
))
{
int
i
;
for
(
i
=
0
;
i
<
element_count
;
++
i
)
{
dump_wined3dvertexelement
(
elements
+
i
);
}
...
...
@@ -139,6 +141,25 @@ static HRESULT WINAPI IWineD3DVertexDeclarationImpl_SetDeclaration(IWineD3DVerte
CopyMemory
(
This
->
pDeclarationWine
,
elements
,
sizeof
(
WINED3DVERTEXELEMENT
)
*
element_count
);
}
/* Do some static analysis on the elements to make reading the declaration more comfortable
* for the drawing code
*
* First, find the Streams used in the declaration. The vertex buffers have to be loaded
* when drawing.
*/
This
->
num_streams
=
0
;
for
(
i
=
0
;
i
<
element_count
;
++
i
)
{
/* Filter tesselation pseudo streams*/
if
(
This
->
pDeclarationWine
[
i
].
Stream
>=
MAX_STREAMS
)
continue
;
if
(
!
isPreLoaded
[
This
->
pDeclarationWine
[
i
].
Stream
])
{
This
->
streams
[
This
->
num_streams
]
=
This
->
pDeclarationWine
[
i
].
Stream
;
This
->
num_streams
++
;
isPreLoaded
[
This
->
pDeclarationWine
[
i
].
Stream
]
=
1
;
}
}
TRACE
(
"Returning
\n
"
);
return
hr
;
}
...
...
dlls/wined3d/wined3d_private.h
View file @
06e51c21
...
...
@@ -1225,6 +1225,9 @@ typedef struct IWineD3DVertexDeclarationImpl {
WINED3DVERTEXELEMENT
*
pDeclarationWine
;
UINT
declarationWNumElements
;
DWORD
streams
[
MAX_STREAMS
];
UINT
num_streams
;
}
IWineD3DVertexDeclarationImpl
;
extern
const
IWineD3DVertexDeclarationVtbl
IWineD3DVertexDeclaration_Vtbl
;
...
...
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