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
918abfef
Commit
918abfef
authored
Jul 22, 2013
by
Rico Schüller
Committed by
Alexandre Julliard
Jul 22, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Merge get/is_valid_constant().
parent
e6e09eb4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
31 deletions
+16
-31
shader.c
dlls/d3dx9_36/shader.c
+16
-31
No files found.
dlls/d3dx9_36/shader.c
View file @
918abfef
...
...
@@ -610,11 +610,6 @@ static inline BOOL is_vertex_shader(DWORD version)
return
(
version
&
0xffff0000
)
==
0xfffe0000
;
}
static
inline
struct
ctab_constant
*
constant_from_handle
(
D3DXHANDLE
handle
)
{
return
(
struct
ctab_constant
*
)
handle
;
}
static
inline
D3DXHANDLE
handle_from_constant
(
struct
ctab_constant
*
constant
)
{
return
(
D3DXHANDLE
)
constant
;
...
...
@@ -708,54 +703,44 @@ static struct ctab_constant *get_constant_by_name(struct ID3DXConstantTableImpl
return
NULL
;
}
static
struct
ctab_constant
*
is_valid_sub_constant
(
struct
ctab_constant
*
parent
,
struct
ctab_constant
*
constant
)
static
struct
ctab_constant
*
is_valid_sub_constant
(
struct
ctab_constant
*
parent
,
D3DXHANDLE
handle
)
{
struct
ctab_constant
*
c
;
UINT
i
,
count
;
/* all variable have at least elements = 1, but no elements */
/* all variable have at least elements = 1, but no
t always
elements */
if
(
!
parent
->
constants
)
return
NULL
;
if
(
parent
->
desc
.
Elements
>
1
)
count
=
parent
->
desc
.
Elements
;
else
count
=
parent
->
desc
.
StructMembers
;
count
=
parent
->
desc
.
Elements
>
1
?
parent
->
desc
.
Elements
:
parent
->
desc
.
StructMembers
;
for
(
i
=
0
;
i
<
count
;
++
i
)
{
if
(
&
parent
->
constants
[
i
]
==
constant
)
return
constant
;
if
(
handle_from_constant
(
&
parent
->
constants
[
i
])
==
handle
)
return
&
parent
->
constants
[
i
]
;
if
(
is_valid_sub_constant
(
&
parent
->
constants
[
i
],
constant
))
return
constant
;
c
=
is_valid_sub_constant
(
&
parent
->
constants
[
i
],
handle
);
if
(
c
)
return
c
;
}
return
NULL
;
}
static
inline
struct
ctab_constant
*
is
_valid_constant
(
struct
ID3DXConstantTableImpl
*
table
,
D3DXHANDLE
handle
)
static
inline
struct
ctab_constant
*
get
_valid_constant
(
struct
ID3DXConstantTableImpl
*
table
,
D3DXHANDLE
handle
)
{
struct
ctab_constant
*
c
=
constant_from_handle
(
handle
)
;
struct
ctab_constant
*
c
;
UINT
i
;
if
(
!
c
)
return
NULL
;
if
(
!
handle
)
return
NULL
;
for
(
i
=
0
;
i
<
table
->
desc
.
Constants
;
++
i
)
{
if
(
&
table
->
constants
[
i
]
==
c
)
return
c
;
if
(
handle_from_constant
(
&
table
->
constants
[
i
])
==
handle
)
return
&
table
->
constants
[
i
]
;
if
(
is_valid_sub_constant
(
&
table
->
constants
[
i
],
c
))
return
c
;
c
=
is_valid_sub_constant
(
&
table
->
constants
[
i
],
handle
);
if
(
c
)
return
c
;
}
return
NULL
;
}
static
inline
struct
ctab_constant
*
get_valid_constant
(
struct
ID3DXConstantTableImpl
*
table
,
D3DXHANDLE
handle
)
{
struct
ctab_constant
*
constant
=
is_valid_constant
(
table
,
handle
);
if
(
!
constant
)
constant
=
get_constant_by_name
(
table
,
NULL
,
handle
);
return
constant
;
return
get_constant_by_name
(
table
,
NULL
,
handle
);
}
static
inline
void
set_float_shader_constant
(
struct
ID3DXConstantTableImpl
*
table
,
IDirect3DDevice9
*
device
,
...
...
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