Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
52c6abb4
Commit
52c6abb4
authored
Dec 02, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 03, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Resolve the instance count for instanced arrays in load_numbered_arrays().
parent
ff11a32f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
28 deletions
+13
-28
drawprim.c
dlls/wined3d/drawprim.c
+7
-23
state.c
dlls/wined3d/state.c
+4
-3
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-2
No files found.
dlls/wined3d/drawprim.c
View file @
52c6abb4
...
...
@@ -494,12 +494,12 @@ static void drawStridedSlowVs(const struct wined3d_gl_info *gl_info, const struc
/* GL locking is done by the caller */
static
void
drawStridedInstanced
(
const
struct
wined3d_gl_info
*
gl_info
,
const
struct
wined3d_state
*
state
,
const
struct
wined3d_stream_info
*
si
,
UINT
numberOfVertices
,
GLenum
glPrimitiveType
,
const
void
*
idxData
,
UINT
idxSize
,
UINT
startIdx
,
UINT
base_vertex_index
)
const
void
*
idxData
,
UINT
idxSize
,
UINT
startIdx
,
UINT
base_vertex_index
,
UINT
instance_count
)
{
UINT
numInstances
=
0
,
i
;
int
numInstancedAttribs
=
0
,
j
;
UINT
instancedData
[
sizeof
(
si
->
elements
)
/
sizeof
(
*
si
->
elements
)
/* 16 */
];
GLenum
idxtype
=
idxSize
==
2
?
GL_UNSIGNED_SHORT
:
GL_UNSIGNED_INT
;
UINT
i
;
if
(
!
idxSize
)
{
...
...
@@ -513,22 +513,6 @@ static void drawStridedInstanced(const struct wined3d_gl_info *gl_info, const st
return
;
}
/* First, figure out how many instances we have to draw */
for
(
i
=
0
;
i
<
MAX_STREAMS
;
++
i
)
{
/* Look at the streams and take the first one which matches */
if
(
state
->
streams
[
i
].
buffer
&&
((
state
->
streams
[
i
].
flags
&
WINED3DSTREAMSOURCE_INSTANCEDATA
)
||
(
state
->
streams
[
i
].
flags
&
WINED3DSTREAMSOURCE_INDEXEDDATA
)))
{
/* Use the specified number of instances from the first matched
* stream. A streamFreq of 0 (with INSTANCEDATA or INDEXEDDATA)
* is handled as 1. See d3d9/tests/visual.c-> stream_test(). */
numInstances
=
state
->
streams
[
i
].
frequency
?
state
->
streams
[
i
].
frequency
:
1
;
break
;
}
}
for
(
i
=
0
;
i
<
sizeof
(
si
->
elements
)
/
sizeof
(
*
si
->
elements
);
++
i
)
{
if
(
!
(
si
->
use_map
&
(
1
<<
i
)))
continue
;
...
...
@@ -540,8 +524,8 @@ static void drawStridedInstanced(const struct wined3d_gl_info *gl_info, const st
}
}
/* now draw numInstances instances :-) */
for
(
i
=
0
;
i
<
numInstances
;
i
++
)
{
for
(
i
=
0
;
i
<
instance_count
;
++
i
)
{
/* Specify the instanced attributes using immediate mode calls */
for
(
j
=
0
;
j
<
numInstancedAttribs
;
j
++
)
{
const
BYTE
*
ptr
=
si
->
elements
[
instancedData
[
j
]].
data
.
addr
...
...
@@ -769,11 +753,11 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
glPrimType
,
idx_data
,
idx_size
,
start_idx
);
}
}
else
if
(
device
->
instance
dDraw
)
else
if
(
device
->
instance
_count
)
{
/* Instancing emulation with mixing immediate mode and arrays */
drawStridedInstanced
(
gl_info
,
state
,
stream_info
,
index_count
,
glPrimType
,
idx_data
,
idx_size
,
start_idx
,
base_vertex_index
);
drawStridedInstanced
(
gl_info
,
state
,
stream_info
,
index_count
,
glPrimType
,
idx_data
,
idx_size
,
start_idx
,
base_vertex_index
,
device
->
instance_count
);
}
else
{
...
...
dlls/wined3d/state.c
View file @
52c6abb4
...
...
@@ -4126,7 +4126,7 @@ static void load_numbered_arrays(struct wined3d_context *context,
int
i
;
/* Default to no instancing */
device
->
instance
dDraw
=
FALSE
;
device
->
instance
_count
=
0
;
for
(
i
=
0
;
i
<
MAX_ATTRIBS
;
i
++
)
{
...
...
@@ -4146,8 +4146,9 @@ static void load_numbered_arrays(struct wined3d_context *context,
/* Do not load instance data. It will be specified using glTexCoord by drawprim */
if
(
stream
->
flags
&
WINED3DSTREAMSOURCE_INSTANCEDATA
)
{
if
(
!
device
->
instance_count
)
device
->
instance_count
=
state
->
streams
[
0
].
frequency
?
state
->
streams
[
0
].
frequency
:
1
;
if
(
context
->
numbered_array_mask
&
(
1
<<
i
))
unload_numbered_array
(
context
,
i
);
device
->
instancedDraw
=
TRUE
;
continue
;
}
...
...
@@ -4290,7 +4291,7 @@ static void load_vertex_data(const struct wined3d_context *context,
TRACE
(
"Using fast vertex array code
\n
"
);
/* This is fixed function pipeline only, and the fixed function pipeline doesn't do instancing */
device
->
instance
dDraw
=
FALSE
;
device
->
instance
_count
=
0
;
/* Blend Data ---------------------------------------------- */
if
((
si
->
use_map
&
(
1
<<
WINED3D_FFP_BLENDWEIGHT
))
...
...
dlls/wined3d/wined3d_private.h
View file @
52c6abb4
...
...
@@ -1724,6 +1724,7 @@ struct wined3d_device
UINT
vs_version
,
gs_version
,
ps_version
;
DWORD
d3d_vshader_constantF
,
d3d_pshader_constantF
;
/* Advertised d3d caps, not GL ones */
DWORD
vs_clipping
;
UINT
instance_count
;
WORD
view_ident
:
1
;
/* true iff view matrix is identity */
WORD
vertexBlendUsed
:
1
;
/* To avoid needless setting of the blend matrices */
...
...
@@ -1734,9 +1735,8 @@ struct wined3d_device
WORD
inScene
:
1
;
/* A flag to check for proper BeginScene / EndScene call pairs */
WORD
softwareVertexProcessing
:
1
;
/* process vertex shaders using software or hardware */
WORD
useDrawStridedSlow
:
1
;
WORD
instancedDraw
:
1
;
WORD
filter_messages
:
1
;
WORD
padding
:
5
;
WORD
padding
:
6
;
BYTE
fixed_function_usage_map
;
/* MAX_TEXTURES, 8 */
...
...
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