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
0615c8e4
Commit
0615c8e4
authored
Oct 28, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Nov 06, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pixel Shader varying indexing.
parent
9a9dfc76
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
7 deletions
+51
-7
glsl_shader.c
dlls/wined3d/glsl_shader.c
+51
-7
No files found.
dlls/wined3d/glsl_shader.c
View file @
0615c8e4
...
@@ -773,9 +773,16 @@ static void shader_glsl_get_register_name(
...
@@ -773,9 +773,16 @@ static void shader_glsl_get_register_name(
case
WINED3DSPR_INPUT
:
case
WINED3DSPR_INPUT
:
if
(
pshader
)
{
if
(
pshader
)
{
/* Pixel shaders >= 3.0 */
/* Pixel shaders >= 3.0 */
if
(
WINED3DSHADER_VERSION_MAJOR
(
This
->
baseShader
.
hex_version
)
>=
3
)
if
(
WINED3DSHADER_VERSION_MAJOR
(
This
->
baseShader
.
hex_version
)
>=
3
)
{
sprintf
(
tmpStr
,
"IN[%u]"
,
reg
);
if
(
param
&
WINED3DSHADER_ADDRMODE_RELATIVE
)
{
else
{
glsl_src_param_t
rel_param
;
shader_glsl_add_src_param
(
arg
,
addr_token
,
0
,
WINED3DSP_WRITEMASK_0
,
&
rel_param
);
sprintf
(
tmpStr
,
"IN[%s + %u]"
,
rel_param
.
param_str
,
reg
);
}
else
{
sprintf
(
tmpStr
,
"IN[%u]"
,
reg
);
}
}
else
{
if
(
reg
==
0
)
if
(
reg
==
0
)
strcpy
(
tmpStr
,
"gl_Color"
);
strcpy
(
tmpStr
,
"gl_Color"
);
else
else
...
@@ -1817,13 +1824,50 @@ void shader_glsl_sincos(SHADER_OPCODE_ARG* arg) {
...
@@ -1817,13 +1824,50 @@ void shader_glsl_sincos(SHADER_OPCODE_ARG* arg) {
void
shader_glsl_loop
(
SHADER_OPCODE_ARG
*
arg
)
{
void
shader_glsl_loop
(
SHADER_OPCODE_ARG
*
arg
)
{
glsl_src_param_t
src1_param
;
glsl_src_param_t
src1_param
;
IWineD3DBaseShaderImpl
*
shader
=
(
IWineD3DBaseShaderImpl
*
)
arg
->
shader
;
IWineD3DBaseShaderImpl
*
shader
=
(
IWineD3DBaseShaderImpl
*
)
arg
->
shader
;
DWORD
regtype
=
shader_get_regtype
(
arg
->
src
[
1
]);
DWORD
reg
=
arg
->
src
[
1
]
&
WINED3DSP_REGNUM_MASK
;
const
DWORD
*
control_values
=
NULL
;
local_constant
*
constant
;
shader_glsl_add_src_param
(
arg
,
arg
->
src
[
1
],
arg
->
src_addr
[
1
],
WINED3DSP_WRITEMASK_ALL
,
&
src1_param
);
shader_glsl_add_src_param
(
arg
,
arg
->
src
[
1
],
arg
->
src_addr
[
1
],
WINED3DSP_WRITEMASK_ALL
,
&
src1_param
);
shader_addline
(
arg
->
buffer
,
"for (tmpInt%u = 0, aL%u = %s.y; tmpInt%u < %s.x; tmpInt%u++, aL%u += %s.z) {
\n
"
,
/* Try to hardcode the loop control parameters if possible. Direct3D 9 class hardware doesn't support real
shader
->
baseShader
.
cur_loop_depth
,
shader
->
baseShader
.
cur_loop_regno
,
* varying indexing, but Microsoft designed this feature for Shader model 2.x+. If the loop control is
src1_param
.
reg_name
,
shader
->
baseShader
.
cur_loop_depth
,
src1_param
.
reg_name
,
* known at compile time, the GLSL compiler can unroll the loop, and replace indirect addressing with direct
shader
->
baseShader
.
cur_loop_depth
,
shader
->
baseShader
.
cur_loop_regno
,
src1_param
.
reg_name
);
* addressing.
*/
if
(
regtype
==
WINED3DSPR_CONSTINT
)
{
LIST_FOR_EACH_ENTRY
(
constant
,
&
shader
->
baseShader
.
constantsI
,
local_constant
,
entry
)
{
if
(
constant
->
idx
==
reg
)
{
control_values
=
constant
->
value
;
break
;
}
}
}
if
(
control_values
)
{
if
(
control_values
[
2
]
>
0
)
{
shader_addline
(
arg
->
buffer
,
"for (aL%u = %d; aL%u < (%d * %d + %d); aL%u += %d) {
\n
"
,
shader
->
baseShader
.
cur_loop_depth
,
control_values
[
1
],
shader
->
baseShader
.
cur_loop_depth
,
control_values
[
0
],
control_values
[
2
],
control_values
[
1
],
shader
->
baseShader
.
cur_loop_depth
,
control_values
[
2
]);
}
else
if
(
control_values
[
2
]
==
0
)
{
shader_addline
(
arg
->
buffer
,
"for (aL%u = %d, tmpInt%u = 0; tmpInt%u < %d; tmpInt%u++) {
\n
"
,
shader
->
baseShader
.
cur_loop_depth
,
control_values
[
1
],
shader
->
baseShader
.
cur_loop_depth
,
shader
->
baseShader
.
cur_loop_depth
,
control_values
[
0
],
shader
->
baseShader
.
cur_loop_depth
);
}
else
{
shader_addline
(
arg
->
buffer
,
"for (aL%u = %d; aL%u > (%d * %d + %d); aL%u += %d) {
\n
"
,
shader
->
baseShader
.
cur_loop_depth
,
control_values
[
1
],
shader
->
baseShader
.
cur_loop_depth
,
control_values
[
0
],
control_values
[
2
],
control_values
[
1
],
shader
->
baseShader
.
cur_loop_depth
,
control_values
[
2
]);
}
}
else
{
shader_addline
(
arg
->
buffer
,
"for (tmpInt%u = 0, aL%u = %s.y; tmpInt%u < %s.x; tmpInt%u++, aL%u += %s.z) {
\n
"
,
shader
->
baseShader
.
cur_loop_depth
,
shader
->
baseShader
.
cur_loop_regno
,
src1_param
.
reg_name
,
shader
->
baseShader
.
cur_loop_depth
,
src1_param
.
reg_name
,
shader
->
baseShader
.
cur_loop_depth
,
shader
->
baseShader
.
cur_loop_regno
,
src1_param
.
reg_name
);
}
shader
->
baseShader
.
cur_loop_depth
++
;
shader
->
baseShader
.
cur_loop_depth
++
;
shader
->
baseShader
.
cur_loop_regno
++
;
shader
->
baseShader
.
cur_loop_regno
++
;
...
...
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