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
53ea5de6
Commit
53ea5de6
authored
Jul 19, 2010
by
Rico Schüller
Committed by
Alexandre Julliard
Jul 21, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10: Move some helper funcs to utils.
parent
bb2600b6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
97 additions
and
90 deletions
+97
-90
d3d10_private.h
dlls/d3d10/d3d10_private.h
+27
-0
effect.c
dlls/d3d10/effect.c
+0
-90
utils.c
dlls/d3d10/utils.c
+70
-0
No files found.
dlls/d3d10/d3d10_private.h
View file @
53ea5de6
...
...
@@ -218,4 +218,31 @@ HRESULT d3d10_effect_parse(struct d3d10_effect *This, const void *data, SIZE_T d
HRESULT
WINAPI
D3D10CoreCreateDevice
(
IDXGIFactory
*
factory
,
IDXGIAdapter
*
adapter
,
UINT
flags
,
void
*
unknown0
,
ID3D10Device
**
device
);
#define MAKE_TAG(ch0, ch1, ch2, ch3) \
((DWORD)(ch0) | ((DWORD)(ch1) << 8) | \
((DWORD)(ch2) << 16) | ((DWORD)(ch3) << 24 ))
#define TAG_DXBC MAKE_TAG('D', 'X', 'B', 'C')
#define TAG_FX10 MAKE_TAG('F', 'X', '1', '0')
#define TAG_ISGN MAKE_TAG('I', 'S', 'G', 'N')
#define TAG_OSGN MAKE_TAG('O', 'S', 'G', 'N')
#define TAG_SHDR MAKE_TAG('S', 'H', 'D', 'R')
HRESULT
parse_dxbc
(
const
char
*
data
,
SIZE_T
data_size
,
HRESULT
(
*
chunk_handler
)(
const
char
*
data
,
DWORD
data_size
,
DWORD
tag
,
void
*
ctx
),
void
*
ctx
)
DECLSPEC_HIDDEN
;
static
inline
void
read_dword
(
const
char
**
ptr
,
DWORD
*
d
)
{
memcpy
(
d
,
*
ptr
,
sizeof
(
*
d
));
*
ptr
+=
sizeof
(
*
d
);
}
static
inline
void
write_dword
(
char
**
ptr
,
DWORD
d
)
{
memcpy
(
*
ptr
,
&
d
,
sizeof
(
d
));
*
ptr
+=
sizeof
(
d
);
}
void
skip_dword_unknown
(
const
char
**
ptr
,
unsigned
int
count
)
DECLSPEC_HIDDEN
;
void
write_dword_unknown
(
char
**
ptr
,
DWORD
d
)
DECLSPEC_HIDDEN
;
#endif
/* __WINE_D3D10_PRIVATE_H */
dlls/d3d10/effect.c
View file @
53ea5de6
...
...
@@ -25,14 +25,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d10
);
#define MAKE_TAG(ch0, ch1, ch2, ch3) \
((DWORD)(ch0) | ((DWORD)(ch1) << 8) | \
((DWORD)(ch2) << 16) | ((DWORD)(ch3) << 24 ))
#define TAG_DXBC MAKE_TAG('D', 'X', 'B', 'C')
#define TAG_FX10 MAKE_TAG('F', 'X', '1', '0')
#define TAG_ISGN MAKE_TAG('I', 'S', 'G', 'N')
#define TAG_OSGN MAKE_TAG('O', 'S', 'G', 'N')
#define D3D10_FX10_TYPE_COLUMN_SHIFT 11
#define D3D10_FX10_TYPE_COLUMN_MASK (0x7 << D3D10_FX10_TYPE_COLUMN_SHIFT)
...
...
@@ -118,88 +110,6 @@ static struct d3d10_effect_variable anonymous_gs = {(const ID3D10EffectVariableV
static
struct
d3d10_effect_type
*
get_fx10_type
(
struct
d3d10_effect
*
effect
,
const
char
*
data
,
DWORD
offset
);
static
inline
void
read_dword
(
const
char
**
ptr
,
DWORD
*
d
)
{
memcpy
(
d
,
*
ptr
,
sizeof
(
*
d
));
*
ptr
+=
sizeof
(
*
d
);
}
static
inline
void
skip_dword_unknown
(
const
char
**
ptr
,
unsigned
int
count
)
{
unsigned
int
i
;
DWORD
d
;
FIXME
(
"Skipping %u unknown DWORDs:
\n
"
,
count
);
for
(
i
=
0
;
i
<
count
;
++
i
)
{
read_dword
(
ptr
,
&
d
);
FIXME
(
"
\t
0x%08x
\n
"
,
d
);
}
}
static
inline
void
write_dword
(
char
**
ptr
,
DWORD
d
)
{
memcpy
(
*
ptr
,
&
d
,
sizeof
(
d
));
*
ptr
+=
sizeof
(
d
);
}
static
inline
void
write_dword_unknown
(
char
**
ptr
,
DWORD
d
)
{
FIXME
(
"Writing unknown DWORD 0x%08x
\n
"
,
d
);
write_dword
(
ptr
,
d
);
}
static
HRESULT
parse_dxbc
(
const
char
*
data
,
SIZE_T
data_size
,
HRESULT
(
*
chunk_handler
)(
const
char
*
data
,
DWORD
data_size
,
DWORD
tag
,
void
*
ctx
),
void
*
ctx
)
{
const
char
*
ptr
=
data
;
HRESULT
hr
=
S_OK
;
DWORD
chunk_count
;
DWORD
total_size
;
unsigned
int
i
;
DWORD
tag
;
read_dword
(
&
ptr
,
&
tag
);
TRACE
(
"tag: %s.
\n
"
,
debugstr_an
((
const
char
*
)
&
tag
,
4
));
if
(
tag
!=
TAG_DXBC
)
{
WARN
(
"Wrong tag.
\n
"
);
return
E_FAIL
;
}
/* checksum? */
skip_dword_unknown
(
&
ptr
,
4
);
skip_dword_unknown
(
&
ptr
,
1
);
read_dword
(
&
ptr
,
&
total_size
);
TRACE
(
"total size: %#x
\n
"
,
total_size
);
read_dword
(
&
ptr
,
&
chunk_count
);
TRACE
(
"chunk count: %#x
\n
"
,
chunk_count
);
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
);
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
;
}
return
hr
;
}
static
BOOL
copy_name
(
const
char
*
ptr
,
char
**
name
)
{
size_t
name_len
;
...
...
dlls/d3d10/utils.c
View file @
53ea5de6
...
...
@@ -111,3 +111,73 @@ void d3d10_rb_free(void *ptr)
{
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
}
void
skip_dword_unknown
(
const
char
**
ptr
,
unsigned
int
count
)
{
unsigned
int
i
;
DWORD
d
;
FIXME
(
"Skipping %u unknown DWORDs:
\n
"
,
count
);
for
(
i
=
0
;
i
<
count
;
++
i
)
{
read_dword
(
ptr
,
&
d
);
FIXME
(
"
\t
0x%08x
\n
"
,
d
);
}
}
void
write_dword_unknown
(
char
**
ptr
,
DWORD
d
)
{
FIXME
(
"Writing unknown DWORD 0x%08x
\n
"
,
d
);
write_dword
(
ptr
,
d
);
}
HRESULT
parse_dxbc
(
const
char
*
data
,
SIZE_T
data_size
,
HRESULT
(
*
chunk_handler
)(
const
char
*
data
,
DWORD
data_size
,
DWORD
tag
,
void
*
ctx
),
void
*
ctx
)
{
const
char
*
ptr
=
data
;
HRESULT
hr
=
S_OK
;
DWORD
chunk_count
;
DWORD
total_size
;
unsigned
int
i
;
DWORD
tag
;
read_dword
(
&
ptr
,
&
tag
);
TRACE
(
"tag: %s.
\n
"
,
debugstr_an
((
const
char
*
)
&
tag
,
4
));
if
(
tag
!=
TAG_DXBC
)
{
WARN
(
"Wrong tag.
\n
"
);
return
E_FAIL
;
}
/* checksum? */
skip_dword_unknown
(
&
ptr
,
4
);
skip_dword_unknown
(
&
ptr
,
1
);
read_dword
(
&
ptr
,
&
total_size
);
TRACE
(
"total size: %#x
\n
"
,
total_size
);
read_dword
(
&
ptr
,
&
chunk_count
);
TRACE
(
"chunk count: %#x
\n
"
,
chunk_count
);
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
);
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
;
}
return
hr
;
}
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