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
e8b0de1e
Commit
e8b0de1e
authored
Nov 06, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 07, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use more consistent names for the various bumpenv uniforms.
parent
9b118257
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
glsl_shader.c
dlls/wined3d/glsl_shader.c
+20
-20
No files found.
dlls/wined3d/glsl_shader.c
View file @
e8b0de1e
...
...
@@ -116,9 +116,9 @@ struct glsl_ps_program
GLhandleARB
id
;
GLint
*
uniform_f_locations
;
GLint
uniform_i_locations
[
MAX_CONST_I
];
GLint
bumpenvmat_location
[
MAX_TEXTURES
];
GLint
luminance
scale_location
[
MAX_TEXTURES
];
GLint
luminance
offset_location
[
MAX_TEXTURES
];
GLint
bumpenv
_
mat_location
[
MAX_TEXTURES
];
GLint
bumpenv_lum_
scale_location
[
MAX_TEXTURES
];
GLint
bumpenv_lum_
offset_location
[
MAX_TEXTURES
];
GLint
ycorrection_location
;
GLint
np2_fixup_location
;
const
struct
ps_np2fixup_info
*
np2_fixup_info
;
...
...
@@ -788,24 +788,24 @@ static void shader_glsl_load_constants(const struct wined3d_context *context,
{
const
float
*
data
;
if
(
prog
->
ps
.
bumpenvmat_location
[
i
]
==
-
1
)
if
(
prog
->
ps
.
bumpenv
_
mat_location
[
i
]
==
-
1
)
continue
;
data
=
(
const
float
*
)
&
state
->
texture_states
[
i
][
WINED3D_TSS_BUMPENV_MAT00
];
GL_EXTCALL
(
glUniformMatrix2fvARB
(
prog
->
ps
.
bumpenvmat_location
[
i
],
1
,
0
,
data
));
GL_EXTCALL
(
glUniformMatrix2fvARB
(
prog
->
ps
.
bumpenv
_
mat_location
[
i
],
1
,
0
,
data
));
checkGLcall
(
"glUniformMatrix2fvARB"
);
/* texbeml needs the luminance scale and offset too. If texbeml
* is used, needsbumpmat is set too, so we can check that in the
* needsbumpmat check. */
if
(
prog
->
ps
.
luminance
scale_location
[
i
]
!=
-
1
)
if
(
prog
->
ps
.
bumpenv_lum_
scale_location
[
i
]
!=
-
1
)
{
const
GLfloat
*
scale
=
(
const
GLfloat
*
)
&
state
->
texture_states
[
i
][
WINED3D_TSS_BUMPENV_LSCALE
];
const
GLfloat
*
offset
=
(
const
GLfloat
*
)
&
state
->
texture_states
[
i
][
WINED3D_TSS_BUMPENV_LOFFSET
];
GL_EXTCALL
(
glUniform1fvARB
(
prog
->
ps
.
luminance
scale_location
[
i
],
1
,
scale
));
GL_EXTCALL
(
glUniform1fvARB
(
prog
->
ps
.
bumpenv_lum_
scale_location
[
i
],
1
,
scale
));
checkGLcall
(
"glUniform1fvARB"
);
GL_EXTCALL
(
glUniform1fvARB
(
prog
->
ps
.
luminance
offset_location
[
i
],
1
,
offset
));
GL_EXTCALL
(
glUniform1fvARB
(
prog
->
ps
.
bumpenv_lum_
offset_location
[
i
],
1
,
offset
));
checkGLcall
(
"glUniform1fvARB"
);
}
}
...
...
@@ -1148,12 +1148,12 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont
if
(
!
(
map
&
1
))
continue
;
shader_addline
(
buffer
,
"uniform mat2 bumpenv
mat%d
;
\n
"
,
i
);
shader_addline
(
buffer
,
"uniform mat2 bumpenv
_mat%u
;
\n
"
,
i
);
if
(
reg_maps
->
luminanceparams
&
(
1
<<
i
))
{
shader_addline
(
buffer
,
"uniform float
luminancescale%d
;
\n
"
,
i
);
shader_addline
(
buffer
,
"uniform float
luminanceoffset%d
;
\n
"
,
i
);
shader_addline
(
buffer
,
"uniform float
bumpenv_lum_scale%u
;
\n
"
,
i
);
shader_addline
(
buffer
,
"uniform float
bumpenv_lum_offset%u
;
\n
"
,
i
);
extra_constants_needed
++
;
}
...
...
@@ -3933,7 +3933,7 @@ static void shader_glsl_texbem(const struct wined3d_shader_instruction *ins)
shader_glsl_add_src_param
(
ins
,
&
ins
->
src
[
0
],
WINED3DSP_WRITEMASK_0
|
WINED3DSP_WRITEMASK_1
,
&
coord_param
);
shader_glsl_gen_sample_code
(
ins
,
sampler_idx
,
&
sample_function
,
WINED3DSP_NOSWIZZLE
,
NULL
,
NULL
,
NULL
,
"T%u%s + vec4(bumpenv
mat%d
* %s, 0.0, 0.0)%s"
,
sampler_idx
,
coord_mask
,
sampler_idx
,
"T%u%s + vec4(bumpenv
_mat%u
* %s, 0.0, 0.0)%s"
,
sampler_idx
,
coord_mask
,
sampler_idx
,
coord_param
.
param_str
,
coord_mask
);
if
(
ins
->
handler_idx
==
WINED3DSIH_TEXBEML
)
...
...
@@ -3944,7 +3944,7 @@ static void shader_glsl_texbem(const struct wined3d_shader_instruction *ins)
shader_glsl_add_src_param
(
ins
,
&
ins
->
src
[
0
],
WINED3DSP_WRITEMASK_2
,
&
luminance_param
);
shader_glsl_add_dst_param
(
ins
,
&
ins
->
dst
[
0
],
&
dst_param
);
shader_addline
(
ins
->
ctx
->
buffer
,
"%s%s *= (%s *
luminancescale%d + luminanceoffset%d
);
\n
"
,
shader_addline
(
ins
->
ctx
->
buffer
,
"%s%s *= (%s *
bumpenv_lum_scale%u + bumpenv_lum_offset%u
);
\n
"
,
dst_param
.
reg_name
,
dst_param
.
mask_str
,
luminance_param
.
param_str
,
sampler_idx
,
sampler_idx
);
}
...
...
@@ -3959,7 +3959,7 @@ static void shader_glsl_bem(const struct wined3d_shader_instruction *ins)
shader_glsl_add_src_param
(
ins
,
&
ins
->
src
[
1
],
WINED3DSP_WRITEMASK_0
|
WINED3DSP_WRITEMASK_1
,
&
src1_param
);
shader_glsl_append_dst
(
ins
->
ctx
->
buffer
,
ins
);
shader_addline
(
ins
->
ctx
->
buffer
,
"%s + bumpenv
mat%d
* %s);
\n
"
,
shader_addline
(
ins
->
ctx
->
buffer
,
"%s + bumpenv
_mat%u
* %s);
\n
"
,
src0_param
.
param_str
,
sampler_idx
,
src1_param
.
param_str
);
}
...
...
@@ -4854,12 +4854,12 @@ static void set_glsl_shader_program(const struct wined3d_context *context,
for
(
i
=
0
;
i
<
MAX_TEXTURES
;
++
i
)
{
sprintf
(
name
,
"bumpenvmat%u"
,
i
);
entry
->
ps
.
bumpenvmat_location
[
i
]
=
GL_EXTCALL
(
glGetUniformLocationARB
(
programId
,
name
));
sprintf
(
name
,
"
luminance
scale%u"
,
i
);
entry
->
ps
.
luminance
scale_location
[
i
]
=
GL_EXTCALL
(
glGetUniformLocationARB
(
programId
,
name
));
sprintf
(
name
,
"
luminance
offset%u"
,
i
);
entry
->
ps
.
luminance
offset_location
[
i
]
=
GL_EXTCALL
(
glGetUniformLocationARB
(
programId
,
name
));
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
)
...
...
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