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
34ab5431
Commit
34ab5431
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 buffer names.
parent
710b57a5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
3 deletions
+47
-3
d3d10_private.h
dlls/d3d10/d3d10_private.h
+1
-0
effect.c
dlls/d3d10/effect.c
+46
-3
No files found.
dlls/d3d10/d3d10_private.h
View file @
34ab5431
...
...
@@ -60,6 +60,7 @@ struct d3d10_effect_shader_variable
struct
d3d10_effect_local_buffer
{
char
*
name
;
DWORD
data_size
;
DWORD
variable_count
;
};
...
...
dlls/d3d10/effect.c
View file @
34ab5431
...
...
@@ -195,6 +195,24 @@ static HRESULT parse_fx10_technique_index(struct d3d10_effect_technique *t, cons
return
hr
;
}
static
char
*
copy_name
(
const
char
*
ptr
)
{
size_t
name_len
;
char
*
name
;
name_len
=
strlen
(
ptr
)
+
1
;
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
name_len
);
if
(
!
name
)
{
ERR
(
"Failed to allocate name memory.
\n
"
);
return
NULL
;
}
memcpy
(
name
,
ptr
,
name_len
);
return
name
;
}
static
HRESULT
shader_chunk_handler
(
const
char
*
data
,
DWORD
data_size
,
DWORD
tag
,
void
*
ctx
)
{
struct
d3d10_effect_shader_variable
*
s
=
ctx
;
...
...
@@ -411,7 +429,7 @@ 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
)
static
HRESULT
parse_fx10_local_buffer
(
struct
d3d10_effect_local_buffer
*
l
,
const
char
**
ptr
,
const
char
*
data
)
{
unsigned
int
i
;
DWORD
offset
;
...
...
@@ -419,6 +437,14 @@ static HRESULT parse_fx10_local_buffer(struct d3d10_effect_local_buffer *l, cons
read_dword
(
ptr
,
&
offset
);
TRACE
(
"Local buffer name at offset %#x.
\n
"
,
offset
);
l
->
name
=
copy_name
(
data
+
offset
);
if
(
!
l
->
name
)
{
ERR
(
"Failed to copy name.
\n
"
);
return
E_OUTOFMEMORY
;
}
TRACE
(
"Local buffer name: %s.
\n
"
,
l
->
name
);
read_dword
(
ptr
,
&
l
->
data_size
);
TRACE
(
"Local buffer data size: %#x.
\n
"
,
l
->
data_size
);
...
...
@@ -461,7 +487,7 @@ static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, DWORD d
{
struct
d3d10_effect_local_buffer
*
l
=
&
e
->
local_buffers
[
i
];
hr
=
parse_fx10_local_buffer
(
l
,
&
ptr
);
hr
=
parse_fx10_local_buffer
(
l
,
&
ptr
,
data
);
if
(
FAILED
(
hr
))
return
hr
;
}
...
...
@@ -651,6 +677,13 @@ static void d3d10_effect_technique_destroy(struct d3d10_effect_technique *t)
}
}
static
void
d3d10_effect_local_buffer_destroy
(
struct
d3d10_effect_local_buffer
*
l
)
{
TRACE
(
"local buffer %p.
\n
"
,
l
);
HeapFree
(
GetProcessHeap
(),
0
,
l
->
name
);
}
/* IUnknown methods */
static
HRESULT
STDMETHODCALLTYPE
d3d10_effect_QueryInterface
(
ID3D10Effect
*
iface
,
REFIID
riid
,
void
**
object
)
...
...
@@ -690,16 +723,26 @@ static ULONG STDMETHODCALLTYPE d3d10_effect_Release(ID3D10Effect *iface)
if
(
!
refcount
)
{
unsigned
int
i
;
if
(
This
->
techniques
)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
This
->
technique_count
;
++
i
)
{
d3d10_effect_technique_destroy
(
&
This
->
techniques
[
i
]);
}
HeapFree
(
GetProcessHeap
(),
0
,
This
->
techniques
);
}
if
(
This
->
local_buffers
)
{
for
(
i
=
0
;
i
<
This
->
local_buffer_count
;
++
i
)
{
d3d10_effect_local_buffer_destroy
(
&
This
->
local_buffers
[
i
]);
}
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