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
9882788a
Commit
9882788a
authored
Sep 08, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10: Implement ID3D10EffectType::GetDesc().
parent
559351ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
108 additions
and
24 deletions
+108
-24
d3d10_private.h
dlls/d3d10/d3d10_private.h
+11
-0
effect.c
dlls/d3d10/effect.c
+97
-24
No files found.
dlls/d3d10/d3d10_private.h
View file @
9882788a
...
...
@@ -70,6 +70,17 @@ struct d3d10_effect_type
DWORD
id
;
struct
wine_rb_entry
entry
;
char
*
name
;
DWORD
element_count
;
DWORD
size_unpacked
;
DWORD
stride
;
DWORD
size_packed
;
DWORD
member_count
;
DWORD
column_count
;
DWORD
row_count
;
D3D10_SHADER_VARIABLE_TYPE
basetype
;
D3D10_SHADER_VARIABLE_CLASS
type_class
;
};
/* ID3D10EffectVariable */
...
...
dlls/d3d10/effect.c
View file @
9882788a
...
...
@@ -424,52 +424,100 @@ static HRESULT parse_fx10_technique(struct d3d10_effect_technique *t, const char
return
S_OK
;
}
static
void
parse_fx10_type
(
const
char
*
ptr
,
const
char
*
data
)
static
D3D10_SHADER_VARIABLE_CLASS
d3d10_variable_class
(
DWORD
c
)
{
switch
(
c
)
{
case
1
:
return
D3D10_SVC_SCALAR
;
case
2
:
return
D3D10_SVC_VECTOR
;
case
3
:
return
D3D10_SVC_MATRIX_ROWS
;
default:
FIXME
(
"Unknown variable class %#x.
\n
"
,
c
);
return
0
;
}
}
static
D3D10_SHADER_VARIABLE_TYPE
d3d10_variable_type
(
DWORD
t
)
{
switch
(
t
)
{
case
1
:
return
D3D10_SVT_FLOAT
;
case
2
:
return
D3D10_SVT_INT
;
case
3
:
return
D3D10_SVT_UINT
;
case
4
:
return
D3D10_SVT_BOOL
;
default:
FIXME
(
"Unknown variable type %#x.
\n
"
,
t
);
return
0
;
}
}
static
HRESULT
parse_fx10_type
(
struct
d3d10_effect_type
*
t
,
const
char
*
ptr
,
const
char
*
data
)
{
DWORD
unknown0
;
DWORD
tmp
;
DWORD
offset
;
read_dword
(
&
ptr
,
&
tmp
);
TRACE
(
"Type name at offset %#x.
\n
"
,
tmp
);
TRACE
(
"Type name: %s.
\n
"
,
debugstr_a
(
data
+
tmp
));
read_dword
(
&
ptr
,
&
offset
);
TRACE
(
"Type name at offset %#x.
\n
"
,
offset
);
t
->
name
=
copy_name
(
data
+
offset
);
if
(
!
t
->
name
)
{
ERR
(
"Failed to copy name.
\n
"
);
return
E_OUTOFMEMORY
;
}
TRACE
(
"Type name: %s.
\n
"
,
debugstr_a
(
t
->
name
));
read_dword
(
&
ptr
,
&
unknown0
);
TRACE
(
"Unknown 0: %u.
\n
"
,
unknown0
);
read_dword
(
&
ptr
,
&
t
mp
);
TRACE
(
"Element count: %u.
\n
"
,
t
mp
);
read_dword
(
&
ptr
,
&
t
->
element_count
);
TRACE
(
"Element count: %u.
\n
"
,
t
->
element_count
);
read_dword
(
&
ptr
,
&
t
mp
);
TRACE
(
"Unpacked size: %#x.
\n
"
,
t
mp
);
read_dword
(
&
ptr
,
&
t
->
size_unpacked
);
TRACE
(
"Unpacked size: %#x.
\n
"
,
t
->
size_unpacked
);
read_dword
(
&
ptr
,
&
t
mp
);
TRACE
(
"Stride: %#x.
\n
"
,
t
mp
);
read_dword
(
&
ptr
,
&
t
->
stride
);
TRACE
(
"Stride: %#x.
\n
"
,
t
->
stride
);
read_dword
(
&
ptr
,
&
t
mp
);
TRACE
(
"Packed size %#x.
\n
"
,
t
mp
);
read_dword
(
&
ptr
,
&
t
->
size_packed
);
TRACE
(
"Packed size %#x.
\n
"
,
t
->
size_packed
);
if
(
unknown0
==
1
)
{
DWORD
tmp
;
t
->
member_count
=
0
;
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
);
t
->
type_class
=
d3d10_variable_class
((
tmp
&
D3D10_FX10_TYPE_CLASS_MASK
)
>>
D3D10_FX10_TYPE_CLASS_SHIFT
);
TRACE
(
"Type description: %#x.
\n
"
,
tmp
);
TRACE
(
"
\t
columns: %u.
\n
"
,
(
tmp
&
D3D10_FX10_TYPE_COLUMN_MASK
)
>>
D3D10_FX10_TYPE_COLUMN_SHIFT
);
TRACE
(
"
\t
rows: %u.
\n
"
,
(
tmp
&
D3D10_FX10_TYPE_ROW_MASK
)
>>
D3D10_FX10_TYPE_ROW_SHIFT
);
TRACE
(
"
\t
basetype: %#x.
\n
"
,
(
tmp
&
D3D10_FX10_TYPE_BASETYPE_MASK
)
>>
D3D10_FX10_TYPE_BASETYPE_SHIFT
);
TRACE
(
"
\t
class: %#x.
\n
"
,
(
tmp
&
D3D10_FX10_TYPE_CLASS_MASK
)
>>
D3D10_FX10_TYPE_CLASS_SHIFT
);
TRACE
(
"
\t
columns: %u.
\n
"
,
t
->
column_count
);
TRACE
(
"
\t
rows: %u.
\n
"
,
t
->
row_count
);
TRACE
(
"
\t
basetype: %#x.
\n
"
,
t
->
basetype
);
TRACE
(
"
\t
class: %#x.
\n
"
,
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
));
}
else
if
(
unknown0
==
3
)
{
DWORD
member_count
;
unsigned
int
i
;
DWORD
tmp
;
TRACE
(
"Type is a structure.
\n
"
);
read_dword
(
&
ptr
,
&
member_count
);
TRACE
(
"Member count: %u.
\n
"
,
member_count
);
read_dword
(
&
ptr
,
&
t
->
member_count
);
TRACE
(
"Member count: %u.
\n
"
,
t
->
member_count
);
for
(
i
=
0
;
i
<
member_count
;
++
i
)
t
->
column_count
=
0
;
t
->
row_count
=
0
;
t
->
basetype
=
0
;
t
->
type_class
=
D3D10_SVC_STRUCT
;
for
(
i
=
0
;
i
<
t
->
member_count
;
++
i
)
{
read_dword
(
&
ptr
,
&
tmp
);
TRACE
(
"Member %u name at offset %#x.
\n
"
,
i
,
tmp
);
...
...
@@ -485,12 +533,15 @@ static void parse_fx10_type(const char *ptr, const char *data)
TRACE
(
"Member %u type info at offset %#x.
\n
"
,
i
,
tmp
);
}
}
return
S_OK
;
}
static
struct
d3d10_effect_type
*
get_fx10_type
(
struct
d3d10_effect
*
effect
,
const
char
*
data
,
DWORD
offset
)
{
struct
d3d10_effect_type
*
type
;
struct
wine_rb_entry
*
entry
;
HRESULT
hr
;
entry
=
wine_rb_get
(
&
effect
->
types
,
&
offset
);
if
(
entry
)
...
...
@@ -508,7 +559,13 @@ static struct d3d10_effect_type *get_fx10_type(struct d3d10_effect *effect, cons
type
->
vtbl
=
&
d3d10_effect_type_vtbl
;
type
->
id
=
offset
;
parse_fx10_type
(
data
+
offset
,
data
);
hr
=
parse_fx10_type
(
type
,
data
+
offset
,
data
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to parse type info, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
type
);
return
NULL
;
}
if
(
wine_rb_put
(
&
effect
->
types
,
&
offset
,
&
type
->
entry
)
==
-
1
)
{
...
...
@@ -632,6 +689,7 @@ static void d3d10_effect_type_destroy(struct wine_rb_entry *entry, void *context
TRACE
(
"effect type %p.
\n
"
,
t
);
HeapFree
(
GetProcessHeap
(),
0
,
t
->
name
);
HeapFree
(
GetProcessHeap
(),
0
,
t
);
}
...
...
@@ -1906,9 +1964,24 @@ static BOOL STDMETHODCALLTYPE d3d10_effect_type_IsValid(ID3D10EffectType *iface)
static
HRESULT
STDMETHODCALLTYPE
d3d10_effect_type_GetDesc
(
ID3D10EffectType
*
iface
,
D3D10_EFFECT_TYPE_DESC
*
desc
)
{
FIXME
(
"iface %p, desc %p stub!
\n
"
,
iface
,
desc
)
;
struct
d3d10_effect_type
*
This
=
(
struct
d3d10_effect_type
*
)
iface
;
return
E_NOTIMPL
;
TRACE
(
"iface %p, desc %p
\n
"
,
iface
,
desc
);
if
(
!
desc
)
return
E_INVALIDARG
;
desc
->
TypeName
=
This
->
name
;
desc
->
Class
=
This
->
type_class
;
desc
->
Type
=
This
->
basetype
;
desc
->
Elements
=
This
->
element_count
;
desc
->
Members
=
This
->
member_count
;
desc
->
Rows
=
This
->
row_count
;
desc
->
Columns
=
This
->
column_count
;
desc
->
PackedSize
=
This
->
size_packed
;
desc
->
UnpackedSize
=
This
->
size_unpacked
;
desc
->
Stride
=
This
->
stride
;
return
S_OK
;
}
static
struct
ID3D10EffectType
*
STDMETHODCALLTYPE
d3d10_effect_type_GetMemberTypeByIndex
(
ID3D10EffectType
*
iface
,
...
...
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