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
7e1ad91e
Commit
7e1ad91e
authored
Oct 25, 2009
by
Rico Schüller
Committed by
Alexandre Julliard
Oct 26, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10: Improve parse_fx10_type().
parent
22d8fc08
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
60 deletions
+80
-60
effect.c
dlls/d3d10/effect.c
+80
-60
No files found.
dlls/d3d10/effect.c
View file @
7e1ad91e
...
...
@@ -352,6 +352,8 @@ static HRESULT parse_fx10_type(struct d3d10_effect_type *t, const char *ptr, con
{
DWORD
unknown0
;
DWORD
offset
;
DWORD
typeinfo
;
unsigned
int
i
;
read_dword
(
&
ptr
,
&
offset
);
TRACE
(
"Type name at offset %#x.
\n
"
,
offset
);
...
...
@@ -378,84 +380,102 @@ static HRESULT parse_fx10_type(struct d3d10_effect_type *t, const char *ptr, con
read_dword
(
&
ptr
,
&
t
->
size_packed
);
TRACE
(
"Packed size %#x.
\n
"
,
t
->
size_packed
);
if
(
unknown0
==
1
)
switch
(
unknown0
)
{
DWORD
tmp
;
case
1
:
t
->
member_count
=
0
;
t
->
member_count
=
0
;
read_dword
(
&
ptr
,
&
typeinfo
);
t
->
column_count
=
(
typeinfo
&
D3D10_FX10_TYPE_COLUMN_MASK
)
>>
D3D10_FX10_TYPE_COLUMN_SHIFT
;
t
->
row_count
=
(
typeinfo
&
D3D10_FX10_TYPE_ROW_MASK
)
>>
D3D10_FX10_TYPE_ROW_SHIFT
;
t
->
basetype
=
d3d10_variable_type
((
typeinfo
&
D3D10_FX10_TYPE_BASETYPE_MASK
)
>>
D3D10_FX10_TYPE_BASETYPE_SHIFT
,
FALSE
);
t
->
type_class
=
d3d10_variable_class
((
typeinfo
&
D3D10_FX10_TYPE_CLASS_MASK
)
>>
D3D10_FX10_TYPE_CLASS_SHIFT
,
typeinfo
&
D3D10_FX10_TYPE_MATRIX_COLUMN_MAJOR_MASK
);
read_dword
(
&
ptr
,
&
tmp
);
t
->
column_count
=
(
tmp
&
D3D10_FX10_TYPE_COLUMN_MASK
)
>>
D3D10_FX10_TYPE_COLUMN_SHIFT
;
t
->
row_count
=
(
tmp
&
D3D10_FX10_TYPE_ROW_MASK
)
>>
D3D10_FX10_TYPE_ROW_SHIFT
;
t
->
basetype
=
d3d10_variable_type
((
tmp
&
D3D10_FX10_TYPE_BASETYPE_MASK
)
>>
D3D10_FX10_TYPE_BASETYPE_SHIFT
,
FALSE
);
t
->
type_class
=
d3d10_variable_class
((
tmp
&
D3D10_FX10_TYPE_CLASS_MASK
)
>>
D3D10_FX10_TYPE_CLASS_SHIFT
,
tmp
&
D3D10_FX10_TYPE_MATRIX_COLUMN_MAJOR_MASK
);
TRACE
(
"Type description: %#x.
\n
"
,
typeinfo
);
TRACE
(
"
\t
columns: %u.
\n
"
,
t
->
column_count
);
TRACE
(
"
\t
rows: %u.
\n
"
,
t
->
row_count
);
TRACE
(
"
\t
basetype: %s.
\n
"
,
debug_d3d10_shader_variable_type
(
t
->
basetype
));
TRACE
(
"
\t
class: %s.
\n
"
,
debug_d3d10_shader_variable_class
(
t
->
type_class
));
TRACE
(
"
\t
unknown bits: %#x.
\n
"
,
typeinfo
&
~
(
D3D10_FX10_TYPE_COLUMN_MASK
|
D3D10_FX10_TYPE_ROW_MASK
|
D3D10_FX10_TYPE_BASETYPE_MASK
|
D3D10_FX10_TYPE_CLASS_MASK
|
D3D10_FX10_TYPE_MATRIX_COLUMN_MAJOR_MASK
));
break
;
TRACE
(
"Type description: %#x.
\n
"
,
tmp
);
TRACE
(
"
\t
columns: %u.
\n
"
,
t
->
column_count
);
TRACE
(
"
\t
rows: %u.
\n
"
,
t
->
row_count
);
TRACE
(
"
\t
basetype: %s.
\n
"
,
debug_d3d10_shader_variable_type
(
t
->
basetype
));
TRACE
(
"
\t
class: %s.
\n
"
,
debug_d3d10_shader_variable_class
(
t
->
type_class
));
TRACE
(
"
\t
unknown bits: %#x.
\n
"
,
tmp
&
~
(
D3D10_FX10_TYPE_COLUMN_MASK
|
D3D10_FX10_TYPE_ROW_MASK
|
D3D10_FX10_TYPE_BASETYPE_MASK
|
D3D10_FX10_TYPE_CLASS_MASK
|
D3D10_FX10_TYPE_MATRIX_COLUMN_MAJOR_MASK
));
}
else
if
(
unknown0
==
3
)
{
unsigned
int
i
;
case
2
:
TRACE
(
"Type is an object.
\n
"
);
TRACE
(
"Type is a structure.
\n
"
);
t
->
member_count
=
0
;
t
->
column_count
=
0
;
t
->
row_count
=
0
;
t
->
type_class
=
D3D10_SVC_OBJECT
;
read_dword
(
&
ptr
,
&
t
->
member_count
);
TRACE
(
"Member count: %u.
\n
"
,
t
->
member_count
);
read_dword
(
&
ptr
,
&
typeinfo
);
t
->
basetype
=
d3d10_variable_type
(
typeinfo
,
TRUE
);
t
->
column_count
=
0
;
t
->
row_count
=
0
;
t
->
basetype
=
0
;
t
->
type_class
=
D3D10_SVC_STRUCT
;
TRACE
(
"Type description: %#x.
\n
"
,
typeinfo
)
;
TRACE
(
"
\t
basetype: %s.
\n
"
,
debug_d3d10_shader_variable_type
(
t
->
basetype
))
;
TRACE
(
"
\t
class: %s.
\n
"
,
debug_d3d10_shader_variable_class
(
t
->
type_class
))
;
break
;
t
->
members
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
t
->
member_count
*
sizeof
(
*
t
->
members
));
if
(
!
t
->
members
)
{
ERR
(
"Failed to allocate members memory.
\n
"
);
return
E_OUTOFMEMORY
;
}
case
3
:
TRACE
(
"Type is a structure.
\n
"
);
for
(
i
=
0
;
i
<
t
->
member_count
;
++
i
)
{
struct
d3d10_effect_type_member
*
typem
=
&
t
->
members
[
i
];
read_dword
(
&
ptr
,
&
t
->
member_count
);
TRACE
(
"Member count: %u.
\n
"
,
t
->
member_count
);
read_dword
(
&
ptr
,
&
offset
);
TRACE
(
"Member name at offset %#x.
\n
"
,
offset
);
t
->
column_count
=
0
;
t
->
row_count
=
0
;
t
->
basetype
=
0
;
t
->
type_class
=
D3D10_SVC_STRUCT
;
if
(
!
copy_name
(
data
+
offset
,
&
typem
->
name
))
t
->
members
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
t
->
member_count
*
sizeof
(
*
t
->
members
));
if
(
!
t
->
members
)
{
ERR
(
"Failed to
copy name
.
\n
"
);
ERR
(
"Failed to
allocate members memory
.
\n
"
);
return
E_OUTOFMEMORY
;
}
TRACE
(
"Member name: %s.
\n
"
,
debugstr_a
(
typem
->
name
));
read_dword
(
&
ptr
,
&
offset
);
TRACE
(
"Member semantic at offset %#x.
\n
"
,
offset
);
if
(
!
copy_name
(
data
+
offset
,
&
typem
->
semantic
)
)
for
(
i
=
0
;
i
<
t
->
member_count
;
++
i
)
{
ERR
(
"Failed to copy semantic.
\n
"
);
return
E_OUTOFMEMORY
;
struct
d3d10_effect_type_member
*
typem
=
&
t
->
members
[
i
];
read_dword
(
&
ptr
,
&
offset
);
TRACE
(
"Member name at offset %#x.
\n
"
,
offset
);
if
(
!
copy_name
(
data
+
offset
,
&
typem
->
name
))
{
ERR
(
"Failed to copy name.
\n
"
);
return
E_OUTOFMEMORY
;
}
TRACE
(
"Member name: %s.
\n
"
,
debugstr_a
(
typem
->
name
));
read_dword
(
&
ptr
,
&
offset
);
TRACE
(
"Member semantic at offset %#x.
\n
"
,
offset
);
if
(
!
copy_name
(
data
+
offset
,
&
typem
->
semantic
))
{
ERR
(
"Failed to copy semantic.
\n
"
);
return
E_OUTOFMEMORY
;
}
TRACE
(
"Member semantic: %s.
\n
"
,
debugstr_a
(
typem
->
semantic
));
read_dword
(
&
ptr
,
&
typem
->
buffer_offset
);
TRACE
(
"Member offset in struct: %#x.
\n
"
,
typem
->
buffer_offset
);
read_dword
(
&
ptr
,
&
offset
);
TRACE
(
"Member type info at offset %#x.
\n
"
,
offset
);
typem
->
type
=
get_fx10_type
(
t
->
effect
,
data
,
offset
);
if
(
!
typem
->
type
)
{
ERR
(
"Failed to get variable type.
\n
"
);
return
E_FAIL
;
}
}
TRACE
(
"Member semantic: %s.
\n
"
,
debugstr_a
(
typem
->
semantic
));
read_dword
(
&
ptr
,
&
typem
->
buffer_offset
);
TRACE
(
"Member offset in struct: %#x.
\n
"
,
typem
->
buffer_offset
);
read_dword
(
&
ptr
,
&
offset
);
TRACE
(
"Member type info at offset %#x.
\n
"
,
offset
);
break
;
typem
->
type
=
get_fx10_type
(
t
->
effect
,
data
,
offset
);
if
(
!
typem
->
type
)
{
ERR
(
"Failed to get variable type.
\n
"
);
return
E_FAIL
;
}
}
default:
FIXME
(
"Unhandled case %#x.
\n
"
,
unknown0
);
return
E_FAIL
;
}
if
(
t
->
element_count
)
...
...
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