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
710b57a5
Commit
710b57a5
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: Parse local buffers.
parent
74ec9103
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
8 deletions
+56
-8
d3d10_private.h
dlls/d3d10/d3d10_private.h
+9
-1
effect.c
dlls/d3d10/effect.c
+47
-7
No files found.
dlls/d3d10/d3d10_private.h
View file @
710b57a5
...
...
@@ -58,6 +58,12 @@ struct d3d10_effect_shader_variable
}
shader
;
};
struct
d3d10_effect_local_buffer
{
DWORD
data_size
;
DWORD
variable_count
;
};
/* ID3D10EffectPass */
struct
d3d10_effect_pass
{
...
...
@@ -91,7 +97,7 @@ struct d3d10_effect
ID3D10Device
*
device
;
DWORD
version
;
DWORD
local
buffers
_count
;
DWORD
local
_buffer
_count
;
DWORD
localobjects_count
;
DWORD
sharedbuffers_count
;
DWORD
sharedobjects_count
;
...
...
@@ -101,6 +107,8 @@ struct d3d10_effect
DWORD
blendstate_count
;
DWORD
rasterizerstate_count
;
DWORD
samplerstate_count
;
struct
d3d10_effect_local_buffer
*
local_buffers
;
struct
d3d10_effect_technique
*
techniques
;
};
...
...
dlls/d3d10/effect.c
View file @
710b57a5
...
...
@@ -411,13 +411,44 @@ static HRESULT parse_fx10_technique(struct d3d10_effect_technique *t, const char
return
hr
;
}
static
HRESULT
parse_fx10_local_buffer
(
struct
d3d10_effect_local_buffer
*
l
,
const
char
**
ptr
)
{
unsigned
int
i
;
DWORD
offset
;
read_dword
(
ptr
,
&
offset
);
TRACE
(
"Local buffer name at offset %#x.
\n
"
,
offset
);
read_dword
(
ptr
,
&
l
->
data_size
);
TRACE
(
"Local buffer data size: %#x.
\n
"
,
l
->
data_size
);
skip_dword_unknown
(
ptr
,
1
);
read_dword
(
ptr
,
&
l
->
variable_count
);
TRACE
(
"Local buffer variable count: %#x.
\n
"
,
l
->
variable_count
);
skip_dword_unknown
(
ptr
,
2
);
for
(
i
=
0
;
i
<
l
->
variable_count
;
++
i
)
{
skip_dword_unknown
(
ptr
,
7
);
}
return
S_OK
;
}
static
HRESULT
parse_fx10_body
(
struct
d3d10_effect
*
e
,
const
char
*
data
,
DWORD
data_size
)
{
const
char
*
ptr
=
data
+
e
->
index_offset
;
HRESULT
hr
=
S_OK
;
unsigned
int
i
;
HRESULT
hr
;
skip_dword_unknown
(
&
ptr
,
6
);
e
->
local_buffers
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
e
->
local_buffer_count
*
sizeof
(
*
e
->
local_buffers
));
if
(
!
e
->
local_buffers
)
{
ERR
(
"Failed to allocate local buffer memory.
\n
"
);
return
E_OUTOFMEMORY
;
}
e
->
techniques
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
e
->
technique_count
*
sizeof
(
*
e
->
techniques
));
if
(
!
e
->
techniques
)
...
...
@@ -426,6 +457,14 @@ static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, DWORD d
return
E_OUTOFMEMORY
;
}
for
(
i
=
0
;
i
<
e
->
local_buffer_count
;
++
i
)
{
struct
d3d10_effect_local_buffer
*
l
=
&
e
->
local_buffers
[
i
];
hr
=
parse_fx10_local_buffer
(
l
,
&
ptr
);
if
(
FAILED
(
hr
))
return
hr
;
}
for
(
i
=
0
;
i
<
e
->
technique_count
;
++
i
)
{
struct
d3d10_effect_technique
*
t
=
&
e
->
techniques
[
i
];
...
...
@@ -434,13 +473,13 @@ static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, DWORD d
t
->
effect
=
e
;
hr
=
parse_fx10_technique_index
(
t
,
&
ptr
);
if
(
FAILED
(
hr
))
break
;
if
(
FAILED
(
hr
))
return
hr
;
hr
=
parse_fx10_technique
(
t
,
data
);
if
(
FAILED
(
hr
))
break
;
if
(
FAILED
(
hr
))
return
hr
;
}
return
hr
;
return
S_OK
;
}
static
HRESULT
parse_fx10
(
struct
d3d10_effect
*
e
,
const
char
*
data
,
DWORD
data_size
)
...
...
@@ -452,8 +491,8 @@ static HRESULT parse_fx10(struct d3d10_effect *e, const char *data, DWORD data_s
read_dword
(
&
ptr
,
&
e
->
version
);
TRACE
(
"Target: %#x
\n
"
,
e
->
version
);
read_dword
(
&
ptr
,
&
e
->
local
buffers
_count
);
TRACE
(
"Local
buffers count: %u
\n
"
,
e
->
localbuffers
_count
);
read_dword
(
&
ptr
,
&
e
->
local
_buffer
_count
);
TRACE
(
"Local
buffer count: %u.
\n
"
,
e
->
local_buffer
_count
);
/* Number of variables in local buffers? */
read_dword
(
&
ptr
,
&
unknown
);
...
...
@@ -660,6 +699,7 @@ static ULONG STDMETHODCALLTYPE d3d10_effect_Release(ID3D10Effect *iface)
}
HeapFree
(
GetProcessHeap
(),
0
,
This
->
techniques
);
}
HeapFree
(
GetProcessHeap
(),
0
,
This
->
local_buffers
);
ID3D10Device_Release
(
This
->
device
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
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