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
52b24d22
Commit
52b24d22
authored
Mar 06, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 06, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10: Create shaders.
parent
449be2d3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
11 deletions
+50
-11
d3d10_private.h
dlls/d3d10/d3d10_private.h
+9
-0
effect.c
dlls/d3d10/effect.c
+41
-11
No files found.
dlls/d3d10/d3d10_private.h
View file @
52b24d22
...
...
@@ -40,6 +40,7 @@ enum d3d10_effect_variable_type
struct
d3d10_effect_variable
{
struct
d3d10_effect_pass
*
pass
;
enum
d3d10_effect_variable_type
type
;
DWORD
idx_offset
;
void
*
data
;
...
...
@@ -49,6 +50,12 @@ struct d3d10_effect_shader_variable
{
char
*
input_signature
;
UINT
input_signature_size
;
union
{
ID3D10VertexShader
*
vs
;
ID3D10PixelShader
*
ps
;
ID3D10GeometryShader
*
gs
;
}
shader
;
};
/* ID3D10EffectPass */
...
...
@@ -56,6 +63,7 @@ struct d3d10_effect_pass
{
const
struct
ID3D10EffectPassVtbl
*
vtbl
;
struct
d3d10_effect_technique
*
technique
;
char
*
name
;
DWORD
start
;
DWORD
variable_count
;
...
...
@@ -67,6 +75,7 @@ struct d3d10_effect_technique
{
const
struct
ID3D10EffectTechniqueVtbl
*
vtbl
;
struct
d3d10_effect
*
effect
;
char
*
name
;
DWORD
start
;
DWORD
pass_count
;
...
...
dlls/d3d10/effect.c
View file @
52b24d22
...
...
@@ -145,13 +145,17 @@ static HRESULT parse_fx10_pass_index(struct d3d10_effect_pass *p, const char **p
for
(
i
=
0
;
i
<
p
->
variable_count
;
++
i
)
{
read_dword
(
ptr
,
&
p
->
variables
[
i
].
type
);
TRACE
(
"Variable %u is of type %#x
\n
"
,
i
,
p
->
variables
[
i
].
type
);
struct
d3d10_effect_variable
*
v
=
&
p
->
variables
[
i
];
v
->
pass
=
p
;
read_dword
(
ptr
,
&
v
->
type
);
TRACE
(
"Variable %u is of type %#x
\n
"
,
i
,
v
->
type
);
skip_dword_unknown
(
ptr
,
2
);
read_dword
(
ptr
,
&
p
->
variables
[
i
].
idx_offset
);
TRACE
(
"Variable %u idx is at offset %#x
\n
"
,
i
,
p
->
variables
[
i
].
idx_offset
);
read_dword
(
ptr
,
&
v
->
idx_offset
);
TRACE
(
"Variable %u idx is at offset %#x
\n
"
,
i
,
v
->
idx_offset
);
}
return
S_OK
;
...
...
@@ -182,6 +186,7 @@ static HRESULT parse_fx10_technique_index(struct d3d10_effect_technique *t, cons
struct
d3d10_effect_pass
*
p
=
&
t
->
passes
[
i
];
p
->
vtbl
=
&
d3d10_effect_pass_vtbl
;
p
->
technique
=
t
;
hr
=
parse_fx10_pass_index
(
p
,
ptr
);
if
(
FAILED
(
hr
))
break
;
...
...
@@ -192,8 +197,7 @@ static HRESULT parse_fx10_technique_index(struct d3d10_effect_technique *t, cons
static
HRESULT
shader_chunk_handler
(
const
char
*
data
,
DWORD
data_size
,
DWORD
tag
,
void
*
ctx
)
{
struct
d3d10_effect_variable
*
v
=
ctx
;
struct
d3d10_effect_shader_variable
*
s
=
v
->
data
;
struct
d3d10_effect_shader_variable
*
s
=
ctx
;
char
tag_str
[
5
];
memcpy
(
tag_str
,
&
tag
,
4
);
...
...
@@ -257,8 +261,11 @@ static HRESULT shader_chunk_handler(const char *data, DWORD data_size, DWORD tag
static
HRESULT
parse_shader
(
struct
d3d10_effect_variable
*
v
,
const
char
*
data
)
{
ID3D10Device
*
device
=
v
->
pass
->
technique
->
effect
->
device
;
struct
d3d10_effect_shader_variable
*
s
;
const
char
*
ptr
=
data
;
DWORD
dxbc_size
;
HRESULT
hr
;
v
->
data
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
struct
d3d10_effect_shader_variable
));
if
(
!
v
->
data
)
...
...
@@ -267,10 +274,31 @@ static HRESULT parse_shader(struct d3d10_effect_variable *v, const char *data)
return
E_OUTOFMEMORY
;
}
if
(
!
ptr
)
return
S_OK
;
s
=
v
->
data
;
read_dword
(
&
ptr
,
&
dxbc_size
);
TRACE
(
"dxbc size: %#x
\n
"
,
dxbc_size
);
return
parse_dxbc
(
ptr
,
dxbc_size
,
shader_chunk_handler
,
v
);
switch
(
v
->
type
)
{
case
D3D10_EVT_VERTEXSHADER
:
hr
=
ID3D10Device_CreateVertexShader
(
device
,
ptr
,
dxbc_size
,
&
s
->
shader
.
vs
);
if
(
FAILED
(
hr
))
return
hr
;
break
;
case
D3D10_EVT_PIXELSHADER
:
hr
=
ID3D10Device_CreatePixelShader
(
device
,
ptr
,
dxbc_size
,
&
s
->
shader
.
ps
);
if
(
FAILED
(
hr
))
return
hr
;
break
;
case
D3D10_EVT_GEOMETRYSHADER
:
hr
=
ID3D10Device_CreateGeometryShader
(
device
,
ptr
,
dxbc_size
,
&
s
->
shader
.
gs
);
if
(
FAILED
(
hr
))
return
hr
;
break
;
}
return
parse_dxbc
(
ptr
,
dxbc_size
,
shader_chunk_handler
,
s
);
}
static
HRESULT
parse_fx10_variable
(
struct
d3d10_effect_variable
*
v
,
const
char
*
data
)
...
...
@@ -288,10 +316,13 @@ static HRESULT parse_fx10_variable(struct d3d10_effect_variable *v, const char *
if
(
offset
==
1
)
{
WARN
(
"Skipping variable
\n
"
);
return
S_OK
;
ptr
=
NULL
;
}
else
{
ptr
=
data
+
offset
;
}
ptr
=
data
+
offset
;
switch
(
v
->
type
)
{
case
D3D10_EVT_VERTEXSHADER
:
...
...
@@ -400,6 +431,7 @@ static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, DWORD d
struct
d3d10_effect_technique
*
t
=
&
e
->
techniques
[
i
];
t
->
vtbl
=
&
d3d10_effect_technique_vtbl
;
t
->
effect
=
e
;
hr
=
parse_fx10_technique_index
(
t
,
&
ptr
);
if
(
FAILED
(
hr
))
break
;
...
...
@@ -493,8 +525,6 @@ static void d3d10_effect_variable_destroy(struct d3d10_effect_variable *v)
{
TRACE
(
"variable %p
\n
"
,
v
);
if
(
!
v
->
data
)
return
;
switch
(
v
->
type
)
{
case
D3D10_EVT_VERTEXSHADER
:
...
...
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