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
10a4516e
Commit
10a4516e
authored
Sep 30, 2009
by
Rico Schüller
Committed by
Alexandre Julliard
Sep 30, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10: Parse constant buffer type.
parent
390cc62e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
8 deletions
+60
-8
d3d10_private.h
dlls/d3d10/d3d10_private.h
+1
-1
effect.c
dlls/d3d10/effect.c
+59
-7
No files found.
dlls/d3d10/d3d10_private.h
View file @
10a4516e
...
...
@@ -109,8 +109,8 @@ struct d3d10_effect_local_buffer
struct
d3d10_effect
*
effect
;
char
*
name
;
DWORD
data_size
;
DWORD
member_count
;
DWORD
annotation_count
;
struct
d3d10_effect_type
*
type
;
struct
d3d10_effect_variable
*
members
;
struct
d3d10_effect_variable
*
annotations
;
};
...
...
dlls/d3d10/effect.c
View file @
10a4516e
...
...
@@ -717,8 +717,18 @@ static HRESULT parse_fx10_local_buffer(struct d3d10_effect_local_buffer *l, cons
{
unsigned
int
i
;
DWORD
offset
;
D3D10_CBUFFER_TYPE
d3d10_cbuffer_type
;
HRESULT
hr
;
l
->
type
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
l
->
type
));
if
(
!
l
->
type
)
{
ERR
(
"Failed to allocate local buffer type memory.
\n
"
);
return
E_OUTOFMEMORY
;
}
l
->
type
->
vtbl
=
&
d3d10_effect_type_vtbl
;
l
->
type
->
type_class
=
D3D10_SVC_OBJECT
;
read_dword
(
ptr
,
&
offset
);
TRACE
(
"Local buffer name at offset %#x.
\n
"
,
offset
);
...
...
@@ -732,10 +742,36 @@ static HRESULT parse_fx10_local_buffer(struct d3d10_effect_local_buffer *l, cons
read_dword
(
ptr
,
&
l
->
data_size
);
TRACE
(
"Local buffer data size: %#x.
\n
"
,
l
->
data_size
);
skip_dword_unknown
(
ptr
,
1
);
read_dword
(
ptr
,
&
d3d10_cbuffer_type
);
TRACE
(
"Local buffer type: %#x.
\n
"
,
d3d10_cbuffer_type
);
switch
(
d3d10_cbuffer_type
)
{
case
D3D10_CT_CBUFFER
:
l
->
type
->
basetype
=
D3D10_SVT_CBUFFER
;
if
(
!
copy_name
(
"cbuffer"
,
&
l
->
type
->
name
))
{
ERR
(
"Failed to copy name.
\n
"
);
return
E_OUTOFMEMORY
;
}
break
;
read_dword
(
ptr
,
&
l
->
member_count
);
TRACE
(
"Local buffer member count: %#x.
\n
"
,
l
->
member_count
);
case
D3D10_CT_TBUFFER
:
l
->
type
->
basetype
=
D3D10_SVT_TBUFFER
;
if
(
!
copy_name
(
"tbuffer"
,
&
l
->
type
->
name
))
{
ERR
(
"Failed to copy name.
\n
"
);
return
E_OUTOFMEMORY
;
}
break
;
default:
ERR
(
"Unexpected D3D10_CBUFFER_TYPE %#x!
\n
"
,
d3d10_cbuffer_type
);
return
E_FAIL
;
}
read_dword
(
ptr
,
&
l
->
type
->
member_count
);
TRACE
(
"Local buffer member count: %#x.
\n
"
,
l
->
type
->
member_count
);
skip_dword_unknown
(
ptr
,
1
);
...
...
@@ -759,14 +795,14 @@ static HRESULT parse_fx10_local_buffer(struct d3d10_effect_local_buffer *l, cons
if
(
FAILED
(
hr
))
return
hr
;
}
l
->
members
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
l
->
member_count
*
sizeof
(
*
l
->
members
));
l
->
members
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
l
->
type
->
member_count
*
sizeof
(
*
l
->
members
));
if
(
!
l
->
members
)
{
ERR
(
"Failed to allocate members memory.
\n
"
);
return
E_OUTOFMEMORY
;
}
for
(
i
=
0
;
i
<
l
->
member_count
;
++
i
)
for
(
i
=
0
;
i
<
l
->
type
->
member_count
;
++
i
)
{
struct
d3d10_effect_variable
*
v
=
&
l
->
members
[
i
];
...
...
@@ -775,7 +811,21 @@ static HRESULT parse_fx10_local_buffer(struct d3d10_effect_local_buffer *l, cons
hr
=
parse_fx10_variable
(
v
,
ptr
,
data
);
if
(
FAILED
(
hr
))
return
hr
;
l
->
type
->
size_packed
+=
v
->
type
->
size_packed
;
l
->
type
->
size_unpacked
+=
v
->
type
->
size_unpacked
;
}
l
->
type
->
stride
=
l
->
type
->
size_unpacked
=
(
l
->
type
->
size_unpacked
+
0xf
)
&
~
0xf
;
TRACE
(
"Constant buffer:
\n
"
);
TRACE
(
"
\t
Type name: %s.
\n
"
,
debugstr_a
(
l
->
type
->
name
));
TRACE
(
"
\t
Element count: %u.
\n
"
,
l
->
type
->
element_count
);
TRACE
(
"
\t
Member count: %u.
\n
"
,
l
->
type
->
member_count
);
TRACE
(
"
\t
Unpacked size: %#x.
\n
"
,
l
->
type
->
size_unpacked
);
TRACE
(
"
\t
Stride: %#x.
\n
"
,
l
->
type
->
stride
);
TRACE
(
"
\t
Packed size %#x.
\n
"
,
l
->
type
->
size_packed
);
TRACE
(
"
\t
Basetype: %s.
\n
"
,
debug_d3d10_shader_variable_type
(
l
->
type
->
basetype
));
TRACE
(
"
\t
Typeclass: %s.
\n
"
,
debug_d3d10_shader_variable_class
(
l
->
type
->
type_class
));
return
S_OK
;
}
...
...
@@ -1070,12 +1120,14 @@ static void d3d10_effect_local_buffer_destroy(struct d3d10_effect_local_buffer *
HeapFree
(
GetProcessHeap
(),
0
,
l
->
name
);
if
(
l
->
members
)
{
for
(
i
=
0
;
i
<
l
->
member_count
;
++
i
)
for
(
i
=
0
;
i
<
l
->
type
->
member_count
;
++
i
)
{
d3d10_effect_variable_destroy
(
&
l
->
members
[
i
]);
}
HeapFree
(
GetProcessHeap
(),
0
,
l
->
members
);
}
HeapFree
(
GetProcessHeap
(),
0
,
l
->
type
->
name
);
HeapFree
(
GetProcessHeap
(),
0
,
l
->
type
);
if
(
l
->
annotations
)
{
...
...
@@ -1254,7 +1306,7 @@ static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableB
struct
d3d10_effect_local_buffer
*
l
=
&
This
->
local_buffers
[
i
];
unsigned
int
j
;
for
(
j
=
0
;
j
<
l
->
member_count
;
++
j
)
for
(
j
=
0
;
j
<
l
->
type
->
member_count
;
++
j
)
{
struct
d3d10_effect_variable
*
v
=
&
l
->
members
[
j
];
...
...
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