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
4b307943
Commit
4b307943
authored
Apr 28, 2006
by
Ivan Gyurdiev
Committed by
Alexandre Julliard
May 08, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Share get_register_code().
parent
b8338605
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
27 deletions
+19
-27
pixelshader.c
dlls/wined3d/pixelshader.c
+4
-12
vertexshader.c
dlls/wined3d/vertexshader.c
+10
-15
wined3d_private.h
dlls/wined3d/wined3d_private.h
+5
-0
No files found.
dlls/wined3d/pixelshader.c
View file @
4b307943
...
...
@@ -752,7 +752,7 @@ inline static void get_register_name(const DWORD param, char* regstr, char const
static
const
char
*
rastout_reg_names
[]
=
{
"oC0"
,
"oC1"
,
"oC2"
,
"oC3"
,
"oDepth"
};
DWORD
reg
=
param
&
D3DSP_REGNUM_MASK
;
DWORD
regtype
=
((
param
&
D3DSP_REGTYPE_MASK
)
>>
D3DSP_REGTYPE_SHIFT
);
DWORD
regtype
=
shader_get_regtype
(
param
);
switch
(
regtype
)
{
case
D3DSPR_TEMP
:
...
...
@@ -978,7 +978,7 @@ inline static void pshader_program_get_registers_used(
int
i
;
for
(
i
=
0
;
i
<
curOpcode
->
num_params
;
++
i
)
{
DWORD
regtype
=
(((
*
pToken
)
&
D3DSP_REGTYPE_MASK
)
>>
D3DSP_REGTYPE_SHIFT
);
DWORD
regtype
=
shader_get_regtype
(
*
pToken
);
DWORD
reg
=
(
*
pToken
)
&
D3DSP_REGNUM_MASK
;
if
(
D3DSPR_TEXTURE
==
regtype
)
*
texUsed
|=
(
1
<<
reg
);
...
...
@@ -1614,14 +1614,8 @@ inline static void pshader_program_dump_ps_param(const DWORD param, int input) {
static
const
char
*
rastout_reg_names
[]
=
{
"oC0"
,
"oC1"
,
"oC2"
,
"oC3"
,
"oDepth"
};
static
const
char
swizzle_reg_chars
[]
=
"rgba"
;
/* 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
);
DWORD
regtype
=
shader_get_regtype
(
param
);
if
(
input
)
{
if
(
((
param
&
D3DSP_SRCMOD_MASK
)
==
D3DSPSM_NEG
)
||
...
...
@@ -1737,9 +1731,7 @@ 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
=
((
param
&
D3DSP_REGTYPE_MASK
)
>>
D3DSP_REGTYPE_SHIFT
)
|
((
param
&
D3DSP_REGTYPE_MASK2
)
>>
D3DSP_REGTYPE_SHIFT2
);
DWORD
regtype
=
shader_get_regtype
(
param
);
TRACE
(
"dcl_"
);
if
(
regtype
==
D3DSPR_SAMPLER
)
{
...
...
dlls/wined3d/vertexshader.c
View file @
4b307943
...
...
@@ -569,17 +569,12 @@ 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
=
vshader_program
_get_regtype
(
param
);
DWORD
regtype
=
shader
_get_regtype
(
param
);
if
((
param
&
D3DSP_SRCMOD_MASK
)
==
D3DSPSM_NEG
)
TRACE
(
"-"
);
...
...
@@ -650,11 +645,11 @@ inline static void vshader_program_dump_vs_param(const DWORD param, int input) {
static
const
char
swizzle_reg_chars
[]
=
"xyzw"
;
DWORD
reg
=
param
&
D3DSP_REGNUM_MASK
;
DWORD
regtype
=
vshader_program
_get_regtype
(
param
);
DWORD
regtype
=
shader
_get_regtype
(
param
);
if
((
param
&
D3DSP_SRCMOD_MASK
)
==
D3DSPSM_NEG
)
TRACE
(
"-"
);
switch
(
regtype
/*<< D3DSP_REGTYPE_SHIFT*/
)
{
switch
(
regtype
)
{
case
D3DSPR_TEMP
:
TRACE
(
"r%lu"
,
reg
);
break
;
...
...
@@ -733,7 +728,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
=
vshader_program
_get_regtype
(
param
);
DWORD
regtype
=
shader
_get_regtype
(
param
);
TRACE
(
"dcl_"
);
...
...
@@ -879,7 +874,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
=
vshader_program
_get_regtype
(
param
);
DWORD
regtype
=
shader
_get_regtype
(
param
);
char
tmpReg
[
255
];
BOOL
is_color
=
FALSE
;
...
...
@@ -1218,7 +1213,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
=
vshader_program
_get_regtype
(
*
pToken
);
regtype
=
shader
_get_regtype
(
*
pToken
);
reg
=
((
*
pToken
)
&
D3DSP_REGNUM_MASK
);
if
(
D3DSPR_ADDR
==
regtype
&&
nUseAddressRegister
<=
reg
)
nUseAddressRegister
=
reg
+
1
;
if
(
D3DSPR_TEMP
==
regtype
){
...
...
@@ -1227,7 +1222,7 @@ inline static VOID IWineD3DVertexShaderImpl_GenerateProgramArbHW(IWineD3DVertexS
}
++
pToken
;
for
(
i
=
1
;
i
<
curOpcode
->
num_params
;
++
i
)
{
regtype
=
vshader_program
_get_regtype
(
*
pToken
);
regtype
=
shader
_get_regtype
(
*
pToken
);
reg
=
((
*
pToken
)
&
D3DSP_REGNUM_MASK
);
if
(
D3DSPR_ADDR
==
regtype
&&
nUseAddressRegister
<=
reg
)
nUseAddressRegister
=
reg
+
1
;
if
(
D3DSPR_TEMP
==
regtype
){
...
...
@@ -1501,7 +1496,7 @@ inline static VOID IWineD3DVertexShaderImpl_GenerateProgramArbHW(IWineD3DVertexS
continue
;
case
D3DSIO_MOV
:
/* Address registers must be loaded with the ARL instruction */
if
(
vshader_program
_get_regtype
(
*
pToken
)
==
D3DSPR_ADDR
)
{
if
(
shader
_get_regtype
(
*
pToken
)
==
D3DSPR_ADDR
)
{
if
(((
*
pToken
)
&
D3DSP_REGNUM_MASK
)
<
nUseAddressRegister
)
{
strcpy
(
tmpLine
,
"ARL"
);
break
;
...
...
@@ -1696,9 +1691,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
=
vshader_program
_get_regtype
(
pToken
[
i
]);
DWORD
regtype
=
shader
_get_regtype
(
pToken
[
i
]);
switch
(
regtype
/*<< D3DSP_REGTYPE_SHIFT*/
)
{
switch
(
regtype
)
{
case
D3DSPR_TEMP
:
/* TRACE("p[%d]=R[%d]\n", i, reg); */
p
[
i
]
=
&
R
[
reg
];
...
...
dlls/wined3d/wined3d_private.h
View file @
4b307943
...
...
@@ -1203,6 +1203,11 @@ typedef struct IWineD3DBaseShaderImpl {
IWineD3DBaseShaderClass
baseShader
;
}
IWineD3DBaseShaderImpl
;
inline
static
int
shader_get_regtype
(
const
DWORD
param
)
{
return
(((
param
&
D3DSP_REGTYPE_MASK
)
>>
D3DSP_REGTYPE_SHIFT
)
|
((
param
&
D3DSP_REGTYPE_MASK2
)
>>
D3DSP_REGTYPE_SHIFT2
));
}
/*****************************************************************************
* IDirect3DVertexShader implementation structure
*/
...
...
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