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
b39125d2
Commit
b39125d2
authored
Dec 19, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 19, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of the WINED3DBLEND typedef.
parent
fb28e7f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
46 deletions
+45
-46
state.c
dlls/wined3d/state.c
+23
-23
stateblock.c
dlls/wined3d/stateblock.c
+4
-4
wined3d.h
include/wine/wined3d.h
+18
-19
No files found.
dlls/wined3d/state.c
View file @
b39125d2
...
...
@@ -292,41 +292,41 @@ static void state_blendop(struct wined3d_context *context, const struct wined3d_
}
}
static
GLenum
gl_blend_factor
(
WINED3DBLEND
factor
,
const
struct
wined3d_format
*
dst_format
)
static
GLenum
gl_blend_factor
(
enum
wined3d_blend
factor
,
const
struct
wined3d_format
*
dst_format
)
{
switch
(
factor
)
{
case
WINED3DBLEND_ZERO
:
case
WINED3D
_
BLEND_ZERO
:
return
GL_ZERO
;
case
WINED3DBLEND_ONE
:
case
WINED3D
_
BLEND_ONE
:
return
GL_ONE
;
case
WINED3DBLEND_SRCCOLOR
:
case
WINED3D
_
BLEND_SRCCOLOR
:
return
GL_SRC_COLOR
;
case
WINED3DBLEND_INVSRCCOLOR
:
case
WINED3D
_
BLEND_INVSRCCOLOR
:
return
GL_ONE_MINUS_SRC_COLOR
;
case
WINED3DBLEND_SRCALPHA
:
case
WINED3D
_
BLEND_SRCALPHA
:
return
GL_SRC_ALPHA
;
case
WINED3DBLEND_INVSRCALPHA
:
case
WINED3D
_
BLEND_INVSRCALPHA
:
return
GL_ONE_MINUS_SRC_ALPHA
;
case
WINED3DBLEND_DESTCOLOR
:
case
WINED3D
_
BLEND_DESTCOLOR
:
return
GL_DST_COLOR
;
case
WINED3DBLEND_INVDESTCOLOR
:
case
WINED3D
_
BLEND_INVDESTCOLOR
:
return
GL_ONE_MINUS_DST_COLOR
;
/* To compensate for the lack of format switching with backbuffer
* offscreen rendering, and with onscreen rendering, we modify the
* alpha test parameters for (INV)DESTALPHA if the render target
* doesn't support alpha blending. A nonexistent alpha channel
* returns 1.0, so WINED3DBLEND_DESTALPHA becomes GL_ONE, and
* WINED3DBLEND_INVDESTALPHA becomes GL_ZERO. */
case
WINED3DBLEND_DESTALPHA
:
* returns 1.0, so WINED3D
_
BLEND_DESTALPHA becomes GL_ONE, and
* WINED3D
_
BLEND_INVDESTALPHA becomes GL_ZERO. */
case
WINED3D
_
BLEND_DESTALPHA
:
return
dst_format
->
alpha_mask
?
GL_DST_ALPHA
:
GL_ONE
;
case
WINED3DBLEND_INVDESTALPHA
:
case
WINED3D
_
BLEND_INVDESTALPHA
:
return
dst_format
->
alpha_mask
?
GL_ONE_MINUS_DST_ALPHA
:
GL_ZERO
;
case
WINED3DBLEND_SRCALPHASAT
:
case
WINED3D
_
BLEND_SRCALPHASAT
:
return
GL_SRC_ALPHA_SATURATE
;
case
WINED3DBLEND_BLENDFACTOR
:
case
WINED3D
_
BLEND_BLENDFACTOR
:
return
GL_CONSTANT_COLOR_EXT
;
case
WINED3DBLEND_INVBLENDFACTOR
:
case
WINED3D
_
BLEND_INVBLENDFACTOR
:
return
GL_ONE_MINUS_CONSTANT_COLOR_EXT
;
default:
FIXME
(
"Unhandled blend factor %#x.
\n
"
,
factor
);
...
...
@@ -339,7 +339,7 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st
const
struct
wined3d_surface
*
target
=
state
->
fb
->
render_targets
[
0
];
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
GLenum
srcBlend
,
dstBlend
;
WINED3DBLEND
d3d_blend
;
enum
wined3d_blend
d3d_blend
;
/* According to the red book, GL_LINE_SMOOTH needs GL_BLEND with specific
* blending parameters to work. */
...
...
@@ -367,16 +367,16 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st
return
;
};
/* WINED3D
BLEND_BOTHSRCALPHA and WINED3D
BLEND_BOTHINVSRCALPHA are legacy
/* WINED3D
_BLEND_BOTHSRCALPHA and WINED3D_
BLEND_BOTHINVSRCALPHA are legacy
* source blending values which are still valid up to d3d9. They should
* not occur as dest blend values. */
d3d_blend
=
state
->
render_states
[
WINED3DRS_SRCBLEND
];
if
(
d3d_blend
==
WINED3DBLEND_BOTHSRCALPHA
)
if
(
d3d_blend
==
WINED3D
_
BLEND_BOTHSRCALPHA
)
{
srcBlend
=
GL_SRC_ALPHA
;
dstBlend
=
GL_ONE_MINUS_SRC_ALPHA
;
}
else
if
(
d3d_blend
==
WINED3DBLEND_BOTHINVSRCALPHA
)
else
if
(
d3d_blend
==
WINED3D
_
BLEND_BOTHINVSRCALPHA
)
{
srcBlend
=
GL_ONE_MINUS_SRC_ALPHA
;
dstBlend
=
GL_SRC_ALPHA
;
...
...
@@ -419,16 +419,16 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st
return
;
}
/* WINED3D
BLEND_BOTHSRCALPHA and WINED3D
BLEND_BOTHINVSRCALPHA are legacy
/* WINED3D
_BLEND_BOTHSRCALPHA and WINED3D_
BLEND_BOTHINVSRCALPHA are legacy
* source blending values which are still valid up to d3d9. They should
* not occur as dest blend values. */
d3d_blend
=
state
->
render_states
[
WINED3DRS_SRCBLENDALPHA
];
if
(
d3d_blend
==
WINED3DBLEND_BOTHSRCALPHA
)
if
(
d3d_blend
==
WINED3D
_
BLEND_BOTHSRCALPHA
)
{
srcBlendAlpha
=
GL_SRC_ALPHA
;
dstBlendAlpha
=
GL_ONE_MINUS_SRC_ALPHA
;
}
else
if
(
d3d_blend
==
WINED3DBLEND_BOTHINVSRCALPHA
)
else
if
(
d3d_blend
==
WINED3D
_
BLEND_BOTHINVSRCALPHA
)
{
srcBlendAlpha
=
GL_ONE_MINUS_SRC_ALPHA
;
dstBlendAlpha
=
GL_SRC_ALPHA
;
...
...
dlls/wined3d/stateblock.c
View file @
b39125d2
...
...
@@ -1131,8 +1131,8 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
state
->
render_states
[
WINED3DRS_ZWRITEENABLE
]
=
TRUE
;
state
->
render_states
[
WINED3DRS_ALPHATESTENABLE
]
=
FALSE
;
state
->
render_states
[
WINED3DRS_LASTPIXEL
]
=
TRUE
;
state
->
render_states
[
WINED3DRS_SRCBLEND
]
=
WINED3DBLEND_ONE
;
state
->
render_states
[
WINED3DRS_DESTBLEND
]
=
WINED3DBLEND_ZERO
;
state
->
render_states
[
WINED3DRS_SRCBLEND
]
=
WINED3D
_
BLEND_ONE
;
state
->
render_states
[
WINED3DRS_DESTBLEND
]
=
WINED3D
_
BLEND_ZERO
;
state
->
render_states
[
WINED3DRS_CULLMODE
]
=
WINED3DCULL_CCW
;
state
->
render_states
[
WINED3DRS_ZFUNC
]
=
WINED3DCMP_LESSEQUAL
;
state
->
render_states
[
WINED3DRS_ALPHAFUNC
]
=
WINED3DCMP_ALWAYS
;
...
...
@@ -1245,8 +1245,8 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
state
->
render_states
[
WINED3DRS_WRAP14
]
=
0
;
state
->
render_states
[
WINED3DRS_WRAP15
]
=
0
;
state
->
render_states
[
WINED3DRS_SEPARATEALPHABLENDENABLE
]
=
FALSE
;
state
->
render_states
[
WINED3DRS_SRCBLENDALPHA
]
=
WINED3DBLEND_ONE
;
state
->
render_states
[
WINED3DRS_DESTBLENDALPHA
]
=
WINED3DBLEND_ZERO
;
state
->
render_states
[
WINED3DRS_SRCBLENDALPHA
]
=
WINED3D
_
BLEND_ONE
;
state
->
render_states
[
WINED3DRS_DESTBLENDALPHA
]
=
WINED3D
_
BLEND_ZERO
;
state
->
render_states
[
WINED3DRS_BLENDOPALPHA
]
=
WINED3DBLENDOP_ADD
;
/* Texture Stage States - Put directly into state block, we will call function below */
...
...
include/wine/wined3d.h
View file @
b39125d2
...
...
@@ -385,25 +385,24 @@ typedef enum _WINED3DRENDERSTATETYPE
}
WINED3DRENDERSTATETYPE
;
#define WINEHIGHEST_RENDER_STATE WINED3DRS_BLENDOPALPHA
typedef
enum
_WINED3DBLEND
{
WINED3DBLEND_ZERO
=
1
,
WINED3DBLEND_ONE
=
2
,
WINED3DBLEND_SRCCOLOR
=
3
,
WINED3DBLEND_INVSRCCOLOR
=
4
,
WINED3DBLEND_SRCALPHA
=
5
,
WINED3DBLEND_INVSRCALPHA
=
6
,
WINED3DBLEND_DESTALPHA
=
7
,
WINED3DBLEND_INVDESTALPHA
=
8
,
WINED3DBLEND_DESTCOLOR
=
9
,
WINED3DBLEND_INVDESTCOLOR
=
10
,
WINED3DBLEND_SRCALPHASAT
=
11
,
WINED3DBLEND_BOTHSRCALPHA
=
12
,
WINED3DBLEND_BOTHINVSRCALPHA
=
13
,
WINED3DBLEND_BLENDFACTOR
=
14
,
WINED3DBLEND_INVBLENDFACTOR
=
15
,
WINED3DBLEND_FORCE_DWORD
=
0x7fffffff
}
WINED3DBLEND
;
enum
wined3d_blend
{
WINED3D_BLEND_ZERO
=
1
,
WINED3D_BLEND_ONE
=
2
,
WINED3D_BLEND_SRCCOLOR
=
3
,
WINED3D_BLEND_INVSRCCOLOR
=
4
,
WINED3D_BLEND_SRCALPHA
=
5
,
WINED3D_BLEND_INVSRCALPHA
=
6
,
WINED3D_BLEND_DESTALPHA
=
7
,
WINED3D_BLEND_INVDESTALPHA
=
8
,
WINED3D_BLEND_DESTCOLOR
=
9
,
WINED3D_BLEND_INVDESTCOLOR
=
10
,
WINED3D_BLEND_SRCALPHASAT
=
11
,
WINED3D_BLEND_BOTHSRCALPHA
=
12
,
WINED3D_BLEND_BOTHINVSRCALPHA
=
13
,
WINED3D_BLEND_BLENDFACTOR
=
14
,
WINED3D_BLEND_INVBLENDFACTOR
=
15
,
};
typedef
enum
_WINED3DBLENDOP
{
...
...
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