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
02250bb1
Commit
02250bb1
authored
Nov 07, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 08, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Introduce a separate function for initializing ps uniform locations.
parent
c9f4cfc9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
39 deletions
+35
-39
glsl_shader.c
dlls/wined3d/glsl_shader.c
+35
-39
No files found.
dlls/wined3d/glsl_shader.c
View file @
02250bb1
...
...
@@ -4719,6 +4719,40 @@ static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info *
vs
->
pos_fixup_location
=
GL_EXTCALL
(
glGetUniformLocationARB
(
program_id
,
"posFixup"
));
}
static
void
shader_glsl_init_ps_uniform_locations
(
const
struct
wined3d_gl_info
*
gl_info
,
GLhandleARB
program_id
,
struct
glsl_ps_program
*
ps
)
{
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
)
{
snprintf
(
name
,
sizeof
(
name
),
"ps_c[%u]"
,
i
);
ps
->
uniform_f_locations
[
i
]
=
GL_EXTCALL
(
glGetUniformLocationARB
(
program_id
,
name
));
}
for
(
i
=
0
;
i
<
MAX_CONST_I
;
++
i
)
{
snprintf
(
name
,
sizeof
(
name
),
"ps_i[%u]"
,
i
);
ps
->
uniform_i_locations
[
i
]
=
GL_EXTCALL
(
glGetUniformLocationARB
(
program_id
,
name
));
}
for
(
i
=
0
;
i
<
MAX_TEXTURES
;
++
i
)
{
snprintf
(
name
,
sizeof
(
name
),
"bumpenv_mat%u"
,
i
);
ps
->
bumpenv_mat_location
[
i
]
=
GL_EXTCALL
(
glGetUniformLocationARB
(
program_id
,
name
));
snprintf
(
name
,
sizeof
(
name
),
"bumpenv_lum_scale%u"
,
i
);
ps
->
bumpenv_lum_scale_location
[
i
]
=
GL_EXTCALL
(
glGetUniformLocationARB
(
program_id
,
name
));
snprintf
(
name
,
sizeof
(
name
),
"bumpenv_lum_offset%u"
,
i
);
ps
->
bumpenv_lum_offset_location
[
i
]
=
GL_EXTCALL
(
glGetUniformLocationARB
(
program_id
,
name
));
}
ps
->
np2_fixup_location
=
GL_EXTCALL
(
glGetUniformLocationARB
(
program_id
,
"ps_samplerNP2Fixup"
));
ps
->
ycorrection_location
=
GL_EXTCALL
(
glGetUniformLocationARB
(
program_id
,
"ycorrection"
));
}
/** Sets the GLSL program ID for the given pixel and vertex shader combination.
* It sets the programId on the current StateBlock (because it should be called
* inside of the DrawPrimitive() part of the render loop).
...
...
@@ -4742,7 +4776,6 @@ static void set_glsl_shader_program(const struct wined3d_context *context,
GLhandleARB
programId
=
0
;
GLhandleARB
reorder_shader_id
=
0
;
unsigned
int
i
;
char
glsl_name
[
10
];
struct
ps_compile_args
ps_compile_args
;
struct
vs_compile_args
vs_compile_args
;
GLhandleARB
vs_id
,
ps_id
;
...
...
@@ -4847,44 +4880,7 @@ static void set_glsl_shader_program(const struct wined3d_context *context,
shader_glsl_validate_link
(
gl_info
,
programId
);
shader_glsl_init_vs_uniform_locations
(
gl_info
,
programId
,
&
entry
->
vs
);
entry
->
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
)
{
snprintf
(
glsl_name
,
sizeof
(
glsl_name
),
"ps_c[%u]"
,
i
);
entry
->
ps
.
uniform_f_locations
[
i
]
=
GL_EXTCALL
(
glGetUniformLocationARB
(
programId
,
glsl_name
));
}
for
(
i
=
0
;
i
<
MAX_CONST_I
;
++
i
)
{
snprintf
(
glsl_name
,
sizeof
(
glsl_name
),
"ps_i[%u]"
,
i
);
entry
->
ps
.
uniform_i_locations
[
i
]
=
GL_EXTCALL
(
glGetUniformLocationARB
(
programId
,
glsl_name
));
}
if
(
pshader
)
{
char
name
[
32
];
for
(
i
=
0
;
i
<
MAX_TEXTURES
;
++
i
)
{
sprintf
(
name
,
"bumpenv_mat%u"
,
i
);
entry
->
ps
.
bumpenv_mat_location
[
i
]
=
GL_EXTCALL
(
glGetUniformLocationARB
(
programId
,
name
));
sprintf
(
name
,
"bumpenv_lum_scale%u"
,
i
);
entry
->
ps
.
bumpenv_lum_scale_location
[
i
]
=
GL_EXTCALL
(
glGetUniformLocationARB
(
programId
,
name
));
sprintf
(
name
,
"bumpenv_lum_offset%u"
,
i
);
entry
->
ps
.
bumpenv_lum_offset_location
[
i
]
=
GL_EXTCALL
(
glGetUniformLocationARB
(
programId
,
name
));
}
if
(
ps_compile_args
.
np2_fixup
)
{
if
(
entry
->
ps
.
np2_fixup_info
)
entry
->
ps
.
np2_fixup_location
=
GL_EXTCALL
(
glGetUniformLocationARB
(
programId
,
"ps_samplerNP2Fixup"
));
else
FIXME
(
"NP2 texcoord fixup needed for this pixelshader, but no fixup uniform found.
\n
"
);
}
}
entry
->
ps
.
ycorrection_location
=
GL_EXTCALL
(
glGetUniformLocationARB
(
programId
,
"ycorrection"
));
shader_glsl_init_ps_uniform_locations
(
gl_info
,
programId
,
&
entry
->
ps
);
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