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
9afa540e
Commit
9afa540e
authored
Jun 17, 2006
by
Jason Green
Committed by
Alexandre Julliard
Jun 19, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Added correct cast support for gl_FogFragCoord and gl_PointSize output registers.
parent
406ec204
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
glsl_shader.c
dlls/wined3d/glsl_shader.c
+21
-9
No files found.
dlls/wined3d/glsl_shader.c
View file @
9afa540e
...
...
@@ -380,17 +380,29 @@ static const char* shift_glsl_tab[] = {
"0.5 * "
/* 15 (d2) */
};
/** Print the beginning of the generated GLSL string. example: "reg_name.xyzw = vec4(" */
static
void
shader_glsl_add_dst
(
DWORD
param
,
const
char
*
reg_name
,
const
char
*
reg_mask
,
char
*
outStr
)
{
/** Print the beginning of the generated GLSL string. example: "reg_name.xyzw = vec4("
* Will also change the reg_mask if necessary (not all register types are equal in DX vs GL) */
static
void
shader_glsl_add_dst
(
DWORD
param
,
const
char
*
reg_name
,
char
*
reg_mask
,
char
*
outStr
)
{
int
shift
=
(
param
&
D3DSP_DSTSHIFT_MASK
)
>>
D3DSP_DSTSHIFT_SHIFT
;
/* TODO: determine if destination is anything other than a float vector and accommodate*/
if
(
reg_name
[
0
]
==
'A'
)
sprintf
(
outStr
,
"%s%s = %sivec4("
,
reg_name
,
reg_mask
,
shift_glsl_tab
[
shift
]);
else
sprintf
(
outStr
,
"%s%s = %svec4("
,
reg_name
,
reg_mask
,
shift_glsl_tab
[
shift
]);
char
cast
[
6
];
if
((
shader_get_regtype
(
param
)
==
D3DSPR_RASTOUT
)
&&
((
param
&
D3DSP_REGNUM_MASK
)
!=
0
))
{
/* gl_FogFragCoord or glPointSize - both floats */
strcpy
(
cast
,
"float"
);
strcpy
(
reg_mask
,
""
);
}
else
if
(
reg_name
[
0
]
==
'A'
)
{
/* Address register for vertex shaders (ivec4) */
strcpy
(
cast
,
"ivec4"
);
}
else
{
/* Everything else should be a 4 component float vector */
strcpy
(
cast
,
"vec4"
);
}
sprintf
(
outStr
,
"%s%s = %s%s("
,
reg_name
,
reg_mask
,
shift_glsl_tab
[
shift
],
cast
);
}
/* Generate a GLSL parameter that does the input modifier computation and return the input register/mask to use */
...
...
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