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
5308e026
Commit
5308e026
authored
May 09, 2006
by
Jason Green
Committed by
Alexandre Julliard
May 10, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move program_dump_decl_usage into baseshader.
parent
a8752003
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
100 additions
and
157 deletions
+100
-157
baseshader.c
dlls/wined3d/baseshader.c
+75
-0
pixelshader.c
dlls/wined3d/pixelshader.c
+18
-81
vertexshader.c
dlls/wined3d/vertexshader.c
+3
-76
wined3d_private.h
dlls/wined3d/wined3d_private.h
+4
-0
No files found.
dlls/wined3d/baseshader.c
View file @
5308e026
...
...
@@ -159,4 +159,79 @@ void shader_get_registers_used(
}
}
void
shader_program_dump_decl_usage
(
DWORD
decl
,
DWORD
param
)
{
DWORD
regtype
=
shader_get_regtype
(
param
);
TRACE
(
"dcl_"
);
if
(
regtype
==
D3DSPR_SAMPLER
)
{
DWORD
ttype
=
decl
&
D3DSP_TEXTURETYPE_MASK
;
switch
(
ttype
)
{
case
D3DSTT_2D
:
TRACE
(
"2d"
);
break
;
case
D3DSTT_CUBE
:
TRACE
(
"cube"
);
break
;
case
D3DSTT_VOLUME
:
TRACE
(
"volume"
);
break
;
default:
TRACE
(
"unknown_ttype(%08lx)"
,
ttype
);
}
}
else
{
DWORD
usage
=
decl
&
D3DSP_DCL_USAGE_MASK
;
DWORD
idx
=
(
decl
&
D3DSP_DCL_USAGEINDEX_MASK
)
>>
D3DSP_DCL_USAGEINDEX_SHIFT
;
switch
(
usage
)
{
case
D3DDECLUSAGE_POSITION
:
TRACE
(
"%s%ld"
,
"position"
,
idx
);
break
;
case
D3DDECLUSAGE_BLENDINDICES
:
TRACE
(
"%s"
,
"blend"
);
break
;
case
D3DDECLUSAGE_BLENDWEIGHT
:
TRACE
(
"%s"
,
"weight"
);
break
;
case
D3DDECLUSAGE_NORMAL
:
TRACE
(
"%s%ld"
,
"normal"
,
idx
);
break
;
case
D3DDECLUSAGE_PSIZE
:
TRACE
(
"%s"
,
"psize"
);
break
;
case
D3DDECLUSAGE_COLOR
:
if
(
idx
==
0
)
{
TRACE
(
"%s"
,
"color"
);
}
else
{
TRACE
(
"%s%ld"
,
"specular"
,
(
idx
-
1
));
}
break
;
case
D3DDECLUSAGE_TEXCOORD
:
TRACE
(
"%s%ld"
,
"texture"
,
idx
);
break
;
case
D3DDECLUSAGE_TANGENT
:
TRACE
(
"%s"
,
"tangent"
);
break
;
case
D3DDECLUSAGE_BINORMAL
:
TRACE
(
"%s"
,
"binormal"
);
break
;
case
D3DDECLUSAGE_TESSFACTOR
:
TRACE
(
"%s"
,
"tessfactor"
);
break
;
case
D3DDECLUSAGE_POSITIONT
:
TRACE
(
"%s%ld"
,
"positionT"
,
idx
);
break
;
case
D3DDECLUSAGE_FOG
:
TRACE
(
"%s"
,
"fog"
);
break
;
case
D3DDECLUSAGE_DEPTH
:
TRACE
(
"%s"
,
"depth"
);
break
;
case
D3DDECLUSAGE_SAMPLE
:
TRACE
(
"%s"
,
"sample"
);
break
;
default:
FIXME
(
"unknown_semantics(%08lx)"
,
usage
);
}
}
}
/* TODO: Move other shared code here */
dlls/wined3d/pixelshader.c
View file @
5308e026
...
...
@@ -962,7 +962,7 @@ void pshader_set_version(
This
->
baseShader
.
limits
.
constant_int
=
0
;
This
->
baseShader
.
limits
.
constant_bool
=
0
;
This
->
baseShader
.
limits
.
texture
=
8
;
FIXME
(
"Unrecognized pixel shader version %l
u
!
\n
"
,
version
);
FIXME
(
"Unrecognized pixel shader version %l
x
!
\n
"
,
version
);
}
}
...
...
@@ -1606,80 +1606,6 @@ inline static void pshader_program_dump_ps_param(const DWORD param, int input) {
}
}
inline
static
void
pshader_program_dump_decl_usage
(
IWineD3DPixelShaderImpl
*
This
,
DWORD
decl
,
DWORD
param
)
{
DWORD
regtype
=
shader_get_regtype
(
param
);
TRACE
(
"dcl_"
);
if
(
regtype
==
D3DSPR_SAMPLER
)
{
DWORD
ttype
=
decl
&
D3DSP_TEXTURETYPE_MASK
;
switch
(
ttype
)
{
case
D3DSTT_2D
:
TRACE
(
"2d "
);
break
;
case
D3DSTT_CUBE
:
TRACE
(
"cube "
);
break
;
case
D3DSTT_VOLUME
:
TRACE
(
"volume "
);
break
;
default:
TRACE
(
"unknown_ttype(%08lx) "
,
ttype
);
}
}
else
{
DWORD
usage
=
decl
&
D3DSP_DCL_USAGE_MASK
;
DWORD
idx
=
(
decl
&
D3DSP_DCL_USAGEINDEX_MASK
)
>>
D3DSP_DCL_USAGEINDEX_SHIFT
;
switch
(
usage
)
{
case
D3DDECLUSAGE_POSITION
:
TRACE
(
"%s%ld "
,
"position"
,
idx
);
break
;
case
D3DDECLUSAGE_BLENDINDICES
:
TRACE
(
"%s "
,
"blend"
);
break
;
case
D3DDECLUSAGE_BLENDWEIGHT
:
TRACE
(
"%s "
,
"weight"
);
break
;
case
D3DDECLUSAGE_NORMAL
:
TRACE
(
"%s%ld "
,
"normal"
,
idx
);
break
;
case
D3DDECLUSAGE_PSIZE
:
TRACE
(
"%s "
,
"psize"
);
break
;
case
D3DDECLUSAGE_COLOR
:
if
(
idx
==
0
)
{
TRACE
(
"%s "
,
"color"
);
}
else
{
TRACE
(
"%s%ld "
,
"specular"
,
(
idx
-
1
));
}
break
;
case
D3DDECLUSAGE_TEXCOORD
:
TRACE
(
"%s%ld "
,
"texture"
,
idx
);
break
;
case
D3DDECLUSAGE_TANGENT
:
TRACE
(
"%s "
,
"tangent"
);
break
;
case
D3DDECLUSAGE_BINORMAL
:
TRACE
(
"%s "
,
"binormal"
);
break
;
case
D3DDECLUSAGE_TESSFACTOR
:
TRACE
(
"%s "
,
"tessfactor"
);
break
;
case
D3DDECLUSAGE_POSITIONT
:
TRACE
(
"%s%ld "
,
"positionT"
,
idx
);
break
;
case
D3DDECLUSAGE_FOG
:
TRACE
(
"%s "
,
"fog"
);
break
;
case
D3DDECLUSAGE_DEPTH
:
TRACE
(
"%s "
,
"depth"
);
break
;
case
D3DDECLUSAGE_SAMPLE
:
TRACE
(
"%s "
,
"sample"
);
break
;
default:
FIXME
(
"Unrecognised dcl %08lx"
,
usage
);
}
}
}
HRESULT
WINAPI
IWineD3DPixelShaderImpl_SetFunction
(
IWineD3DPixelShader
*
iface
,
CONST
DWORD
*
pFunction
)
{
IWineD3DPixelShaderImpl
*
This
=
(
IWineD3DPixelShaderImpl
*
)
iface
;
const
DWORD
*
pToken
=
pFunction
;
...
...
@@ -1724,12 +1650,23 @@ HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *iface, C
}
else
{
if
(
curOpcode
->
opcode
==
D3DSIO_DCL
)
{
pshader_program_dump_decl_usage
(
This
,
*
pToken
,
*
(
pToken
+
1
));
++
pToken
;
++
len
;
pshader_program_dump_ps_param
(
*
pToken
,
0
);
++
pToken
;
++
len
;
DWORD
usage
=
*
pToken
;
DWORD
param
=
*
(
pToken
+
1
);
DWORD
regtype
=
shader_get_regtype
(
param
);
/* Only print extended declaration for samplers or 3.0 input registers */
if
(
regtype
==
D3DSPR_SAMPLER
||
(
This
->
baseShader
.
version
>=
30
&&
regtype
==
D3DSPR_INPUT
))
shader_program_dump_decl_usage
(
usage
,
param
);
else
TRACE
(
"dcl"
);
pshader_program_dump_ins_modifiers
(
param
);
TRACE
(
" "
);
pshader_program_dump_ps_param
(
param
,
0
);
pToken
+=
2
;
len
+=
2
;
}
else
if
(
curOpcode
->
opcode
==
D3DSIO_DEF
)
{
TRACE
(
"def c%lu = "
,
*
pToken
&
0xFF
);
...
...
dlls/wined3d/vertexshader.c
View file @
5308e026
...
...
@@ -647,80 +647,6 @@ inline static void vshader_program_dump_vs_param(const DWORD param, int input) {
}
}
inline
static
void
vshader_program_dump_decl_usage
(
IWineD3DVertexShaderImpl
*
This
,
DWORD
decl
,
DWORD
param
)
{
DWORD
regtype
=
shader_get_regtype
(
param
);
TRACE
(
"dcl_"
);
if
(
regtype
==
D3DSPR_SAMPLER
)
{
DWORD
ttype
=
decl
&
D3DSP_TEXTURETYPE_MASK
;
switch
(
ttype
)
{
case
D3DSTT_2D
:
TRACE
(
"2d "
);
break
;
case
D3DSTT_CUBE
:
TRACE
(
"cube "
);
break
;
case
D3DSTT_VOLUME
:
TRACE
(
"volume "
);
break
;
default:
TRACE
(
"unknown_ttype(%08lx) "
,
ttype
);
}
}
else
{
DWORD
usage
=
decl
&
D3DSP_DCL_USAGE_MASK
;
DWORD
idx
=
(
decl
&
D3DSP_DCL_USAGEINDEX_MASK
)
>>
D3DSP_DCL_USAGEINDEX_SHIFT
;
switch
(
usage
)
{
case
D3DDECLUSAGE_POSITION
:
TRACE
(
"%s%ld "
,
"position"
,
idx
);
break
;
case
D3DDECLUSAGE_BLENDINDICES
:
TRACE
(
"%s "
,
"blend"
);
break
;
case
D3DDECLUSAGE_BLENDWEIGHT
:
TRACE
(
"%s "
,
"weight"
);
break
;
case
D3DDECLUSAGE_NORMAL
:
TRACE
(
"%s%ld "
,
"normal"
,
idx
);
break
;
case
D3DDECLUSAGE_PSIZE
:
TRACE
(
"%s "
,
"psize"
);
break
;
case
D3DDECLUSAGE_COLOR
:
if
(
idx
==
0
)
{
TRACE
(
"%s "
,
"color"
);
}
else
{
TRACE
(
"%s "
,
"specular"
);
}
break
;
case
D3DDECLUSAGE_TEXCOORD
:
TRACE
(
"%s%ld "
,
"texture"
,
idx
);
break
;
case
D3DDECLUSAGE_TANGENT
:
TRACE
(
"%s "
,
"tangent"
);
break
;
case
D3DDECLUSAGE_BINORMAL
:
TRACE
(
"%s "
,
"binormal"
);
break
;
case
D3DDECLUSAGE_TESSFACTOR
:
TRACE
(
"%s "
,
"tessfactor"
);
break
;
case
D3DDECLUSAGE_POSITIONT
:
TRACE
(
"%s%ld "
,
"positionT"
,
idx
);
break
;
case
D3DDECLUSAGE_FOG
:
TRACE
(
"%s "
,
"fog"
);
break
;
case
D3DDECLUSAGE_DEPTH
:
TRACE
(
"%s "
,
"depth"
);
break
;
case
D3DDECLUSAGE_SAMPLE
:
TRACE
(
"%s "
,
"sample"
);
break
;
default:
FIXME
(
"Unrecognised dcl %08lx"
,
usage
);
}
}
}
inline
static
BOOL
vshader_is_version_token
(
DWORD
token
)
{
return
0xFFFE0000
==
(
token
&
0xFFFE0000
);
}
...
...
@@ -1069,7 +995,7 @@ void vshader_set_version(
This
->
baseShader
.
limits
.
constant_bool
=
0
;
This
->
baseShader
.
limits
.
constant_int
=
0
;
This
->
baseShader
.
limits
.
address
=
1
;
FIXME
(
"Unrecognized vertex shader version %l
u
!
\n
"
,
version
);
FIXME
(
"Unrecognized vertex shader version %l
x
!
\n
"
,
version
);
}
}
...
...
@@ -1821,7 +1747,8 @@ HRESULT WINAPI IWineD3DVertexShaderImpl_SetFunction(IWineD3DVertexShader *iface,
DWORD
param
=
*
(
pToken
+
1
);
parse_decl_usage
(
This
,
usage
,
param
&
D3DSP_REGNUM_MASK
);
vshader_program_dump_decl_usage
(
This
,
usage
,
param
);
shader_program_dump_decl_usage
(
usage
,
param
);
TRACE
(
" "
);
vshader_program_dump_vs_param
(
param
,
0
);
pToken
+=
2
;
len
+=
2
;
...
...
dlls/wined3d/wined3d_private.h
View file @
5308e026
...
...
@@ -1275,6 +1275,10 @@ extern void shader_get_registers_used(
DWORD
*
tempsUsed
,
DWORD
*
texUsed
);
extern
void
shader_program_dump_decl_usage
(
DWORD
dcl
,
DWORD
param
);
inline
static
int
shader_get_regtype
(
const
DWORD
param
)
{
return
(((
param
&
D3DSP_REGTYPE_MASK
)
>>
D3DSP_REGTYPE_SHIFT
)
|
((
param
&
D3DSP_REGTYPE_MASK2
)
>>
D3DSP_REGTYPE_SHIFT2
));
...
...
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