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
ad147d63
Commit
ad147d63
authored
Aug 16, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 16, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Just update a range of constants in walk_constant_heap().
The call overhead from separate calls typically ends up being more expensive than just updating a few more constants.
parent
37d1e8b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
glsl_shader.c
dlls/wined3d/glsl_shader.c
+17
-3
No files found.
dlls/wined3d/glsl_shader.c
View file @
ad147d63
...
...
@@ -507,6 +507,7 @@ static void shader_glsl_load_vsamplers(const struct wined3d_gl_info *gl_info,
static
inline
void
walk_constant_heap
(
const
struct
wined3d_gl_info
*
gl_info
,
const
float
*
constants
,
const
GLint
*
constant_locations
,
const
struct
constant_heap
*
heap
,
unsigned
char
*
stack
,
DWORD
version
)
{
unsigned
int
start
=
~
0U
,
end
=
0
;
int
stack_idx
=
0
;
unsigned
int
heap_idx
=
1
;
unsigned
int
idx
;
...
...
@@ -514,7 +515,8 @@ static inline void walk_constant_heap(const struct wined3d_gl_info *gl_info, con
if
(
heap
->
entries
[
heap_idx
].
version
<=
version
)
return
;
idx
=
heap
->
entries
[
heap_idx
].
idx
;
if
(
constant_locations
[
idx
]
!=
-
1
)
GL_EXTCALL
(
glUniform4fvARB
(
constant_locations
[
idx
],
1
,
&
constants
[
idx
*
4
]));
if
(
constant_locations
[
idx
]
!=
-
1
)
start
=
end
=
idx
;
stack
[
stack_idx
]
=
HEAP_NODE_TRAVERSE_LEFT
;
while
(
stack_idx
>=
0
)
...
...
@@ -530,7 +532,12 @@ static inline void walk_constant_heap(const struct wined3d_gl_info *gl_info, con
heap_idx
=
left_idx
;
idx
=
heap
->
entries
[
heap_idx
].
idx
;
if
(
constant_locations
[
idx
]
!=
-
1
)
GL_EXTCALL
(
glUniform4fvARB
(
constant_locations
[
idx
],
1
,
&
constants
[
idx
*
4
]));
{
if
(
start
>
idx
)
start
=
idx
;
if
(
end
<
idx
)
end
=
idx
;
}
stack
[
stack_idx
++
]
=
HEAP_NODE_TRAVERSE_RIGHT
;
stack
[
stack_idx
]
=
HEAP_NODE_TRAVERSE_LEFT
;
...
...
@@ -546,7 +553,12 @@ static inline void walk_constant_heap(const struct wined3d_gl_info *gl_info, con
heap_idx
=
right_idx
;
idx
=
heap
->
entries
[
heap_idx
].
idx
;
if
(
constant_locations
[
idx
]
!=
-
1
)
GL_EXTCALL
(
glUniform4fvARB
(
constant_locations
[
idx
],
1
,
&
constants
[
idx
*
4
]));
{
if
(
start
>
idx
)
start
=
idx
;
if
(
end
<
idx
)
end
=
idx
;
}
stack
[
stack_idx
++
]
=
HEAP_NODE_POP
;
stack
[
stack_idx
]
=
HEAP_NODE_TRAVERSE_LEFT
;
...
...
@@ -560,6 +572,8 @@ static inline void walk_constant_heap(const struct wined3d_gl_info *gl_info, con
break
;
}
}
if
(
start
<=
end
)
GL_EXTCALL
(
glUniform4fvARB
(
constant_locations
[
start
],
end
-
start
+
1
,
&
constants
[
start
*
4
]));
checkGLcall
(
"walk_constant_heap()"
);
}
...
...
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