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
4767be8c
Commit
4767be8c
authored
Aug 20, 2008
by
Stefan Dösinger
Committed by
Alexandre Julliard
Aug 26, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: The final luminance factor is clamped.
parent
f8ead755
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
3 deletions
+46
-3
visual.c
dlls/d3d9/tests/visual.c
+43
-1
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+3
-2
No files found.
dlls/d3d9/tests/visual.c
View file @
4767be8c
...
...
@@ -7860,7 +7860,49 @@ static void fixed_function_bumpmap_test(IDirect3DDevice9 *device)
* green: 0.5 * (0.25 * 2.0 + 0.1) = 0.5 * 0.6 = 0.3 = 0x4c
* green: 0.75 * (0.25 * 2.0 + 0.1) = 0.75 * 0.6 = 0.45 = 0x72
*/
ok
(
color_match
(
color
,
0x00994c72
,
2
),
"bumpmap failed: Got color 0x%08x, expected 0x00ffffff.
\n
"
,
color
);
ok
(
color_match
(
color
,
0x00994c72
,
3
),
"bumpmap failed: Got color 0x%08x, expected 0x00994c72.
\n
"
,
color
);
/* Check a result scale factor > 1.0 */
scale
=
10
;
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
0
,
D3DTSS_BUMPENVLSCALE
,
*
((
DWORD
*
)
&
scale
));
ok
(
SUCCEEDED
(
hr
),
"SetTextureStageState failed (%08x)
\n
"
,
hr
);
offset
=
10
;
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
0
,
D3DTSS_BUMPENVLOFFSET
,
*
((
DWORD
*
)
&
offset
));
ok
(
SUCCEEDED
(
hr
),
"SetTextureStageState failed (%08x)
\n
"
,
hr
);
hr
=
IDirect3DDevice9_BeginScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"BeginScene failed (0x%08x)
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IDirect3DDevice9_DrawPrimitiveUP
(
device
,
D3DPT_TRIANGLESTRIP
,
2
,
&
quad
[
0
],
sizeof
(
quad
[
0
]));
ok
(
SUCCEEDED
(
hr
),
"DrawPrimitiveUP failed (0x%08x)
\n
"
,
hr
);
hr
=
IDirect3DDevice9_EndScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"EndScene failed (0x%08x)
\n
"
,
hr
);
}
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Present failed (0x%08x)
\n
"
,
hr
);
color
=
getPixelColor
(
device
,
320
,
240
);
ok
(
color_match
(
color
,
0x00ff80c0
,
1
),
"bumpmap failed: Got color 0x%08x, expected 0x00ff80c0.
\n
"
,
color
);
/* Check clamping in the scale factor calculation */
scale
=
1000
;
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
0
,
D3DTSS_BUMPENVLSCALE
,
*
((
DWORD
*
)
&
scale
));
ok
(
SUCCEEDED
(
hr
),
"SetTextureStageState failed (%08x)
\n
"
,
hr
);
offset
=
-
1
;
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
0
,
D3DTSS_BUMPENVLOFFSET
,
*
((
DWORD
*
)
&
offset
));
ok
(
SUCCEEDED
(
hr
),
"SetTextureStageState failed (%08x)
\n
"
,
hr
);
hr
=
IDirect3DDevice9_BeginScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"BeginScene failed (0x%08x)
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IDirect3DDevice9_DrawPrimitiveUP
(
device
,
D3DPT_TRIANGLESTRIP
,
2
,
&
quad
[
0
],
sizeof
(
quad
[
0
]));
ok
(
SUCCEEDED
(
hr
),
"DrawPrimitiveUP failed (0x%08x)
\n
"
,
hr
);
hr
=
IDirect3DDevice9_EndScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"EndScene failed (0x%08x)
\n
"
,
hr
);
}
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Present failed (0x%08x)
\n
"
,
hr
);
color
=
getPixelColor
(
device
,
320
,
240
);
ok
(
color_match
(
color
,
0x00ff80c0
,
1
),
"bumpmap failed: Got color 0x%08x, expected 0x00ff80c0.
\n
"
,
color
);
hr
=
IDirect3DDevice9_SetTexture
(
device
,
0
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_SetTexture failed (%08x)
\n
"
,
hr
);
...
...
dlls/wined3d/arb_program_shader.c
View file @
4767be8c
...
...
@@ -2555,7 +2555,8 @@ static void gen_ffp_instr(SHADER_BUFFER *buffer, unsigned int stage, BOOL color,
break
;
case
WINED3DTOP_BLENDTEXTUREALPHAPM
:
shader_addline
(
buffer
,
"SUB arg0.a, const.x, %s;
\n
"
,
arg1
);
arg0
=
get_argreg
(
buffer
,
0
,
stage
,
WINED3DTA_TEXTURE
);
shader_addline
(
buffer
,
"SUB arg0.a, const.x, %s.a;
\n
"
,
arg0
);
shader_addline
(
buffer
,
"MAD_SAT %s%s, %s, arg0.a, %s;
\n
"
,
dstreg
,
dstmask
,
arg2
,
arg1
);
break
;
...
...
@@ -2776,7 +2777,7 @@ static GLuint gen_arbfp_ffp_shader(struct ffp_settings *settings, IWineD3DStateB
shader_addline
(
&
buffer
,
"TEX%s tex%u, ret, texture[%u], %s;
\n
"
,
sat
,
stage
,
stage
,
textype
);
if
(
settings
->
op
[
stage
-
1
].
cop
==
WINED3DTOP_BUMPENVMAPLUMINANCE
)
{
shader_addline
(
&
buffer
,
"MAD ret.r, tex%u.b, luminance%u.r, luminance%u.g;
\n
"
,
shader_addline
(
&
buffer
,
"MAD
_SAT
ret.r, tex%u.b, luminance%u.r, luminance%u.g;
\n
"
,
stage
-
1
,
stage
-
1
,
stage
-
1
);
shader_addline
(
&
buffer
,
"MUL tex%u, tex%u, ret.r;
\n
"
,
stage
,
stage
);
}
...
...
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