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
65321dd1
Commit
65321dd1
authored
Apr 29, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Introduce shader_sm1_read_semantic().
parent
8d4c9049
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
31 deletions
+40
-31
baseshader.c
dlls/wined3d/baseshader.c
+39
-31
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/baseshader.c
View file @
65321dd1
...
@@ -262,6 +262,17 @@ static void shader_sm1_read_dst_param(const DWORD **ptr, struct wined3d_shader_d
...
@@ -262,6 +262,17 @@ static void shader_sm1_read_dst_param(const DWORD **ptr, struct wined3d_shader_d
}
}
}
}
static
void
shader_sm1_read_semantic
(
const
DWORD
**
ptr
,
struct
wined3d_shader_semantic
*
semantic
)
{
DWORD
usage_token
=
*
(
*
ptr
)
++
;
DWORD
dst_token
=
*
(
*
ptr
)
++
;
semantic
->
usage
=
(
usage_token
&
WINED3DSP_DCL_USAGE_MASK
)
>>
WINED3DSP_DCL_USAGE_SHIFT
;
semantic
->
usage_idx
=
(
usage_token
&
WINED3DSP_DCL_USAGEINDEX_MASK
)
>>
WINED3DSP_DCL_USAGEINDEX_SHIFT
;
semantic
->
sampler_type
=
usage_token
&
WINED3DSP_TEXTURETYPE_MASK
;
shader_parse_dst_param
(
dst_token
,
NULL
,
&
semantic
->
reg
);
}
static
const
char
*
shader_opcode_names
[]
=
static
const
char
*
shader_opcode_names
[]
=
{
{
/* WINED3DSIH_ABS */
"abs"
,
/* WINED3DSIH_ABS */
"abs"
,
...
@@ -601,39 +612,36 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, struct shader_reg_m
...
@@ -601,39 +612,36 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, struct shader_reg_m
/* Handle declarations */
/* Handle declarations */
if
(
ins
.
handler_idx
==
WINED3DSIH_DCL
)
if
(
ins
.
handler_idx
==
WINED3DSIH_DCL
)
{
{
DWORD
usage
=
*
pToken
++
;
struct
wined3d_shader_semantic
semantic
;
DWORD
param
=
*
pToken
++
;
DWORD
regtype
=
shader_get_regtype
(
param
);
unsigned
int
regnum
=
param
&
WINED3DSP_REGNUM_MASK
;
/* Vshader: mark attributes used
shader_sm1_read_semantic
(
&
pToken
,
&
semantic
);
Pshader: mark 3.0 input registers used, save token */
if
(
WINED3DSPR_INPUT
==
regtype
)
{
if
(
!
pshader
)
switch
(
semantic
.
reg
.
register_type
)
reg_maps
->
attributes
[
regnum
]
=
1
;
{
else
/* Vshader: mark attributes used
reg_maps
->
packed_input
[
regnum
]
=
1
;
* Pshader: mark 3.0 input registers used, save token */
case
WINED3DSPR_INPUT
:
semantics_in
[
regnum
].
usage
=
(
usage
&
WINED3DSP_DCL_USAGE_MASK
)
>>
WINED3DSP_DCL_USAGE_SHIFT
;
if
(
!
pshader
)
reg_maps
->
attributes
[
semantic
.
reg
.
register_idx
]
=
1
;
semantics_in
[
regnum
].
usage_idx
=
else
reg_maps
->
packed_input
[
semantic
.
reg
.
register_idx
]
=
1
;
(
usage
&
WINED3DSP_DCL_USAGEINDEX_MASK
)
>>
WINED3DSP_DCL_USAGEINDEX_SHIFT
;
semantics_in
[
semantic
.
reg
.
register_idx
]
=
semantic
;
shader_parse_dst_param
(
param
,
NULL
,
&
semantics_in
[
regnum
].
reg
);
break
;
/* Vshader: mark 3.0 output registers used, save token */
/* Vshader: mark 3.0 output registers used, save token */
}
else
if
(
WINED3DSPR_OUTPUT
==
regtype
)
{
case
WINED3DSPR_OUTPUT
:
reg_maps
->
packed_output
[
regnum
]
=
1
;
reg_maps
->
packed_output
[
semantic
.
reg
.
register_idx
]
=
1
;
semantics_out
[
regnum
].
usage
=
(
usage
&
WINED3DSP_DCL_USAGE_MASK
)
>>
WINED3DSP_DCL_USAGE_SHIFT
;
semantics_out
[
semantic
.
reg
.
register_idx
]
=
semantic
;
semantics_out
[
regnum
].
usage_idx
=
if
(
semantic
.
usage
==
WINED3DDECLUSAGE_FOG
)
reg_maps
->
fog
=
1
;
(
usage
&
WINED3DSP_DCL_USAGEINDEX_MASK
)
>>
WINED3DSP_DCL_USAGEINDEX_SHIFT
;
break
;
shader_parse_dst_param
(
param
,
NULL
,
&
semantics_out
[
regnum
].
reg
);
/* Save sampler usage token */
if
(
usage
&
(
WINED3DDECLUSAGE_FOG
<<
WINED3DSP_DCL_USAGE_SHIFT
))
case
WINED3DSPR_SAMPLER
:
reg_maps
->
fog
=
1
;
reg_maps
->
sampler_type
[
semantic
.
reg
.
register_idx
]
=
semantic
.
sampler_type
;
break
;
/* Save sampler usage token */
}
else
if
(
WINED3DSPR_SAMPLER
==
regtype
)
default:
reg_maps
->
sampler_type
[
regnum
]
=
usage
&
WINED3DSP_TEXTURETYPE_MASK
;
TRACE
(
"Not recording DCL register type %#x.
\n
"
,
semantic
.
reg
.
register_type
);
break
;
}
}
}
else
if
(
ins
.
handler_idx
==
WINED3DSIH_DEF
)
else
if
(
ins
.
handler_idx
==
WINED3DSIH_DEF
)
{
{
...
...
dlls/wined3d/wined3d_private.h
View file @
65321dd1
...
@@ -482,6 +482,7 @@ struct wined3d_shader_semantic
...
@@ -482,6 +482,7 @@ struct wined3d_shader_semantic
{
{
WINED3DDECLUSAGE
usage
;
WINED3DDECLUSAGE
usage
;
UINT
usage_idx
;
UINT
usage_idx
;
WINED3DSAMPLER_TEXTURE_TYPE
sampler_type
;
struct
wined3d_shader_dst_param
reg
;
struct
wined3d_shader_dst_param
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