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
1835e2f5
Commit
1835e2f5
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: Add support for ARB_instanced_arrays.
parent
52c6abb4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
5 deletions
+26
-5
directx.c
dlls/wined3d/directx.c
+1
-0
drawprim.c
dlls/wined3d/drawprim.c
+5
-2
state.c
dlls/wined3d/state.c
+17
-3
wined3d_gl.h
dlls/wined3d/wined3d_gl.h
+3
-0
No files found.
dlls/wined3d/directx.c
View file @
1835e2f5
...
...
@@ -105,6 +105,7 @@ static const struct wined3d_extension_map gl_extension_map[] =
{
"GL_ARB_geometry_shader4"
,
ARB_GEOMETRY_SHADER4
},
{
"GL_ARB_half_float_pixel"
,
ARB_HALF_FLOAT_PIXEL
},
{
"GL_ARB_half_float_vertex"
,
ARB_HALF_FLOAT_VERTEX
},
{
"GL_ARB_instanced_arrays"
,
ARB_INSTANCED_ARRAYS
,
},
{
"GL_ARB_map_buffer_alignment"
,
ARB_MAP_BUFFER_ALIGNMENT
},
{
"GL_ARB_map_buffer_range"
,
ARB_MAP_BUFFER_RANGE
},
{
"GL_ARB_multisample"
,
ARB_MULTISAMPLE
},
/* needs GLX_ARB_MULTISAMPLE as well */
...
...
dlls/wined3d/drawprim.c
View file @
1835e2f5
...
...
@@ -676,6 +676,9 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
struct
wined3d_stream_info
stridedlcl
;
UINT
idx_size
=
0
;
if
(
device
->
instance_count
)
instance_count
=
device
->
instance_count
;
if
(
indexed
)
{
if
(
!
state
->
user_stream
)
...
...
@@ -753,11 +756,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_count
)
else
if
(
!
gl_info
->
supported
[
ARB_INSTANCED_ARRAYS
]
&&
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
,
device
->
instance_count
);
idx_data
,
idx_size
,
start_idx
,
base_vertex_index
,
instance_count
);
}
else
{
...
...
dlls/wined3d/state.c
View file @
1835e2f5
...
...
@@ -4101,6 +4101,8 @@ static inline void unload_numbered_array(struct wined3d_context *context, int i)
GL_EXTCALL
(
glDisableVertexAttribArrayARB
(
i
));
checkGLcall
(
"glDisableVertexAttribArrayARB(reg)"
);
if
(
gl_info
->
supported
[
ARB_INSTANCED_ARRAYS
])
GL_EXTCALL
(
glVertexAttribDivisorARB
(
i
,
0
));
context
->
numbered_array_mask
&=
~
(
1
<<
i
);
}
...
...
@@ -4143,13 +4145,25 @@ static void load_numbered_arrays(struct wined3d_context *context,
stream
=
&
state
->
streams
[
stream_info
->
elements
[
i
].
stream_idx
];
/* 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
);
continue
;
if
(
!
gl_info
->
supported
[
ARB_INSTANCED_ARRAYS
])
{
/* Unload instanced arrays, they will be loaded using
* immediate mode instead. */
if
(
context
->
numbered_array_mask
&
(
1
<<
i
))
unload_numbered_array
(
context
,
i
);
continue
;
}
GL_EXTCALL
(
glVertexAttribDivisorARB
(
i
,
1
));
}
else
if
(
gl_info
->
supported
[
ARB_INSTANCED_ARRAYS
])
{
GL_EXTCALL
(
glVertexAttribDivisorARB
(
i
,
0
));
}
TRACE_
(
d3d_shader
)(
"Loading array %u [VBO=%u]
\n
"
,
i
,
stream_info
->
elements
[
i
].
data
.
buffer_object
);
...
...
dlls/wined3d/wined3d_gl.h
View file @
1835e2f5
...
...
@@ -57,6 +57,7 @@ enum wined3d_gl_extension
ARB_GEOMETRY_SHADER4
,
ARB_HALF_FLOAT_PIXEL
,
ARB_HALF_FLOAT_VERTEX
,
ARB_INSTANCED_ARRAYS
,
ARB_MAP_BUFFER_ALIGNMENT
,
ARB_MAP_BUFFER_RANGE
,
ARB_MULTISAMPLE
,
...
...
@@ -214,6 +215,8 @@ enum wined3d_gl_extension
USE_GL_FUNC(glFramebufferTextureFaceARB) \
USE_GL_FUNC(glFramebufferTextureLayerARB) \
USE_GL_FUNC(glProgramParameteriARB) \
/* GL_ARB_instanced_arrays */
\
USE_GL_FUNC(glVertexAttribDivisorARB) \
/* GL_ARB_map_buffer_range */
\
USE_GL_FUNC(glFlushMappedBufferRange) \
USE_GL_FUNC(glMapBufferRange) \
...
...
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