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
f58405f6
Commit
f58405f6
authored
Jul 15, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 15, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10: Parse effect variables.
parent
ddc948b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
1 deletion
+63
-1
d3d10_private.h
dlls/d3d10/d3d10_private.h
+7
-0
effect.c
dlls/d3d10/effect.c
+56
-1
No files found.
dlls/d3d10/d3d10_private.h
View file @
f58405f6
...
...
@@ -58,11 +58,18 @@ struct d3d10_effect_shader_variable
}
shader
;
};
struct
d3d10_effect_variable
{
char
*
name
;
DWORD
buffer_offset
;
};
struct
d3d10_effect_local_buffer
{
char
*
name
;
DWORD
data_size
;
DWORD
variable_count
;
struct
d3d10_effect_variable
*
variables
;
};
/* ID3D10EffectPass */
...
...
dlls/d3d10/effect.c
View file @
f58405f6
...
...
@@ -389,6 +389,34 @@ static HRESULT parse_fx10_technique(struct d3d10_effect_technique *t, const char
return
S_OK
;
}
static
HRESULT
parse_fx10_variable
(
struct
d3d10_effect_variable
*
v
,
const
char
**
ptr
,
const
char
*
data
)
{
DWORD
offset
;
read_dword
(
ptr
,
&
offset
);
TRACE
(
"Variable name at offset %#x.
\n
"
,
offset
);
v
->
name
=
copy_name
(
data
+
offset
);
if
(
!
v
->
name
)
{
ERR
(
"Failed to copy name.
\n
"
);
return
E_OUTOFMEMORY
;
}
TRACE
(
"Variable name: %s.
\n
"
,
v
->
name
);
read_dword
(
ptr
,
&
offset
);
TRACE
(
"Variable type info at offset %#x.
\n
"
,
offset
);
skip_dword_unknown
(
ptr
,
1
);
read_dword
(
ptr
,
&
v
->
buffer_offset
);
TRACE
(
"Variable offset in buffer: %#x.
\n
"
,
v
->
buffer_offset
);
skip_dword_unknown
(
ptr
,
3
);
return
S_OK
;
}
static
HRESULT
parse_fx10_local_buffer
(
struct
d3d10_effect_local_buffer
*
l
,
const
char
**
ptr
,
const
char
*
data
)
{
unsigned
int
i
;
...
...
@@ -415,9 +443,20 @@ static HRESULT parse_fx10_local_buffer(struct d3d10_effect_local_buffer *l, cons
skip_dword_unknown
(
ptr
,
2
);
l
->
variables
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
l
->
variable_count
*
sizeof
(
*
l
->
variables
));
if
(
!
l
->
variables
)
{
ERR
(
"Failed to allocate variables memory.
\n
"
);
return
E_OUTOFMEMORY
;
}
for
(
i
=
0
;
i
<
l
->
variable_count
;
++
i
)
{
skip_dword_unknown
(
ptr
,
7
);
struct
d3d10_effect_variable
*
v
=
&
l
->
variables
[
i
];
HRESULT
hr
;
hr
=
parse_fx10_variable
(
v
,
ptr
,
data
);
if
(
FAILED
(
hr
))
return
hr
;
}
return
S_OK
;
...
...
@@ -634,11 +673,27 @@ static void d3d10_effect_technique_destroy(struct d3d10_effect_technique *t)
}
}
static
void
d3d10_effect_variable_destroy
(
struct
d3d10_effect_variable
*
v
)
{
TRACE
(
"variable %p.
\n
"
,
v
);
HeapFree
(
GetProcessHeap
(),
0
,
v
->
name
);
}
static
void
d3d10_effect_local_buffer_destroy
(
struct
d3d10_effect_local_buffer
*
l
)
{
TRACE
(
"local buffer %p.
\n
"
,
l
);
HeapFree
(
GetProcessHeap
(),
0
,
l
->
name
);
if
(
l
->
variables
)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
l
->
variable_count
;
++
i
)
{
d3d10_effect_variable_destroy
(
&
l
->
variables
[
i
]);
}
HeapFree
(
GetProcessHeap
(),
0
,
l
->
variables
);
}
}
/* IUnknown methods */
...
...
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