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
12788436
Commit
12788436
authored
Aug 23, 2012
by
Rico Schüller
Committed by
Alexandre Julliard
Aug 24, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Improve is_valid_constant().
parent
b565e8fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
shader.c
dlls/d3dx9_36/shader.c
+27
-1
No files found.
dlls/d3dx9_36/shader.c
View file @
12788436
...
@@ -690,6 +690,28 @@ static inline D3DXHANDLE handle_from_constant(struct ctab_constant *constant)
...
@@ -690,6 +690,28 @@ static inline D3DXHANDLE handle_from_constant(struct ctab_constant *constant)
return
(
D3DXHANDLE
)
constant
;
return
(
D3DXHANDLE
)
constant
;
}
}
static
struct
ctab_constant
*
is_valid_sub_constant
(
struct
ctab_constant
*
parent
,
struct
ctab_constant
*
constant
)
{
UINT
i
,
count
;
/* all variable have at least elements = 1, but no elements */
if
(
!
parent
->
constants
)
return
NULL
;
if
(
parent
->
desc
.
Elements
>
1
)
count
=
parent
->
desc
.
Elements
;
else
count
=
parent
->
desc
.
StructMembers
;
for
(
i
=
0
;
i
<
count
;
++
i
)
{
if
(
&
parent
->
constants
[
i
]
==
constant
)
return
constant
;
if
(
is_valid_sub_constant
(
&
parent
->
constants
[
i
],
constant
))
return
constant
;
}
return
NULL
;
}
static
inline
struct
ctab_constant
*
is_valid_constant
(
struct
ID3DXConstantTableImpl
*
table
,
D3DXHANDLE
handle
)
static
inline
struct
ctab_constant
*
is_valid_constant
(
struct
ID3DXConstantTableImpl
*
table
,
D3DXHANDLE
handle
)
{
{
struct
ctab_constant
*
c
=
constant_from_handle
(
handle
);
struct
ctab_constant
*
c
=
constant_from_handle
(
handle
);
...
@@ -699,7 +721,11 @@ static inline struct ctab_constant *is_valid_constant(struct ID3DXConstantTableI
...
@@ -699,7 +721,11 @@ static inline struct ctab_constant *is_valid_constant(struct ID3DXConstantTableI
for
(
i
=
0
;
i
<
table
->
desc
.
Constants
;
++
i
)
for
(
i
=
0
;
i
<
table
->
desc
.
Constants
;
++
i
)
{
{
if
(
&
table
->
constants
[
i
]
==
c
)
return
c
;
if
(
&
table
->
constants
[
i
]
==
c
)
return
c
;
if
(
is_valid_sub_constant
(
&
table
->
constants
[
i
],
c
))
return
c
;
}
}
return
NULL
;
return
NULL
;
...
...
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