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
26b24ed8
Commit
26b24ed8
authored
Mar 03, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 03, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10: Simplify DXBC chunk handlers.
parent
152c9637
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
effect.c
dlls/d3d10/effect.c
+18
-17
No files found.
dlls/d3d10/effect.c
View file @
26b24ed8
...
...
@@ -60,7 +60,7 @@ static inline void read_tag(const char **ptr, DWORD *t, char t_str[5])
}
static
HRESULT
parse_dxbc
(
const
char
*
data
,
SIZE_T
data_size
,
HRESULT
(
*
chunk_handler
)(
const
char
*
data
,
void
*
ctx
),
void
*
ctx
)
HRESULT
(
*
chunk_handler
)(
const
char
*
data
,
DWORD
data_size
,
DWORD
tag
,
void
*
ctx
),
void
*
ctx
)
{
const
char
*
ptr
=
data
;
HRESULT
hr
=
S_OK
;
...
...
@@ -92,12 +92,19 @@ static HRESULT parse_dxbc(const char *data, SIZE_T data_size,
for
(
i
=
0
;
i
<
chunk_count
;
++
i
)
{
DWORD
chunk_tag
,
chunk_size
;
const
char
*
chunk_ptr
;
DWORD
chunk_offset
;
read_dword
(
&
ptr
,
&
chunk_offset
);
TRACE
(
"chunk %u at offset %#x
\n
"
,
i
,
chunk_offset
);
hr
=
chunk_handler
(
data
+
chunk_offset
,
ctx
);
chunk_ptr
=
data
+
chunk_offset
;
read_dword
(
&
chunk_ptr
,
&
chunk_tag
);
read_dword
(
&
chunk_ptr
,
&
chunk_size
);
hr
=
chunk_handler
(
chunk_ptr
,
chunk_size
,
chunk_tag
,
ctx
);
if
(
FAILED
(
hr
))
break
;
}
...
...
@@ -170,18 +177,15 @@ static HRESULT parse_fx10_technique_index(struct d3d10_effect_technique *t, cons
return
hr
;
}
static
HRESULT
shader_chunk_handler
(
const
char
*
data
,
void
*
ctx
)
static
HRESULT
shader_chunk_handler
(
const
char
*
data
,
DWORD
data_size
,
DWORD
tag
,
void
*
ctx
)
{
const
char
*
ptr
=
data
;
DWORD
chunk_size
;
char
tag_str
[
5
];
DWORD
tag
;
read_tag
(
&
ptr
,
&
tag
,
tag_str
);
memcpy
(
tag_str
,
&
tag
,
4
);
tag_str
[
4
]
=
'\0'
;
TRACE
(
"tag: %s
\n
"
,
tag_str
);
read_dword
(
&
ptr
,
&
chunk_size
);
TRACE
(
"chunk size: %#x
\n
"
,
chunk_size
);
TRACE
(
"chunk size: %#x
\n
"
,
data_size
);
switch
(
tag
)
{
...
...
@@ -393,24 +397,21 @@ static HRESULT parse_fx10(struct d3d10_effect *e, const char *data, DWORD data_s
return
parse_fx10_body
(
e
,
ptr
,
data_size
-
(
ptr
-
data
));
}
static
HRESULT
fx10_chunk_handler
(
const
char
*
data
,
void
*
ctx
)
static
HRESULT
fx10_chunk_handler
(
const
char
*
data
,
DWORD
data_size
,
DWORD
tag
,
void
*
ctx
)
{
struct
d3d10_effect
*
e
=
ctx
;
const
char
*
ptr
=
data
;
DWORD
chunk_size
;
char
tag_str
[
5
];
DWORD
tag
;
read_tag
(
&
ptr
,
&
tag
,
tag_str
);
memcpy
(
tag_str
,
&
tag
,
4
);
tag_str
[
4
]
=
'\0'
;
TRACE
(
"tag: %s
\n
"
,
tag_str
);
read_dword
(
&
ptr
,
&
chunk_size
);
TRACE
(
"chunk size: %#x
\n
"
,
chunk_size
);
TRACE
(
"chunk size: %#x
\n
"
,
data_size
);
switch
(
tag
)
{
case
TAG_FX10
:
return
parse_fx10
(
e
,
ptr
,
chunk
_size
);
return
parse_fx10
(
e
,
data
,
data
_size
);
default:
FIXME
(
"Unhandled chunk %s
\n
"
,
tag_str
);
...
...
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