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
084e967c
Commit
084e967c
authored
Sep 26, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 26, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10: Introduce a state object variable structure.
parent
7d7d1836
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
11 deletions
+36
-11
d3d10_private.h
dlls/d3d10/d3d10_private.h
+11
-0
effect.c
dlls/d3d10/effect.c
+25
-11
No files found.
dlls/d3d10/d3d10_private.h
View file @
084e967c
...
...
@@ -100,6 +100,17 @@ struct d3d10_effect_shader_variable
}
shader
;
};
struct
d3d10_effect_state_object_variable
{
union
{
D3D10_RASTERIZER_DESC
rasterizer
;
D3D10_DEPTH_STENCIL_DESC
depth_stencil
;
D3D10_BLEND_DESC
blend
;
D3D10_SAMPLER_DESC
sampler
;
}
desc
;
};
/* ID3D10EffectType */
struct
d3d10_effect_type
{
...
...
dlls/d3d10/effect.c
View file @
084e967c
...
...
@@ -231,7 +231,7 @@ static const D3D10_SAMPLER_DESC default_sampler_desc =
struct
d3d10_effect_state_storage_info
{
D3D_SHADER_VARIABLE_TYPE
id
;
size_t
size
;
SIZE_T
size
;
const
void
*
default_state
;
};
...
...
@@ -1641,6 +1641,7 @@ static HRESULT parse_fx10_local_variable(struct d3d10_effect_variable *v, const
{
const
struct
d3d10_effect_state_storage_info
*
storage_info
;
unsigned
int
count
=
max
(
v
->
type
->
element_count
,
1
);
struct
d3d10_effect_state_object_variable
*
s
;
if
(
!
(
storage_info
=
get_storage_info
(
v
->
type
->
basetype
)))
{
...
...
@@ -1649,31 +1650,36 @@ static HRESULT parse_fx10_local_variable(struct d3d10_effect_variable *v, const
return
E_FAIL
;
}
if
(
storage_info
->
size
>
sizeof
(
s
->
desc
))
{
ERR
(
"Invalid storage size %#lx.
\n
"
,
storage_info
->
size
);
return
E_FAIL
;
}
for
(
i
=
0
;
i
<
count
;
++
i
)
{
struct
d3d10_effect_variable
*
var
;
unsigned
char
*
desc
;
if
(
v
->
type
->
element_count
)
var
=
&
v
->
elements
[
i
];
else
var
=
v
;
if
(
!
(
desc
=
HeapAlloc
(
GetProcessHeap
(),
0
,
storage_info
->
size
)))
if
(
!
(
s
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
s
)
)))
{
ERR
(
"Failed to allocate backing store memory.
\n
"
);
return
E_OUTOFMEMORY
;
}
memcpy
(
desc
,
storage_info
->
default_state
,
storage_info
->
size
);
if
(
!
parse_fx10_state_group
(
ptr
,
data
,
var
->
type
->
basetype
,
desc
))
memcpy
(
&
s
->
desc
,
storage_info
->
default_state
,
storage_info
->
size
);
if
(
!
parse_fx10_state_group
(
ptr
,
data
,
var
->
type
->
basetype
,
&
s
->
desc
))
{
ERR
(
"Failed to read property list.
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
desc
);
HeapFree
(
GetProcessHeap
(),
0
,
s
);
return
E_FAIL
;
}
var
->
data
=
desc
;
var
->
data
=
s
;
}
}
break
;
...
...
@@ -6019,6 +6025,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetBackingStore(ID3
UINT
index
,
D3D10_BLEND_DESC
*
desc
)
{
struct
d3d10_effect_variable
*
v
=
impl_from_ID3D10EffectVariable
((
ID3D10EffectVariable
*
)
iface
);
struct
d3d10_effect_state_object_variable
*
s
;
TRACE
(
"iface %p, index %u, desc %p.
\n
"
,
iface
,
index
,
desc
);
...
...
@@ -6031,7 +6038,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetBackingStore(ID3
return
E_FAIL
;
}
*
desc
=
*
(
D3D10_BLEND_DESC
*
)
v
->
data
;
s
=
v
->
data
;
*
desc
=
s
->
desc
.
blend
;
return
S_OK
;
}
...
...
@@ -6237,6 +6245,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetBackingS
UINT
index
,
D3D10_DEPTH_STENCIL_DESC
*
desc
)
{
struct
d3d10_effect_variable
*
v
=
impl_from_ID3D10EffectVariable
((
ID3D10EffectVariable
*
)
iface
);
struct
d3d10_effect_state_object_variable
*
s
;
TRACE
(
"iface %p, index %u, desc %p.
\n
"
,
iface
,
index
,
desc
);
...
...
@@ -6249,7 +6258,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetBackingS
return
E_FAIL
;
}
*
desc
=
*
(
D3D10_DEPTH_STENCIL_DESC
*
)
v
->
data
;
s
=
v
->
data
;
*
desc
=
s
->
desc
.
depth_stencil
;
return
S_OK
;
}
...
...
@@ -6455,6 +6465,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetBackingStor
UINT
index
,
D3D10_RASTERIZER_DESC
*
desc
)
{
struct
d3d10_effect_variable
*
v
=
impl_from_ID3D10EffectVariable
((
ID3D10EffectVariable
*
)
iface
);
struct
d3d10_effect_state_object_variable
*
s
;
TRACE
(
"iface %p, index %u, desc %p.
\n
"
,
iface
,
index
,
desc
);
...
...
@@ -6467,7 +6478,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetBackingStor
return
E_FAIL
;
}
*
desc
=
*
(
D3D10_RASTERIZER_DESC
*
)
v
->
data
;
s
=
v
->
data
;
*
desc
=
s
->
desc
.
rasterizer
;
return
S_OK
;
}
...
...
@@ -6673,6 +6685,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetBackingStore(I
UINT
index
,
D3D10_SAMPLER_DESC
*
desc
)
{
struct
d3d10_effect_variable
*
v
=
impl_from_ID3D10EffectVariable
((
ID3D10EffectVariable
*
)
iface
);
struct
d3d10_effect_state_object_variable
*
s
;
TRACE
(
"iface %p, index %u, desc %p.
\n
"
,
iface
,
index
,
desc
);
...
...
@@ -6685,7 +6698,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetBackingStore(I
return
E_FAIL
;
}
*
desc
=
*
(
D3D10_SAMPLER_DESC
*
)
v
->
data
;
s
=
v
->
data
;
*
desc
=
s
->
desc
.
sampler
;
return
S_OK
;
}
...
...
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