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
f444009b
Commit
f444009b
authored
Jun 16, 2006
by
Jason Green
Committed by
Alexandre Julliard
Jun 19, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Implement locally defined boolean and integer constants in GLSL.
parent
34d271ba
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
5 deletions
+32
-5
glsl_shader.c
dlls/wined3d/glsl_shader.c
+26
-1
pixelshader.c
dlls/wined3d/pixelshader.c
+2
-2
vertexshader.c
dlls/wined3d/vertexshader.c
+2
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
No files found.
dlls/wined3d/glsl_shader.c
View file @
f444009b
...
...
@@ -947,7 +947,7 @@ void shader_glsl_lrp(SHADER_OPCODE_ARG* arg) {
tmpLine
,
src2_str
,
src1_str
,
src0_str
,
src0_str
,
dst_mask
);
}
/** Process the D3DSIO_D
CL
opcode into a GLSL string - creates a local vec4
/** Process the D3DSIO_D
EF
opcode into a GLSL string - creates a local vec4
* float constant, and stores it's usage on the regmaps. */
void
shader_glsl_def
(
SHADER_OPCODE_ARG
*
arg
)
{
...
...
@@ -967,6 +967,31 @@ void shader_glsl_def(SHADER_OPCODE_ARG* arg) {
arg
->
reg_maps
->
constantsF
[
reg
]
=
1
;
}
/** Process the D3DSIO_DEFI opcode into a GLSL string - creates a local ivec4
* integer constant, and stores it's usage on the regmaps. */
void
shader_glsl_defi
(
SHADER_OPCODE_ARG
*
arg
)
{
DWORD
reg
=
arg
->
dst
&
D3DSP_REGNUM_MASK
;
shader_addline
(
arg
->
buffer
,
"const ivec4 I%lu = { %ld, %ld, %ld, %ld };
\n
"
,
reg
,
(
long
)
arg
->
src
[
0
],
(
long
)
arg
->
src
[
1
],
(
long
)
arg
->
src
[
2
],
(
long
)
arg
->
src
[
3
]);
arg
->
reg_maps
->
constantsI
[
reg
]
=
1
;
}
/** Process the D3DSIO_DEFB opcode into a GLSL string - creates a local boolean
* constant, and stores it's usage on the regmaps. */
void
shader_glsl_defb
(
SHADER_OPCODE_ARG
*
arg
)
{
DWORD
reg
=
arg
->
dst
&
D3DSP_REGNUM_MASK
;
shader_addline
(
arg
->
buffer
,
"const bool B%lu = %s;
\n
"
,
reg
,
(
arg
->
src
[
0
])
?
"true"
:
"false"
);
arg
->
reg_maps
->
constantsB
[
reg
]
=
1
;
}
/** Process the D3DSIO_LIT instruction in GLSL:
* dst.x = dst.w = 1.0
* dst.y = (src0.x > 0) ? src0.x
...
...
dlls/wined3d/pixelshader.c
View file @
f444009b
...
...
@@ -707,8 +707,8 @@ CONST SHADER_OPCODE IWineD3DPixelShaderImpl_shader_ins[] = {
/* Constant definitions */
{
D3DSIO_DEF
,
"def"
,
"undefined"
,
1
,
5
,
pshader_def
,
shader_hw_def
,
shader_glsl_def
,
0
,
0
},
{
D3DSIO_DEFB
,
"defb"
,
GLNAME_REQUIRE_GLSL
,
1
,
2
,
pshader_defb
,
NULL
,
NULL
,
0
,
0
},
{
D3DSIO_DEFI
,
"defi"
,
GLNAME_REQUIRE_GLSL
,
1
,
5
,
pshader_defi
,
NULL
,
NULL
,
0
,
0
},
{
D3DSIO_DEFB
,
"defb"
,
GLNAME_REQUIRE_GLSL
,
1
,
2
,
pshader_defb
,
NULL
,
shader_glsl_defb
,
0
,
0
},
{
D3DSIO_DEFI
,
"defi"
,
GLNAME_REQUIRE_GLSL
,
1
,
5
,
pshader_defi
,
NULL
,
shader_glsl_defi
,
0
,
0
},
/* Texture */
{
D3DSIO_TEXCOORD
,
"texcoord"
,
"undefined"
,
1
,
1
,
pshader_texcoord
,
pshader_hw_texcoord
,
pshader_glsl_texcoord
,
0
,
D3DPS_VERSION
(
1
,
3
)},
...
...
dlls/wined3d/vertexshader.c
View file @
f444009b
...
...
@@ -536,8 +536,8 @@ CONST SHADER_OPCODE IWineD3DVertexShaderImpl_shader_ins[] = {
/* Constant definitions */
{
D3DSIO_DEF
,
"def"
,
NULL
,
1
,
5
,
vshader_def
,
shader_hw_def
,
shader_glsl_def
,
0
,
0
},
{
D3DSIO_DEFB
,
"defb"
,
GLNAME_REQUIRE_GLSL
,
1
,
2
,
vshader_defb
,
NULL
,
NULL
,
0
,
0
},
{
D3DSIO_DEFI
,
"defi"
,
GLNAME_REQUIRE_GLSL
,
1
,
5
,
vshader_defi
,
NULL
,
NULL
,
0
,
0
},
{
D3DSIO_DEFB
,
"defb"
,
GLNAME_REQUIRE_GLSL
,
1
,
2
,
vshader_defb
,
NULL
,
shader_glsl_defb
,
0
,
0
},
{
D3DSIO_DEFI
,
"defi"
,
GLNAME_REQUIRE_GLSL
,
1
,
5
,
vshader_defi
,
NULL
,
shader_glsl_defi
,
0
,
0
},
/* Flow control - requires GLSL or software shaders */
{
D3DSIO_REP
,
"rep"
,
GLNAME_REQUIRE_GLSL
,
0
,
1
,
vshader_rep
,
NULL
,
NULL
,
0
,
0
},
...
...
dlls/wined3d/wined3d_private.h
View file @
f444009b
...
...
@@ -1376,6 +1376,8 @@ extern void shader_glsl_rcp(SHADER_OPCODE_ARG* arg);
extern
void
shader_glsl_cnd
(
SHADER_OPCODE_ARG
*
arg
);
extern
void
shader_glsl_compare
(
SHADER_OPCODE_ARG
*
arg
);
extern
void
shader_glsl_def
(
SHADER_OPCODE_ARG
*
arg
);
extern
void
shader_glsl_defi
(
SHADER_OPCODE_ARG
*
arg
);
extern
void
shader_glsl_defb
(
SHADER_OPCODE_ARG
*
arg
);
extern
void
shader_glsl_cmp
(
SHADER_OPCODE_ARG
*
arg
);
extern
void
shader_glsl_lit
(
SHADER_OPCODE_ARG
*
arg
);
extern
void
shader_glsl_dst
(
SHADER_OPCODE_ARG
*
arg
);
...
...
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