Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
7b0ba515
Commit
7b0ba515
authored
Nov 03, 2011
by
Matteo Bruni
Committed by
Alexandre Julliard
Nov 04, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Test more thoroughly for post-pixelshader blending support, try on more texture formats.
parent
30757915
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
2 deletions
+68
-2
utils.c
dlls/wined3d/utils.c
+68
-2
No files found.
dlls/wined3d/utils.c
View file @
7b0ba515
...
...
@@ -1053,9 +1053,13 @@ static void check_fbo_compat(const struct wined3d_gl_info *gl_info, struct wined
}
}
if
(
status
==
GL_FRAMEBUFFER_COMPLETE
&&
format
->
flags
&
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
)
if
(
status
==
GL_FRAMEBUFFER_COMPLETE
&&
((
format
->
flags
&
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
)
||
!
(
gl_info
->
quirks
&
WINED3D_QUIRK_LIMITED_TEX_FILTERING
)))
{
GLuint
rb
;
GLuint
rb
,
tex2
;
DWORD
readback
[
16
*
16
],
color
;
BYTE
r
,
a
;
BOOL
match
=
TRUE
;
if
(
gl_info
->
supported
[
ARB_FRAMEBUFFER_OBJECT
]
||
gl_info
->
supported
[
EXT_PACKED_DEPTH_STENCIL
])
...
...
@@ -1069,6 +1073,7 @@ static void check_fbo_compat(const struct wined3d_gl_info *gl_info, struct wined
}
glEnable
(
GL_BLEND
);
glClearColor
(
0
,
0
,
0
,
1
);
glClear
(
GL_COLOR_BUFFER_BIT
);
if
(
glGetError
()
==
GL_INVALID_FRAMEBUFFER_OPERATION
)
{
...
...
@@ -1077,6 +1082,65 @@ static void check_fbo_compat(const struct wined3d_gl_info *gl_info, struct wined
format
->
flags
&=
~
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
;
}
glViewport
(
0
,
0
,
16
,
16
);
glDisable
(
GL_LIGHTING
);
glMatrixMode
(
GL_MODELVIEW
);
glLoadIdentity
();
glMatrixMode
(
GL_PROJECTION
);
glLoadIdentity
();
glBlendFunc
(
GL_SRC_ALPHA
,
GL_ONE_MINUS_SRC_ALPHA
);
/* Draw a full-black quad */
glBegin
(
GL_TRIANGLE_STRIP
);
glColor4ub
(
0x00
,
0x00
,
0x00
,
0xff
);
glVertex3f
(
-
1
.
0
f
,
-
1
.
0
f
,
0
.
0
f
);
glColor4ub
(
0x00
,
0x00
,
0x00
,
0xff
);
glVertex3f
(
1
.
0
f
,
-
1
.
0
f
,
0
.
0
f
);
glColor4ub
(
0x00
,
0x00
,
0x00
,
0xff
);
glVertex3f
(
-
1
.
0
f
,
1
.
0
f
,
0
.
0
f
);
glColor4ub
(
0x00
,
0x00
,
0x00
,
0xff
);
glVertex3f
(
1
.
0
f
,
1
.
0
f
,
0
.
0
f
);
glEnd
();
/* Draw a half-transparent red quad */
glBegin
(
GL_TRIANGLE_STRIP
);
glColor4ub
(
0xff
,
0x00
,
0x00
,
0x80
);
glVertex3f
(
-
1
.
0
f
,
-
1
.
0
f
,
0
.
0
f
);
glColor4ub
(
0xff
,
0x00
,
0x00
,
0x80
);
glVertex3f
(
1
.
0
f
,
-
1
.
0
f
,
0
.
0
f
);
glColor4ub
(
0xff
,
0x00
,
0x00
,
0x80
);
glVertex3f
(
-
1
.
0
f
,
1
.
0
f
,
0
.
0
f
);
glColor4ub
(
0xff
,
0x00
,
0x00
,
0x80
);
glVertex3f
(
1
.
0
f
,
1
.
0
f
,
0
.
0
f
);
glEnd
();
glGenTextures
(
1
,
&
tex2
);
glBindTexture
(
GL_TEXTURE_2D
,
tex2
);
glCopyTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGBA8
,
0
,
0
,
16
,
16
,
0
);
glGetTexImage
(
GL_TEXTURE_2D
,
0
,
GL_BGRA
,
GL_UNSIGNED_INT_8_8_8_8_REV
,
readback
);
checkGLcall
(
"Post-pixelshader blending check"
);
color
=
readback
[
7
*
16
+
7
];
a
=
color
>>
24
;
r
=
(
color
&
0x00ff0000
)
>>
16
;
if
(
format
->
red_mask
&&
(
r
<
0x7b
||
r
>
0x84
))
match
=
FALSE
;
/* If the alpha component is more than 1 bit */
else
if
((
format
->
alpha_mask
&
(
format
->
alpha_mask
-
1
))
&&
(
a
<
0x9f
||
a
>
0xdf
))
match
=
FALSE
;
if
(
!
match
)
{
TRACE
(
"Format doesn't support post-pixelshader blending.
\n
"
);
TRACE
(
"Color output: %#x
\n
"
,
color
);
format
->
flags
&=
~
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
;
}
glBindTexture
(
GL_TEXTURE_2D
,
tex
);
glDeleteTextures
(
1
,
&
tex2
);
if
(
gl_info
->
supported
[
ARB_FRAMEBUFFER_OBJECT
]
||
gl_info
->
supported
[
EXT_PACKED_DEPTH_STENCIL
])
{
...
...
@@ -1125,6 +1189,8 @@ static void init_format_fbo_compat_info(struct wined3d_gl_info *gl_info)
gl_info
->
fbo_ops
.
glGenFramebuffers
(
1
,
&
fbo
);
gl_info
->
fbo_ops
.
glBindFramebuffer
(
GL_FRAMEBUFFER
,
fbo
);
glDrawBuffer
(
GL_COLOR_ATTACHMENT0
);
glReadBuffer
(
GL_COLOR_ATTACHMENT0
);
LEAVE_GL
();
}
...
...
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