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
4b3ac837
Commit
4b3ac837
authored
Mar 22, 2007
by
Fabian Bieler
Committed by
Alexandre Julliard
Mar 23, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Implemented bump map transform for texbem in GLSL with native signed textures.
parent
7b31e912
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
glsl_shader.c
dlls/wined3d/glsl_shader.c
+6
-5
No files found.
dlls/wined3d/glsl_shader.c
View file @
4b3ac837
...
@@ -359,7 +359,7 @@ void shader_glsl_load_constants(
...
@@ -359,7 +359,7 @@ void shader_glsl_load_constants(
float
*
data
=
(
float
*
)
&
stateBlock
->
textureState
[(
int
)
((
IWineD3DPixelShaderImpl
*
)
pshader
)
->
needsbumpmat
][
WINED3DTSS_BUMPENVMAT00
];
float
*
data
=
(
float
*
)
&
stateBlock
->
textureState
[(
int
)
((
IWineD3DPixelShaderImpl
*
)
pshader
)
->
needsbumpmat
][
WINED3DTSS_BUMPENVMAT00
];
pos
=
GL_EXTCALL
(
glGetUniformLocationARB
(
programId
,
"bumpenvmat"
));
pos
=
GL_EXTCALL
(
glGetUniformLocationARB
(
programId
,
"bumpenvmat"
));
checkGLcall
(
"glGetUniformLocationARB"
);
checkGLcall
(
"glGetUniformLocationARB"
);
GL_EXTCALL
(
glUniform
4fvARB
(
pos
,
1
,
data
));
GL_EXTCALL
(
glUniform
Matrix2fvARB
(
pos
,
1
,
0
,
data
));
checkGLcall
(
"glUniform4fvARB"
);
checkGLcall
(
"glUniform4fvARB"
);
}
}
}
}
...
@@ -401,7 +401,7 @@ void shader_generate_glsl_declarations(
...
@@ -401,7 +401,7 @@ void shader_generate_glsl_declarations(
if
(
!
pshader
)
if
(
!
pshader
)
shader_addline
(
buffer
,
"uniform vec4 posFixup;
\n
"
);
shader_addline
(
buffer
,
"uniform vec4 posFixup;
\n
"
);
else
if
(
reg_maps
->
bumpmat
)
else
if
(
reg_maps
->
bumpmat
)
shader_addline
(
buffer
,
"uniform
vec4
bumpenvmat;
\n
"
);
shader_addline
(
buffer
,
"uniform
mat2
bumpenvmat;
\n
"
);
/* Declare texture samplers */
/* Declare texture samplers */
for
(
i
=
0
;
i
<
This
->
baseShader
.
limits
.
sampler
;
i
++
)
{
for
(
i
=
0
;
i
<
This
->
baseShader
.
limits
.
sampler
;
i
++
)
{
...
@@ -1783,6 +1783,7 @@ void pshader_glsl_texbem(SHADER_OPCODE_ARG* arg) {
...
@@ -1783,6 +1783,7 @@ void pshader_glsl_texbem(SHADER_OPCODE_ARG* arg) {
IWineD3DDeviceImpl
*
deviceImpl
=
(
IWineD3DDeviceImpl
*
)
This
->
baseShader
.
device
;
IWineD3DDeviceImpl
*
deviceImpl
=
(
IWineD3DDeviceImpl
*
)
This
->
baseShader
.
device
;
char
dst_swizzle
[
6
];
char
dst_swizzle
[
6
];
glsl_sample_function_t
sample_function
;
glsl_sample_function_t
sample_function
;
glsl_src_param_t
coord_param
;
DWORD
sampler_type
;
DWORD
sampler_type
;
DWORD
sampler_idx
;
DWORD
sampler_idx
;
BOOL
projected
;
BOOL
projected
;
...
@@ -1817,9 +1818,9 @@ void pshader_glsl_texbem(SHADER_OPCODE_ARG* arg) {
...
@@ -1817,9 +1818,9 @@ void pshader_glsl_texbem(SHADER_OPCODE_ARG* arg) {
shader_glsl_get_write_mask
(
arg
->
dst
,
dst_swizzle
);
shader_glsl_get_write_mask
(
arg
->
dst
,
dst_swizzle
);
shader_glsl_get_write_mask
(
mask
,
coord_mask
);
shader_glsl_get_write_mask
(
mask
,
coord_mask
);
FIXME
(
"Bump map transform not handled yet
\n
"
);
shader_glsl_add_src_param
(
arg
,
arg
->
src
[
0
],
arg
->
src_addr
[
0
],
WINED3DSP_WRITEMASK_0
|
WINED3DSP_WRITEMASK_1
,
&
coord_param
);
shader_addline
(
arg
->
buffer
,
"%s(Psampler%u, T%u%s)%s);
\n
"
,
shader_addline
(
arg
->
buffer
,
"%s(Psampler%u, T%u%s
+ vec4(bumpenvmat * %s, 0.0, 0.0)%s
)%s);
\n
"
,
sample_function
.
name
,
sampler_idx
,
sampler_idx
,
coord_mask
,
dst_swizzle
);
sample_function
.
name
,
sampler_idx
,
sampler_idx
,
coord_mask
,
coord_param
.
param_str
,
coord_mask
,
dst_swizzle
);
}
}
/** Process the WINED3DSIO_TEXREG2AR instruction in GLSL
/** Process the WINED3DSIO_TEXREG2AR instruction in GLSL
...
...
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