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
99092c27
Commit
99092c27
authored
Sep 04, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 04, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Avoid a couple of useless glGetUniformLocationARB() calls.
parent
ff6ce4c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
glsl_shader.c
dlls/wined3d/glsl_shader.c
+12
-6
No files found.
dlls/wined3d/glsl_shader.c
View file @
99092c27
...
...
@@ -5754,18 +5754,20 @@ static struct glsl_ffp_fragment_shader *shader_glsl_find_ffp_fragment_shader(str
static
void
shader_glsl_init_vs_uniform_locations
(
const
struct
wined3d_gl_info
*
gl_info
,
GLhandleARB
program_id
,
struct
glsl_vs_program
*
vs
)
GLhandleARB
program_id
,
struct
glsl_vs_program
*
vs
,
unsigned
int
vs_c_count
)
{
unsigned
int
i
;
char
name
[
32
];
vs
->
uniform_f_locations
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
GLhandleARB
)
*
gl_info
->
limits
.
glsl_vs_float_constants
);
for
(
i
=
0
;
i
<
gl_info
->
limits
.
glsl_vs_float_constants
;
++
i
)
for
(
i
=
0
;
i
<
vs_c_count
;
++
i
)
{
snprintf
(
name
,
sizeof
(
name
),
"vs_c[%u]"
,
i
);
vs
->
uniform_f_locations
[
i
]
=
GL_EXTCALL
(
glGetUniformLocationARB
(
program_id
,
name
));
}
memset
(
&
vs
->
uniform_f_locations
[
vs_c_count
],
0xff
,
(
gl_info
->
limits
.
glsl_vs_float_constants
-
vs_c_count
)
*
sizeof
(
GLhandleARB
));
for
(
i
=
0
;
i
<
MAX_CONST_I
;
++
i
)
{
...
...
@@ -5777,18 +5779,20 @@ static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info *
}
static
void
shader_glsl_init_ps_uniform_locations
(
const
struct
wined3d_gl_info
*
gl_info
,
GLhandleARB
program_id
,
struct
glsl_ps_program
*
ps
)
GLhandleARB
program_id
,
struct
glsl_ps_program
*
ps
,
unsigned
int
ps_c_count
)
{
unsigned
int
i
;
char
name
[
32
];
ps
->
uniform_f_locations
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
GLhandleARB
)
*
gl_info
->
limits
.
glsl_ps_float_constants
);
for
(
i
=
0
;
i
<
gl_info
->
limits
.
glsl_ps_float_constants
;
++
i
)
for
(
i
=
0
;
i
<
ps_c_count
;
++
i
)
{
snprintf
(
name
,
sizeof
(
name
),
"ps_c[%u]"
,
i
);
ps
->
uniform_f_locations
[
i
]
=
GL_EXTCALL
(
glGetUniformLocationARB
(
program_id
,
name
));
}
memset
(
&
ps
->
uniform_f_locations
[
ps_c_count
],
0xff
,
(
gl_info
->
limits
.
glsl_ps_float_constants
-
ps_c_count
)
*
sizeof
(
GLhandleARB
));
for
(
i
=
0
;
i
<
MAX_CONST_I
;
++
i
)
{
...
...
@@ -6002,8 +6006,10 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const
GL_EXTCALL
(
glLinkProgramARB
(
programId
));
shader_glsl_validate_link
(
gl_info
,
programId
);
shader_glsl_init_vs_uniform_locations
(
gl_info
,
programId
,
&
entry
->
vs
);
shader_glsl_init_ps_uniform_locations
(
gl_info
,
programId
,
&
entry
->
ps
);
shader_glsl_init_vs_uniform_locations
(
gl_info
,
programId
,
&
entry
->
vs
,
vshader
?
vshader
->
limits
.
constant_float
:
0
);
shader_glsl_init_ps_uniform_locations
(
gl_info
,
programId
,
&
entry
->
ps
,
pshader
?
pshader
->
limits
.
constant_float
:
0
);
checkGLcall
(
"Find glsl program uniform locations"
);
if
(
pshader
&&
pshader
->
reg_maps
.
shader_version
.
major
>=
3
...
...
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