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
a13df0e4
Commit
a13df0e4
authored
Dec 04, 2008
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 05, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Explicitly pass the version and instruction table to shader_get_opcode().
parent
af1bc3d9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
30 deletions
+36
-30
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+8
-5
baseshader.c
dlls/wined3d/baseshader.c
+19
-17
glsl_shader.c
dlls/wined3d/glsl_shader.c
+8
-5
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-3
No files found.
dlls/wined3d/arb_program_shader.c
View file @
a13df0e4
...
...
@@ -1485,6 +1485,9 @@ static void shader_hw_mnxn(const SHADER_OPCODE_ARG *arg)
int
i
;
int
nComponents
=
0
;
SHADER_OPCODE_ARG
tmpArg
;
IWineD3DBaseShaderImpl
*
shader
=
(
IWineD3DBaseShaderImpl
*
)
arg
->
shader
;
const
SHADER_OPCODE
*
opcode_table
=
shader
->
baseShader
.
shader_ins
;
DWORD
shader_version
=
shader
->
baseShader
.
hex_version
;
memset
(
&
tmpArg
,
0
,
sizeof
(
SHADER_OPCODE_ARG
));
...
...
@@ -1499,23 +1502,23 @@ static void shader_hw_mnxn(const SHADER_OPCODE_ARG *arg)
switch
(
arg
->
opcode
->
opcode
)
{
case
WINED3DSIO_M4x4
:
nComponents
=
4
;
tmpArg
.
opcode
=
shader_get_opcode
(
arg
->
shader
,
WINED3DSIO_DP4
);
tmpArg
.
opcode
=
shader_get_opcode
(
opcode_table
,
shader_version
,
WINED3DSIO_DP4
);
break
;
case
WINED3DSIO_M4x3
:
nComponents
=
3
;
tmpArg
.
opcode
=
shader_get_opcode
(
arg
->
shader
,
WINED3DSIO_DP4
);
tmpArg
.
opcode
=
shader_get_opcode
(
opcode_table
,
shader_version
,
WINED3DSIO_DP4
);
break
;
case
WINED3DSIO_M3x4
:
nComponents
=
4
;
tmpArg
.
opcode
=
shader_get_opcode
(
arg
->
shader
,
WINED3DSIO_DP3
);
tmpArg
.
opcode
=
shader_get_opcode
(
opcode_table
,
shader_version
,
WINED3DSIO_DP3
);
break
;
case
WINED3DSIO_M3x3
:
nComponents
=
3
;
tmpArg
.
opcode
=
shader_get_opcode
(
arg
->
shader
,
WINED3DSIO_DP3
);
tmpArg
.
opcode
=
shader_get_opcode
(
opcode_table
,
shader_version
,
WINED3DSIO_DP3
);
break
;
case
WINED3DSIO_M3x2
:
nComponents
=
2
;
tmpArg
.
opcode
=
shader_get_opcode
(
arg
->
shader
,
WINED3DSIO_DP3
);
tmpArg
.
opcode
=
shader_get_opcode
(
opcode_table
,
shader_version
,
WINED3DSIO_DP3
);
break
;
default:
break
;
...
...
dlls/wined3d/baseshader.c
View file @
a13df0e4
...
...
@@ -76,27 +76,25 @@ int shader_addline(
return
0
;
}
const
SHADER_OPCODE
*
shader_get_opcode
(
IWineD3DBaseShader
*
iface
,
const
DWORD
code
)
{
IWineD3DBaseShaderImpl
*
This
=
(
IWineD3DBaseShaderImpl
*
)
iface
;
const
SHADER_OPCODE
*
shader_get_opcode
(
const
SHADER_OPCODE
*
opcode_table
,
DWORD
shader_version
,
DWORD
code
)
{
DWORD
i
=
0
;
DWORD
hex_version
=
This
->
baseShader
.
hex_version
;
const
SHADER_OPCODE
*
shader_ins
=
This
->
baseShader
.
shader_ins
;
/** TODO: use dichotomic search */
while
(
NULL
!=
shader_ins
[
i
].
name
)
{
if
((
code
&
WINED3DSI_OPCODE_MASK
)
==
shader_ins
[
i
].
opcode
&&
hex_version
>=
shader_ins
[
i
].
min_version
&&
(
!
shader_ins
[
i
].
max_version
||
hex_version
<=
shader_ins
[
i
].
max_version
))
while
(
opcode_table
[
i
].
name
)
{
if
((
code
&
WINED3DSI_OPCODE_MASK
)
==
opcode_table
[
i
].
opcode
&&
shader_version
>=
opcode_table
[
i
].
min_version
&&
(
!
opcode_table
[
i
].
max_version
||
shader_version
<=
opcode_table
[
i
].
max_version
))
{
return
&
shader_ins
[
i
];
return
&
opcode_table
[
i
];
}
++
i
;
}
FIXME
(
"Unsupported opcode %#x(%d) masked %#x, shader version %#x
\n
"
,
code
,
code
,
code
&
WINED3DSI_OPCODE_MASK
,
hex_version
);
FIXME
(
"Unsupported opcode %#x(%d) masked %#x, shader version %#x
\n
"
,
code
,
code
,
code
&
WINED3DSI_OPCODE_MASK
,
shader_version
);
return
NULL
;
}
...
...
@@ -204,6 +202,8 @@ HRESULT shader_get_registers_used(
IWineD3DStateBlockImpl
*
stateBlock
)
{
IWineD3DBaseShaderImpl
*
This
=
(
IWineD3DBaseShaderImpl
*
)
iface
;
const
SHADER_OPCODE
*
shader_ins
=
This
->
baseShader
.
shader_ins
;
DWORD
shader_version
=
This
->
baseShader
.
hex_version
;
unsigned
int
cur_loop_depth
=
0
,
max_loop_depth
=
0
;
/* There are some minor differences between pixel and vertex shaders */
...
...
@@ -241,7 +241,7 @@ HRESULT shader_get_registers_used(
/* Fetch opcode */
opcode_token
=
*
pToken
++
;
curOpcode
=
shader_get_opcode
(
iface
,
opcode_token
);
curOpcode
=
shader_get_opcode
(
shader_ins
,
shader_version
,
opcode_token
);
/* Unhandled opcode, and its parameters */
if
(
NULL
==
curOpcode
)
{
...
...
@@ -840,7 +840,9 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer,
{
IWineD3DBaseShaderImpl
*
This
=
(
IWineD3DBaseShaderImpl
*
)
iface
;
IWineD3DDeviceImpl
*
device
=
(
IWineD3DDeviceImpl
*
)
This
->
baseShader
.
device
;
/* To access shader backend callbacks */
const
SHADER_OPCODE
*
opcode_table
=
This
->
baseShader
.
shader_ins
;
const
SHADER_HANDLER
*
handler_table
=
device
->
shader_backend
->
shader_instruction_handler_table
;
DWORD
shader_version
=
This
->
baseShader
.
hex_version
;
const
DWORD
*
pToken
=
pFunction
;
const
SHADER_OPCODE
*
curOpcode
=
NULL
;
SHADER_HANDLER
hw_fct
=
NULL
;
...
...
@@ -874,7 +876,7 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer,
/* Read opcode */
hw_arg
.
opcode_token
=
*
pToken
++
;
curOpcode
=
shader_get_opcode
(
iface
,
hw_arg
.
opcode_token
);
curOpcode
=
shader_get_opcode
(
opcode_table
,
shader_version
,
hw_arg
.
opcode_token
);
/* Select handler */
if
(
curOpcode
==
NULL
)
...
...
@@ -1009,7 +1011,7 @@ void shader_trace_init(
continue
;
}
opcode_token
=
*
pToken
++
;
curOpcode
=
shader_get_opcode
(
iface
,
opcode_token
);
curOpcode
=
shader_get_opcode
(
This
->
baseShader
.
shader_ins
,
This
->
baseShader
.
hex_version
,
opcode_token
);
len
++
;
if
(
NULL
==
curOpcode
)
{
...
...
dlls/wined3d/glsl_shader.c
View file @
a13df0e4
...
...
@@ -1747,6 +1747,9 @@ static void shader_glsl_mad(const SHADER_OPCODE_ARG *arg)
Vertex shaders to GLSL codes */
static
void
shader_glsl_mnxn
(
const
SHADER_OPCODE_ARG
*
arg
)
{
IWineD3DBaseShaderImpl
*
shader
=
(
IWineD3DBaseShaderImpl
*
)
arg
->
shader
;
const
SHADER_OPCODE
*
opcode_table
=
shader
->
baseShader
.
shader_ins
;
DWORD
shader_version
=
shader
->
baseShader
.
hex_version
;
int
i
;
int
nComponents
=
0
;
SHADER_OPCODE_ARG
tmpArg
;
...
...
@@ -1764,23 +1767,23 @@ static void shader_glsl_mnxn(const SHADER_OPCODE_ARG *arg)
switch
(
arg
->
opcode
->
opcode
)
{
case
WINED3DSIO_M4x4
:
nComponents
=
4
;
tmpArg
.
opcode
=
shader_get_opcode
(
arg
->
shader
,
WINED3DSIO_DP4
);
tmpArg
.
opcode
=
shader_get_opcode
(
opcode_table
,
shader_version
,
WINED3DSIO_DP4
);
break
;
case
WINED3DSIO_M4x3
:
nComponents
=
3
;
tmpArg
.
opcode
=
shader_get_opcode
(
arg
->
shader
,
WINED3DSIO_DP4
);
tmpArg
.
opcode
=
shader_get_opcode
(
opcode_table
,
shader_version
,
WINED3DSIO_DP4
);
break
;
case
WINED3DSIO_M3x4
:
nComponents
=
4
;
tmpArg
.
opcode
=
shader_get_opcode
(
arg
->
shader
,
WINED3DSIO_DP3
);
tmpArg
.
opcode
=
shader_get_opcode
(
opcode_table
,
shader_version
,
WINED3DSIO_DP3
);
break
;
case
WINED3DSIO_M3x3
:
nComponents
=
3
;
tmpArg
.
opcode
=
shader_get_opcode
(
arg
->
shader
,
WINED3DSIO_DP3
);
tmpArg
.
opcode
=
shader_get_opcode
(
opcode_table
,
shader_version
,
WINED3DSIO_DP3
);
break
;
case
WINED3DSIO_M3x2
:
nComponents
=
2
;
tmpArg
.
opcode
=
shader_get_opcode
(
arg
->
shader
,
WINED3DSIO_DP3
);
tmpArg
.
opcode
=
shader_get_opcode
(
opcode_table
,
shader_version
,
WINED3DSIO_DP3
);
break
;
default:
break
;
...
...
dlls/wined3d/wined3d_private.h
View file @
a13df0e4
...
...
@@ -2161,9 +2161,7 @@ extern int shader_addline(
SHADER_BUFFER
*
buffer
,
const
char
*
fmt
,
...)
PRINTF_ATTR
(
2
,
3
);
extern
const
SHADER_OPCODE
*
shader_get_opcode
(
IWineD3DBaseShader
*
iface
,
const
DWORD
code
);
const
SHADER_OPCODE
*
shader_get_opcode
(
const
SHADER_OPCODE
*
shader_ins
,
DWORD
shader_version
,
DWORD
code
);
/* Vertex shader utility functions */
extern
BOOL
vshader_get_input
(
...
...
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