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
b4da7ebd
Commit
b4da7ebd
authored
Jul 14, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 14, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10: Marge parse_fx10_pass() and parse_fx10_pass_index().
parent
c481e0a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
53 deletions
+32
-53
effect.c
dlls/d3d10/effect.c
+32
-53
No files found.
dlls/d3d10/effect.c
View file @
b4da7ebd
...
...
@@ -124,43 +124,6 @@ static HRESULT parse_dxbc(const char *data, SIZE_T data_size,
return
hr
;
}
static
HRESULT
parse_fx10_pass_index
(
struct
d3d10_effect_pass
*
p
,
const
char
**
ptr
)
{
unsigned
int
i
;
read_dword
(
ptr
,
&
p
->
start
);
TRACE
(
"Pass starts at offset %#x
\n
"
,
p
->
start
);
read_dword
(
ptr
,
&
p
->
variable_count
);
TRACE
(
"Pass has %u variables
\n
"
,
p
->
variable_count
);
skip_dword_unknown
(
ptr
,
1
);
p
->
variables
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
p
->
variable_count
*
sizeof
(
*
p
->
variables
));
if
(
!
p
->
variables
)
{
ERR
(
"Failed to allocate variables memory
\n
"
);
return
E_OUTOFMEMORY
;
}
for
(
i
=
0
;
i
<
p
->
variable_count
;
++
i
)
{
struct
d3d10_effect_variable
*
v
=
&
p
->
variables
[
i
];
v
->
pass
=
p
;
read_dword
(
ptr
,
&
v
->
type
);
TRACE
(
"Variable %u is of type %#x
\n
"
,
i
,
v
->
type
);
skip_dword_unknown
(
ptr
,
2
);
read_dword
(
ptr
,
&
v
->
idx_offset
);
TRACE
(
"Variable %u idx is at offset %#x
\n
"
,
i
,
v
->
idx_offset
);
}
return
S_OK
;
}
static
char
*
copy_name
(
const
char
*
ptr
)
{
size_t
name_len
;
...
...
@@ -333,32 +296,51 @@ static HRESULT parse_fx10_variable(struct d3d10_effect_variable *v, const char *
return
hr
;
}
static
HRESULT
parse_fx10_pass
(
struct
d3d10_effect_pass
*
p
,
const
char
*
data
)
static
HRESULT
parse_fx10_pass
(
struct
d3d10_effect_pass
*
p
,
const
char
*
*
ptr
,
const
char
*
data
)
{
HRESULT
hr
=
S_OK
;
const
char
*
ptr
;
size_t
name_len
;
unsigned
int
i
;
DWORD
offset
;
ptr
=
data
+
p
->
start
;
read_dword
(
ptr
,
&
offset
);
TRACE
(
"Pass name at offset %#x.
\n
"
,
offset
);
name_len
=
strlen
(
ptr
)
+
1
;
p
->
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
name_len
);
p
->
name
=
copy_name
(
data
+
offset
);
if
(
!
p
->
name
)
{
ERR
(
"Failed to
allocate name memory
\n
"
);
ERR
(
"Failed to
copy name.
\n
"
);
return
E_OUTOFMEMORY
;
}
TRACE
(
"Pass name: %s.
\n
"
,
p
->
name
);
memcpy
(
p
->
name
,
ptr
,
name_len
);
ptr
+=
name_len
;
read_dword
(
ptr
,
&
p
->
variable_count
);
TRACE
(
"Pass has %u variables.
\n
"
,
p
->
variable_count
)
;
TRACE
(
"pass name: %s
\n
"
,
p
->
name
);
skip_dword_unknown
(
ptr
,
1
);
p
->
variables
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
p
->
variable_count
*
sizeof
(
*
p
->
variables
));
if
(
!
p
->
variables
)
{
ERR
(
"Failed to allocate variables memory.
\n
"
);
return
E_OUTOFMEMORY
;
}
for
(
i
=
0
;
i
<
p
->
variable_count
;
++
i
)
{
hr
=
parse_fx10_variable
(
&
p
->
variables
[
i
],
data
);
if
(
FAILED
(
hr
))
break
;
struct
d3d10_effect_variable
*
v
=
&
p
->
variables
[
i
];
v
->
pass
=
p
;
read_dword
(
ptr
,
&
v
->
type
);
TRACE
(
"Variable %u is of type %#x.
\n
"
,
i
,
v
->
type
);
skip_dword_unknown
(
ptr
,
2
);
read_dword
(
ptr
,
&
v
->
idx_offset
);
TRACE
(
"Variable %u idx is at offset %#x.
\n
"
,
i
,
v
->
idx_offset
);
hr
=
parse_fx10_variable
(
v
,
data
);
if
(
FAILED
(
hr
))
return
hr
;
}
return
hr
;
...
...
@@ -400,10 +382,7 @@ static HRESULT parse_fx10_technique(struct d3d10_effect_technique *t, const char
p
->
vtbl
=
&
d3d10_effect_pass_vtbl
;
p
->
technique
=
t
;
hr
=
parse_fx10_pass_index
(
p
,
ptr
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
parse_fx10_pass
(
p
,
data
);
hr
=
parse_fx10_pass
(
p
,
ptr
,
data
);
if
(
FAILED
(
hr
))
return
hr
;
}
...
...
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