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
aec2e3e4
Commit
aec2e3e4
authored
Jun 06, 2006
by
Ivan Gyurdiev
Committed by
Alexandre Julliard
Jun 06, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Trace improvements.
parent
2c232990
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
99 additions
and
42 deletions
+99
-42
baseshader.c
dlls/wined3d/baseshader.c
+33
-8
pixelshader.c
dlls/wined3d/pixelshader.c
+32
-17
vertexshader.c
dlls/wined3d/vertexshader.c
+32
-17
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
No files found.
dlls/wined3d/baseshader.c
View file @
aec2e3e4
...
...
@@ -160,6 +160,25 @@ int shader_skip_unrecognized(
return
tokens_read
;
}
/* Convert floating point offset relative
* to a register file to an absolute offset for float constants */
unsigned
int
shader_get_float_offset
(
const
DWORD
reg
)
{
unsigned
int
regnum
=
reg
&
D3DSP_REGNUM_MASK
;
int
regtype
=
shader_get_regtype
(
reg
);
switch
(
regtype
)
{
case
D3DSPR_CONST
:
return
regnum
;
case
D3DSPR_CONST2
:
return
2048
+
regnum
;
case
D3DSPR_CONST3
:
return
4096
+
regnum
;
case
D3DSPR_CONST4
:
return
6144
+
regnum
;
default:
FIXME
(
"Unsupported register type: %d
\n
"
,
regtype
);
return
regnum
;
}
}
/* Note that this does not count the loop register
* as an address register. */
...
...
@@ -330,21 +349,23 @@ static void shader_dump_arr_entry(
IWineD3DBaseShader
*
iface
,
const
DWORD
param
,
const
DWORD
addr_token
,
unsigned
int
reg
,
int
input
)
{
DWORD
reg
=
param
&
D3DSP_REGNUM_MASK
;
char
relative
=
((
param
&
D3DSHADER_ADDRESSMODE_MASK
)
==
D3DSHADER_ADDRMODE_RELATIVE
);
TRACE
(
"["
);
if
(
relative
)
{
TRACE
(
"["
);
if
(
addr_token
)
shader_dump_param
(
iface
,
addr_token
,
0
,
input
);
else
TRACE
(
"a0.x"
);
TRACE
(
" + "
);
}
TRACE
(
"%lu]"
,
reg
);
TRACE
(
"%u"
,
reg
);
if
(
relative
)
TRACE
(
"]"
);
}
void
shader_dump_param
(
...
...
@@ -388,11 +409,15 @@ void shader_dump_param(
TRACE
(
"r%lu"
,
reg
);
break
;
case
D3DSPR_INPUT
:
TRACE
(
"v%lu"
,
reg
);
TRACE
(
"v"
);
shader_dump_arr_entry
(
iface
,
param
,
addr_token
,
reg
,
input
);
break
;
case
D3DSPR_CONST
:
case
D3DSPR_CONST2
:
case
D3DSPR_CONST3
:
case
D3DSPR_CONST4
:
TRACE
(
"c"
);
shader_dump_arr_entry
(
iface
,
param
,
addr_token
,
input
);
shader_dump_arr_entry
(
iface
,
param
,
addr_token
,
shader_get_float_offset
(
param
),
input
);
break
;
case
D3DSPR_TEXTURE
:
/* vs: case D3DSPR_ADDR */
TRACE
(
"%c%lu"
,
(
pshader
?
't'
:
'a'
),
reg
);
...
...
@@ -416,18 +441,18 @@ void shader_dump_param(
if
(
D3DSHADER_VERSION_MAJOR
(
This
->
baseShader
.
hex_version
)
>=
3
)
{
TRACE
(
"o"
);
shader_dump_arr_entry
(
iface
,
param
,
addr_token
,
input
);
shader_dump_arr_entry
(
iface
,
param
,
addr_token
,
reg
,
input
);
}
else
TRACE
(
"oT%lu"
,
reg
);
break
;
case
D3DSPR_CONSTINT
:
TRACE
(
"i"
);
shader_dump_arr_entry
(
iface
,
param
,
addr_token
,
input
);
shader_dump_arr_entry
(
iface
,
param
,
addr_token
,
reg
,
input
);
break
;
case
D3DSPR_CONSTBOOL
:
TRACE
(
"b"
);
shader_dump_arr_entry
(
iface
,
param
,
addr_token
,
input
);
shader_dump_arr_entry
(
iface
,
param
,
addr_token
,
reg
,
input
);
break
;
case
D3DSPR_LABEL
:
TRACE
(
"l%lu"
,
reg
);
...
...
dlls/wined3d/pixelshader.c
View file @
aec2e3e4
...
...
@@ -1424,23 +1424,38 @@ HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *iface, C
pToken
+=
2
;
len
+=
2
;
}
else
if
(
curOpcode
->
opcode
==
D3DSIO_DEF
)
{
TRACE
(
"def c%lu = "
,
*
pToken
&
0xFF
);
++
pToken
;
++
len
;
TRACE
(
"%f ,"
,
*
(
float
*
)
pToken
);
++
pToken
;
++
len
;
TRACE
(
"%f ,"
,
*
(
float
*
)
pToken
);
++
pToken
;
++
len
;
TRACE
(
"%f ,"
,
*
(
float
*
)
pToken
);
++
pToken
;
++
len
;
TRACE
(
"%f"
,
*
(
float
*
)
pToken
);
++
pToken
;
++
len
;
}
else
if
(
curOpcode
->
opcode
==
D3DSIO_DEF
)
{
unsigned
int
offset
=
shader_get_float_offset
(
*
pToken
);
TRACE
(
"def c%u = %f, %f, %f, %f"
,
offset
,
*
(
float
*
)(
pToken
+
1
),
*
(
float
*
)(
pToken
+
2
),
*
(
float
*
)(
pToken
+
3
),
*
(
float
*
)(
pToken
+
4
));
pToken
+=
5
;
len
+=
5
;
}
else
if
(
curOpcode
->
opcode
==
D3DSIO_DEFI
)
{
TRACE
(
"defi i%lu = %ld, %ld, %ld, %ld"
,
*
pToken
&
D3DSP_REGNUM_MASK
,
(
long
)
*
(
pToken
+
1
),
(
long
)
*
(
pToken
+
2
),
(
long
)
*
(
pToken
+
3
),
(
long
)
*
(
pToken
+
4
));
pToken
+=
5
;
len
+=
5
;
}
else
if
(
curOpcode
->
opcode
==
D3DSIO_DEFB
)
{
TRACE
(
"defb b%lu = %s"
,
*
pToken
&
D3DSP_REGNUM_MASK
,
*
(
pToken
+
1
)
?
"true"
:
"false"
);
pToken
+=
2
;
len
+=
2
;
}
else
{
DWORD
param
,
addr_token
;
...
...
dlls/wined3d/vertexshader.c
View file @
aec2e3e4
...
...
@@ -1571,23 +1571,38 @@ HRESULT WINAPI IWineD3DVertexShaderImpl_SetFunction(IWineD3DVertexShader *iface,
pToken
+=
2
;
len
+=
2
;
}
else
if
(
curOpcode
->
opcode
==
D3DSIO_DEF
)
{
TRACE
(
"def c%lu = "
,
*
pToken
&
0xFF
);
++
pToken
;
++
len
;
TRACE
(
"%f ,"
,
*
(
float
*
)
pToken
);
++
pToken
;
++
len
;
TRACE
(
"%f ,"
,
*
(
float
*
)
pToken
);
++
pToken
;
++
len
;
TRACE
(
"%f ,"
,
*
(
float
*
)
pToken
);
++
pToken
;
++
len
;
TRACE
(
"%f"
,
*
(
float
*
)
pToken
);
++
pToken
;
++
len
;
}
else
if
(
curOpcode
->
opcode
==
D3DSIO_DEF
)
{
unsigned
int
offset
=
shader_get_float_offset
(
*
pToken
);
TRACE
(
"def c%u = %f, %f, %f, %f"
,
offset
,
*
(
float
*
)(
pToken
+
1
),
*
(
float
*
)(
pToken
+
2
),
*
(
float
*
)(
pToken
+
3
),
*
(
float
*
)(
pToken
+
4
));
pToken
+=
5
;
len
+=
5
;
}
else
if
(
curOpcode
->
opcode
==
D3DSIO_DEFI
)
{
TRACE
(
"defi i%lu = %ld, %ld, %ld, %ld"
,
*
pToken
&
D3DSP_REGNUM_MASK
,
(
long
)
*
(
pToken
+
1
),
(
long
)
*
(
pToken
+
2
),
(
long
)
*
(
pToken
+
3
),
(
long
)
*
(
pToken
+
4
));
pToken
+=
5
;
len
+=
5
;
}
else
if
(
curOpcode
->
opcode
==
D3DSIO_DEFB
)
{
TRACE
(
"defb b%lu = %s"
,
*
pToken
&
D3DSP_REGNUM_MASK
,
*
(
pToken
+
1
)
?
"true"
:
"false"
);
pToken
+=
2
;
len
+=
2
;
}
else
{
DWORD
param
,
addr_token
;
...
...
dlls/wined3d/wined3d_private.h
View file @
aec2e3e4
...
...
@@ -1363,6 +1363,8 @@ inline static int shader_get_regtype(const DWORD param) {
((
param
&
D3DSP_REGTYPE_MASK2
)
>>
D3DSP_REGTYPE_SHIFT2
));
}
extern
unsigned
int
shader_get_float_offset
(
const
DWORD
reg
);
inline
static
BOOL
shader_is_pshader_version
(
DWORD
token
)
{
return
0xFFFF0000
==
(
token
&
0xFFFF0000
);
}
...
...
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