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
c4eff1eb
Commit
c4eff1eb
authored
Apr 23, 2006
by
Roderick Colenbrander
Committed by
Alexandre Julliard
May 05, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Vertex Shader regtype cleanups.
parent
35f9a479
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
20 deletions
+14
-20
vertexshader.c
dlls/wined3d/vertexshader.c
+14
-20
No files found.
dlls/wined3d/vertexshader.c
View file @
c4eff1eb
...
...
@@ -707,12 +707,17 @@ inline static const SHADER_OPCODE* vshader_program_get_opcode(IWineD3DVertexShad
return
NULL
;
}
inline
static
int
vshader_program_get_regtype
(
const
DWORD
param
)
{
return
(((
param
&
D3DSP_REGTYPE_MASK
)
>>
D3DSP_REGTYPE_SHIFT
)
|
((
param
&
D3DSP_REGTYPE_MASK2
)
>>
D3DSP_REGTYPE_SHIFT2
));
}
inline
static
void
vshader_program_dump_param
(
const
DWORD
param
,
int
input
)
{
static
const
char
*
rastout_reg_names
[]
=
{
"oPos"
,
"oFog"
,
"oPts"
};
static
const
char
swizzle_reg_chars
[]
=
"xyzw"
;
DWORD
reg
=
param
&
D3DSP_REGNUM_MASK
;
DWORD
regtype
=
((
param
&
D3DSP_REGTYPE_MASK
)
>>
D3DSP_REGTYPE_SHIFT
);
DWORD
regtype
=
vshader_program_get_regtype
(
param
);
if
((
param
&
D3DSP_SRCMOD_MASK
)
==
D3DSPSM_NEG
)
TRACE
(
"-"
);
...
...
@@ -781,18 +786,9 @@ inline static void vshader_program_dump_param(const DWORD param, int input) {
inline
static
void
vshader_program_dump_vs_param
(
const
DWORD
param
,
int
input
)
{
static
const
char
*
rastout_reg_names
[]
=
{
"oPos"
,
"oFog"
,
"oPts"
};
static
const
char
swizzle_reg_chars
[]
=
"xyzw"
;
/* the unknown mask is for bits not yet accounted for by any other mask... */
#define UNKNOWN_MASK 0xC000
/* for registeres about 7 we have to add on bits 11 and 12 to get the correct register */
#define EXTENDED_REG 0x1800
DWORD
reg
=
param
&
D3DSP_REGNUM_MASK
;
DWORD
regtype
=
((
param
&
D3DSP_REGTYPE_MASK
)
>>
D3DSP_REGTYPE_SHIFT
)
|
((
param
&
EXTENDED_REG
)
>>
8
);
if
(
param
&
UNKNOWN_MASK
)
{
/* if this register has any of the unknown bits set then report them*/
FIXME
(
"Unknown bits set regtype %lx , %lx, UK(%lx)
\n
"
,
regtype
,
(
param
&
EXTENDED_REG
),
param
&
UNKNOWN_MASK
);
}
DWORD
regtype
=
vshader_program_get_regtype
(
param
);
if
((
param
&
D3DSP_SRCMOD_MASK
)
==
D3DSPSM_NEG
)
TRACE
(
"-"
);
...
...
@@ -875,9 +871,7 @@ 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
=
((
param
&
D3DSP_REGTYPE_MASK
)
>>
D3DSP_REGTYPE_SHIFT
)
|
((
param
&
D3DSP_REGTYPE_MASK2
)
>>
D3DSP_REGTYPE_SHIFT2
);
DWORD
regtype
=
vshader_program_get_regtype
(
param
);
TRACE
(
"dcl_"
);
...
...
@@ -1023,7 +1017,7 @@ inline static void vshader_program_add_param(IWineD3DVertexShaderImpl *This, con
static
const
char
*
hwrastout_reg_names
[]
=
{
"result.position"
,
"result.fogcoord"
,
"result.pointsize"
};
DWORD
reg
=
param
&
D3DSP_REGNUM_MASK
;
DWORD
regtype
=
((
param
&
D3DSP_REGTYPE_MASK
)
>>
D3DSP_REGTYPE_SHIFT
);
DWORD
regtype
=
vshader_program_get_regtype
(
param
);
char
tmpReg
[
255
];
BOOL
is_color
=
FALSE
;
...
...
@@ -1362,7 +1356,7 @@ inline static VOID IWineD3DVertexShaderImpl_GenerateProgramArbHW(IWineD3DVertexS
}
else
{
/* Check to see if and tmp or addressing redisters are used */
if
(
curOpcode
->
num_params
>
0
)
{
regtype
=
((((
*
pToken
)
&
D3DSP_REGTYPE_MASK
)
>>
D3DSP_REGTYPE_SHIFT
)
);
regtype
=
vshader_program_get_regtype
(
*
pToken
);
reg
=
((
*
pToken
)
&
D3DSP_REGNUM_MASK
);
if
(
D3DSPR_ADDR
==
regtype
&&
nUseAddressRegister
<=
reg
)
nUseAddressRegister
=
reg
+
1
;
if
(
D3DSPR_TEMP
==
regtype
){
...
...
@@ -1371,7 +1365,7 @@ inline static VOID IWineD3DVertexShaderImpl_GenerateProgramArbHW(IWineD3DVertexS
}
++
pToken
;
for
(
i
=
1
;
i
<
curOpcode
->
num_params
;
++
i
)
{
regtype
=
((((
*
pToken
)
&
D3DSP_REGTYPE_MASK
)
>>
D3DSP_REGTYPE_SHIFT
)
);
regtype
=
vshader_program_get_regtype
(
*
pToken
);
reg
=
((
*
pToken
)
&
D3DSP_REGNUM_MASK
);
if
(
D3DSPR_ADDR
==
regtype
&&
nUseAddressRegister
<=
reg
)
nUseAddressRegister
=
reg
+
1
;
if
(
D3DSPR_TEMP
==
regtype
){
...
...
@@ -1645,7 +1639,7 @@ inline static VOID IWineD3DVertexShaderImpl_GenerateProgramArbHW(IWineD3DVertexS
continue
;
case
D3DSIO_MOV
:
/* Address registers must be loaded with the ARL instruction */
if
(
(((
*
pToken
)
&
D3DSP_REGTYPE_MASK
)
>>
D3DSP_REGTYPE_SHIFT
)
==
D3DSPR_ADDR
)
{
if
(
vshader_program_get_regtype
(
*
pToken
)
==
D3DSPR_ADDR
)
{
if
(((
*
pToken
)
&
D3DSP_REGNUM_MASK
)
<
nUseAddressRegister
)
{
strcpy
(
tmpLine
,
"ARL"
);
break
;
...
...
@@ -1840,9 +1834,9 @@ HRESULT WINAPI IWineD3DVertexShaderImpl_ExecuteSW(IWineD3DVertexShader* iface, W
/* TRACE(">> execting opcode: pos=%d opcode_name=%s token=%08lX\n", pToken - vshader->function, curOpcode->name, *pToken); */
for
(
i
=
0
;
i
<
curOpcode
->
num_params
;
++
i
)
{
DWORD
reg
=
pToken
[
i
]
&
D3DSP_REGNUM_MASK
;
DWORD
regtype
=
((
pToken
[
i
]
&
D3DSP_REGTYPE_MASK
)
>>
D3DSP_REGTYPE_SHIFT
);
DWORD
regtype
=
vshader_program_get_regtype
(
pToken
[
i
]
);
switch
(
regtype
<<
D3DSP_REGTYPE_SHIFT
)
{
switch
(
regtype
/*<< D3DSP_REGTYPE_SHIFT*/
)
{
case
D3DSPR_TEMP
:
/* TRACE("p[%d]=R[%d]\n", i, reg); */
p
[
i
]
=
&
R
[
reg
];
...
...
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