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
d53ad3ac
Commit
d53ad3ac
authored
Jul 18, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10: Add support for parsing blend factors to parse_fx10_object().
parent
8abcfedd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
3 deletions
+72
-3
d3d10_private.h
dlls/d3d10/d3d10_private.h
+6
-3
effect.c
dlls/d3d10/effect.c
+66
-0
No files found.
dlls/d3d10/d3d10_private.h
View file @
d53ad3ac
...
...
@@ -49,9 +49,10 @@ void d3d10_rb_free(void *ptr) DECLSPEC_HIDDEN;
enum
d3d10_effect_object_type
{
D3D10_EOT_VERTEXSHADER
=
6
,
D3D10_EOT_PIXELSHADER
=
7
,
D3D10_EOT_GEOMETRYSHADER
=
8
,
D3D10_EOT_VERTEXSHADER
=
0x6
,
D3D10_EOT_PIXELSHADER
=
0x7
,
D3D10_EOT_GEOMETRYSHADER
=
0x8
,
D3D10_EOT_BLEND_FACTOR
=
0xa
,
};
enum
d3d10_effect_object_operation
...
...
@@ -156,6 +157,8 @@ struct d3d10_effect_pass
DWORD
annotation_count
;
struct
d3d10_effect_object
*
objects
;
struct
d3d10_effect_variable
*
annotations
;
float
blend_factor
[
4
];
};
/* ID3D10EffectTechnique */
...
...
dlls/d3d10/effect.c
View file @
d53ad3ac
...
...
@@ -865,6 +865,10 @@ static HRESULT parse_fx10_anonymous_shader(struct d3d10_effect *e, struct d3d10_
shader
=
"geometryshader"
;
t
->
basetype
=
D3D10_SVT_GEOMETRYSHADER
;
break
;
default:
FIXME
(
"Unhandled object type %#x.
\n
"
,
otype
);
return
E_FAIL
;
}
if
(
!
copy_name
(
shader
,
&
t
->
name
))
...
...
@@ -899,6 +903,56 @@ static HRESULT parse_fx10_anonymous_shader(struct d3d10_effect *e, struct d3d10_
return
S_OK
;
}
static
BOOL
read_float_value
(
DWORD
value
,
D3D_SHADER_VARIABLE_TYPE
in_type
,
float
*
out_data
,
UINT
idx
)
{
switch
(
in_type
)
{
case
D3D10_SVT_FLOAT
:
out_data
[
idx
]
=
*
(
float
*
)
&
value
;
return
TRUE
;
default:
FIXME
(
"Unhandled in_type %#x.
\n
"
,
in_type
);
return
FALSE
;
}
}
static
BOOL
read_value_list
(
const
char
*
ptr
,
D3D_SHADER_VARIABLE_TYPE
out_type
,
UINT
out_size
,
void
*
out_data
)
{
D3D_SHADER_VARIABLE_TYPE
in_type
;
DWORD
t
,
value
;
DWORD
count
,
i
;
read_dword
(
&
ptr
,
&
count
);
if
(
count
!=
out_size
)
return
FALSE
;
TRACE
(
"%u values:
\n
"
,
count
);
for
(
i
=
0
;
i
<
count
;
++
i
)
{
read_dword
(
&
ptr
,
&
t
);
read_dword
(
&
ptr
,
&
value
);
in_type
=
d3d10_variable_type
(
t
,
FALSE
);
TRACE
(
"
\t
%s: %#x.
\n
"
,
debug_d3d10_shader_variable_type
(
in_type
),
value
);
switch
(
out_type
)
{
case
D3D10_SVT_FLOAT
:
if
(
!
read_float_value
(
value
,
in_type
,
out_data
,
i
))
return
FALSE
;
break
;
default:
FIXME
(
"Unhandled out_type %#x.
\n
"
,
out_type
);
return
FALSE
;
}
}
return
TRUE
;
}
static
HRESULT
parse_fx10_object
(
struct
d3d10_effect_object
*
o
,
const
char
**
ptr
,
const
char
*
data
)
{
const
char
*
data_ptr
=
NULL
;
...
...
@@ -945,6 +999,16 @@ static HRESULT parse_fx10_object(struct d3d10_effect_object *o, const char **ptr
hr
=
S_OK
;
break
;
case
D3D10_EOT_BLEND_FACTOR
:
if
(
!
read_value_list
(
data
+
offset
,
D3D10_SVT_FLOAT
,
4
,
&
o
->
pass
->
blend_factor
[
0
]))
{
FIXME
(
"Failed to read blend factor.
\n
"
);
return
E_FAIL
;
}
hr
=
S_OK
;
break
;
default:
FIXME
(
"Unhandled object type %#x
\n
"
,
o
->
type
);
hr
=
E_FAIL
;
...
...
@@ -2483,6 +2547,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetDesc(ID3D10EffectPass *ifa
}
}
memcpy
(
desc
->
BlendFactor
,
This
->
blend_factor
,
4
*
sizeof
(
float
));
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