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
298bd3c5
Commit
298bd3c5
authored
Jun 09, 2009
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jun 10, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Store the bumpmap ARB constants in ARB structures.
parent
e83fa982
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
27 deletions
+12
-27
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+0
-0
glsl_shader.c
dlls/wined3d/glsl_shader.c
+12
-19
wined3d_private.h
dlls/wined3d/wined3d_private.h
+0
-8
No files found.
dlls/wined3d/arb_program_shader.c
View file @
298bd3c5
This diff is collapsed.
Click to expand it.
dlls/wined3d/glsl_shader.c
View file @
298bd3c5
...
...
@@ -657,20 +657,21 @@ static void shader_glsl_load_constants(
/* Upload the environment bump map matrix if needed. The needsbumpmat member specifies the texture stage to load the matrix from.
* It can't be 0 for a valid texbem instruction.
*/
for
(
i
=
0
;
i
<
((
IWineD3DPixelShaderImpl
*
)
pshader
)
->
numbumpenvmatconsts
;
i
++
)
{
IWineD3DPixelShaderImpl
*
ps
=
(
IWineD3DPixelShaderImpl
*
)
pshader
;
int
stage
=
ps
->
luminanceconst
[
i
].
texunit
;
for
(
i
=
0
;
i
<
MAX_TEXTURES
;
i
++
)
{
const
float
*
data
;
const
float
*
data
=
(
const
float
*
)
&
stateBlock
->
textureState
[(
int
)
ps
->
bumpenvmatconst
[
i
].
texunit
][
WINED3DTSS_BUMPENVMAT00
];
if
(
prog
->
bumpenvmat_location
[
i
]
==
-
1
)
continue
;
data
=
(
const
float
*
)
&
stateBlock
->
textureState
[
i
][
WINED3DTSS_BUMPENVMAT00
];
GL_EXTCALL
(
glUniformMatrix2fvARB
(
prog
->
bumpenvmat_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
(
p
s
->
baseShader
.
reg_maps
.
luminanceparams
[
stage
]
)
{
const
GLfloat
*
scale
=
(
const
GLfloat
*
)
&
stateBlock
->
textureState
[
stage
][
WINED3DTSS_BUMPENVLSCALE
];
const
GLfloat
*
offset
=
(
const
GLfloat
*
)
&
stateBlock
->
textureState
[
stage
][
WINED3DTSS_BUMPENVLOFFSET
];
if
(
p
rog
->
luminancescale_location
[
i
]
!=
-
1
)
{
const
GLfloat
*
scale
=
(
const
GLfloat
*
)
&
stateBlock
->
textureState
[
i
][
WINED3DTSS_BUMPENVLSCALE
];
const
GLfloat
*
offset
=
(
const
GLfloat
*
)
&
stateBlock
->
textureState
[
i
][
WINED3DTSS_BUMPENVLOFFSET
];
GL_EXTCALL
(
glUniform1fvARB
(
prog
->
luminancescale_location
[
i
],
1
,
scale
));
checkGLcall
(
"glUniform1fvARB"
);
...
...
@@ -864,28 +865,20 @@ static void shader_generate_glsl_declarations(IWineD3DBaseShader *iface, const s
shader_addline
(
buffer
,
"void order_ps_input();
\n
"
);
}
}
else
{
IWineD3DPixelShaderImpl
*
ps_impl
=
(
IWineD3DPixelShaderImpl
*
)
This
;
ps_impl
->
numbumpenvmatconsts
=
0
;
for
(
i
=
0
;
i
<
(
sizeof
(
reg_maps
->
bumpmat
)
/
sizeof
(
reg_maps
->
bumpmat
[
0
]));
i
++
)
{
if
(
!
reg_maps
->
bumpmat
[
i
])
{
continue
;
}
ps_impl
->
bumpenvmatconst
[(
int
)
ps_impl
->
numbumpenvmatconsts
].
texunit
=
i
;
shader_addline
(
buffer
,
"uniform mat2 bumpenvmat%d;
\n
"
,
i
);
if
(
reg_maps
->
luminanceparams
)
{
ps_impl
->
luminanceconst
[(
int
)
ps_impl
->
numbumpenvmatconsts
].
texunit
=
i
;
shader_addline
(
buffer
,
"uniform float luminancescale%d;
\n
"
,
i
);
shader_addline
(
buffer
,
"uniform float luminanceoffset%d;
\n
"
,
i
);
extra_constants_needed
++
;
}
else
{
ps_impl
->
luminanceconst
[(
int
)
ps_impl
->
numbumpenvmatconsts
].
texunit
=
-
1
;
}
extra_constants_needed
++
;
ps_impl
->
numbumpenvmatconsts
++
;
}
if
(
ps_args
->
srgb_correction
)
{
...
...
@@ -4062,12 +4055,12 @@ static void set_glsl_shader_program(IWineD3DDevice *iface, BOOL use_ps, BOOL use
char
name
[
32
];
WORD
map
;
for
(
i
=
0
;
i
<
((
IWineD3DPixelShaderImpl
*
)
pshader
)
->
numbumpenvmatconsts
;
i
++
)
{
sprintf
(
name
,
"bumpenvmat%
d"
,
((
IWineD3DPixelShaderImpl
*
)
pshader
)
->
bumpenvmatconst
[
i
].
texunit
);
for
(
i
=
0
;
i
<
MAX_TEXTURES
;
i
++
)
{
sprintf
(
name
,
"bumpenvmat%
u"
,
i
);
entry
->
bumpenvmat_location
[
i
]
=
GL_EXTCALL
(
glGetUniformLocationARB
(
programId
,
name
));
sprintf
(
name
,
"luminancescale%
d"
,
((
IWineD3DPixelShaderImpl
*
)
pshader
)
->
luminanceconst
[
i
].
texunit
);
sprintf
(
name
,
"luminancescale%
u"
,
i
);
entry
->
luminancescale_location
[
i
]
=
GL_EXTCALL
(
glGetUniformLocationARB
(
programId
,
name
));
sprintf
(
name
,
"luminanceoffset%
d"
,
((
IWineD3DPixelShaderImpl
*
)
pshader
)
->
luminanceconst
[
i
].
texunit
);
sprintf
(
name
,
"luminanceoffset%
u"
,
i
);
entry
->
luminanceoffset_location
[
i
]
=
GL_EXTCALL
(
glGetUniformLocationARB
(
programId
,
name
));
}
...
...
dlls/wined3d/wined3d_private.h
View file @
298bd3c5
...
...
@@ -733,11 +733,6 @@ enum vertexprocessing_mode {
#define WINED3D_CONST_NUM_UNUSED ~0U
struct
stb_const_desc
{
unsigned
char
texunit
;
UINT
const_num
;
};
enum
fogmode
{
FOG_OFF
,
FOG_LINEAR
,
...
...
@@ -2690,9 +2685,6 @@ typedef struct IWineD3DPixelShaderImpl {
void
*
backend_priv
;
/* Some information about the shader behavior */
struct
stb_const_desc
bumpenvmatconst
[
MAX_TEXTURES
];
unsigned
char
numbumpenvmatconsts
;
struct
stb_const_desc
luminanceconst
[
MAX_TEXTURES
];
char
vpos_uniform
;
BOOL
color0_mov
;
...
...
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