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
2843b0f9
Commit
2843b0f9
authored
Mar 29, 2007
by
Fabian Bieler
Committed by
Alexandre Julliard
Apr 04, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Fix GLSL cmp instruction for INF and NAN arguments.
parent
30abd4ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
16 deletions
+30
-16
glsl_shader.c
dlls/wined3d/glsl_shader.c
+30
-16
No files found.
dlls/wined3d/glsl_shader.c
View file @
2843b0f9
...
...
@@ -784,18 +784,26 @@ static DWORD shader_glsl_add_dst_param(SHADER_OPCODE_ARG* arg, const DWORD param
}
/* Append the destination part of the instruction to the buffer, return the effective write mask */
static
DWORD
shader_glsl_append_dst
(
SHADER_BUFFER
*
buffer
,
SHADER_OPCODE_ARG
*
arg
)
{
static
DWORD
shader_glsl_append_dst
_ext
(
SHADER_BUFFER
*
buffer
,
SHADER_OPCODE_ARG
*
arg
,
const
DWORD
param
)
{
glsl_dst_param_t
dst_param
;
DWORD
mask
;
int
shift
;
shift
=
(
arg
->
dst
&
WINED3DSP_DSTSHIFT_MASK
)
>>
WINED3DSP_DSTSHIFT_SHIFT
;
mask
=
shader_glsl_add_dst_param
(
arg
,
arg
->
dst
,
arg
->
dst_addr
,
&
dst_param
);
shader_addline
(
buffer
,
"%s%s = %s("
,
dst_param
.
reg_name
,
dst_param
.
mask_str
,
shift_glsl_tab
[
shift
]);
mask
=
shader_glsl_add_dst_param
(
arg
,
param
,
arg
->
dst_addr
,
&
dst_param
);
if
(
mask
)
{
shift
=
(
param
&
WINED3DSP_DSTSHIFT_MASK
)
>>
WINED3DSP_DSTSHIFT_SHIFT
;
shader_addline
(
buffer
,
"%s%s = %s("
,
dst_param
.
reg_name
,
dst_param
.
mask_str
,
shift_glsl_tab
[
shift
]);
}
return
mask
;
}
/* Append the destination part of the instruction to the buffer, return the effective write mask */
static
DWORD
shader_glsl_append_dst
(
SHADER_BUFFER
*
buffer
,
SHADER_OPCODE_ARG
*
arg
)
{
return
shader_glsl_append_dst_ext
(
buffer
,
arg
,
arg
->
dst
);
}
/** Process GLSL instruction modifiers */
void
shader_glsl_add_instruction_modifiers
(
SHADER_OPCODE_ARG
*
arg
)
{
...
...
@@ -1115,20 +1123,26 @@ void shader_glsl_cmp(SHADER_OPCODE_ARG* arg) {
glsl_src_param_t
src0_param
;
glsl_src_param_t
src1_param
;
glsl_src_param_t
src2_param
;
DWORD
write_mask
;
size_t
mask_size
;
write_mask
=
shader_glsl_append_dst
(
arg
->
buffer
,
arg
);
mask_size
=
shader_glsl_get_write_mask_size
(
write_mask
);
DWORD
write_mask
,
cmp_channel
=
0
;
unsigned
int
i
,
j
;
/* Cycle through all source0 channels */
for
(
i
=
0
;
i
<
4
;
i
++
)
{
write_mask
=
0
;
/* Find the destination channels which use the current source0 channel */
for
(
j
=
0
;
j
<
4
;
j
++
)
{
if
(
((
arg
->
src
[
0
]
>>
(
WINED3DSP_SWIZZLE_SHIFT
+
2
*
j
))
&
0x3
)
==
i
)
{
write_mask
|=
WINED3DSP_WRITEMASK_0
<<
j
;
cmp_channel
=
WINED3DSP_WRITEMASK_0
<<
j
;
}
}
write_mask
=
shader_glsl_append_dst_ext
(
arg
->
buffer
,
arg
,
arg
->
dst
&
(
~
WINED3DSP_SWIZZLE_MASK
|
write_mask
));
if
(
!
write_mask
)
continue
;
shader_glsl_add_src_param
(
arg
,
arg
->
src
[
0
],
arg
->
src_addr
[
0
],
write_mask
,
&
src0_param
);
shader_glsl_add_src_param
(
arg
,
arg
->
src
[
1
],
arg
->
src_addr
[
1
],
write_mask
,
&
src1_param
);
shader_glsl_add_src_param
(
arg
,
arg
->
src
[
2
],
arg
->
src_addr
[
2
],
write_mask
,
&
src2_param
);
shader_glsl_add_src_param
(
arg
,
arg
->
src
[
0
],
arg
->
src_addr
[
0
],
cmp_channel
,
&
src0_param
);
shader_glsl_add_src_param
(
arg
,
arg
->
src
[
1
],
arg
->
src_addr
[
1
],
write_mask
,
&
src1_param
);
shader_glsl_add_src_param
(
arg
,
arg
->
src
[
2
],
arg
->
src_addr
[
2
],
write_mask
,
&
src2_param
);
if
(
mask_size
>
1
)
{
shader_addline
(
arg
->
buffer
,
"mix(%s, %s, vec%d(lessThan(%s, vec%d(0.0)))));
\n
"
,
src1_param
.
param_str
,
src2_param
.
param_str
,
mask_size
,
src0_param
.
param_str
,
mask_size
);
}
else
{
shader_addline
(
arg
->
buffer
,
"%s >= 0.0 ? %s : %s);
\n
"
,
src0_param
.
param_str
,
src1_param
.
param_str
,
src2_param
.
param_str
);
}
...
...
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