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
80818bfc
Commit
80818bfc
authored
Oct 28, 2008
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 29, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Support some more depth blt texture types in surface_depth_blt().
parent
17ab7f6b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
106 additions
and
11 deletions
+106
-11
surface.c
dlls/wined3d/surface.c
+106
-11
No files found.
dlls/wined3d/surface.c
View file @
80818bfc
...
...
@@ -3954,9 +3954,103 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_PrivateSetup(IWineD3DSurface *iface) {
return
WINED3D_OK
;
}
static
void
surface_depth_blt
(
IWineD3DSurfaceImpl
*
This
,
GLuint
texture
,
GLsizei
w
,
GLsizei
h
)
struct
depth_blt_info
{
GLenum
binding
;
GLenum
bind_target
;
enum
tex_types
tex_type
;
GLfloat
coords
[
4
][
3
];
};
static
void
surface_get_depth_blt_info
(
GLenum
target
,
GLsizei
w
,
GLsizei
h
,
struct
depth_blt_info
*
info
)
{
GLfloat
(
*
coords
)[
3
]
=
info
->
coords
;
switch
(
target
)
{
default:
FIXME
(
"Unsupported texture target %#x
\n
"
,
target
);
/* Fall back to GL_TEXTURE_2D */
case
GL_TEXTURE_2D
:
info
->
binding
=
GL_TEXTURE_BINDING_2D
;
info
->
bind_target
=
GL_TEXTURE_2D
;
info
->
tex_type
=
tex_2d
;
coords
[
0
][
0
]
=
0
.
0
f
;
coords
[
0
][
1
]
=
1
.
0
f
;
coords
[
0
][
2
]
=
0
.
0
f
;
coords
[
1
][
0
]
=
1
.
0
f
;
coords
[
1
][
1
]
=
1
.
0
f
;
coords
[
1
][
2
]
=
0
.
0
f
;
coords
[
2
][
0
]
=
0
.
0
f
;
coords
[
2
][
1
]
=
0
.
0
f
;
coords
[
2
][
2
]
=
0
.
0
f
;
coords
[
3
][
0
]
=
1
.
0
f
;
coords
[
3
][
1
]
=
0
.
0
f
;
coords
[
3
][
2
]
=
0
.
0
f
;
break
;
case
GL_TEXTURE_RECTANGLE_ARB
:
info
->
binding
=
GL_TEXTURE_BINDING_RECTANGLE_ARB
;
info
->
bind_target
=
GL_TEXTURE_RECTANGLE_ARB
;
info
->
tex_type
=
tex_rect
;
coords
[
0
][
0
]
=
0
.
0
f
;
coords
[
0
][
1
]
=
h
;
coords
[
0
][
2
]
=
0
.
0
f
;
coords
[
1
][
0
]
=
w
;
coords
[
1
][
1
]
=
h
;
coords
[
1
][
2
]
=
0
.
0
f
;
coords
[
2
][
0
]
=
0
.
0
f
;
coords
[
2
][
1
]
=
0
.
0
f
;
coords
[
2
][
2
]
=
0
.
0
f
;
coords
[
3
][
0
]
=
w
;
coords
[
3
][
1
]
=
0
.
0
f
;
coords
[
3
][
2
]
=
0
.
0
f
;
break
;
case
GL_TEXTURE_CUBE_MAP_POSITIVE_X
:
info
->
binding
=
GL_TEXTURE_BINDING_CUBE_MAP_ARB
;
info
->
bind_target
=
GL_TEXTURE_CUBE_MAP_ARB
;
info
->
tex_type
=
tex_cube
;
coords
[
0
][
0
]
=
1
.
0
f
;
coords
[
0
][
1
]
=
-
1
.
0
f
;
coords
[
0
][
2
]
=
1
.
0
f
;
coords
[
1
][
0
]
=
1
.
0
f
;
coords
[
1
][
1
]
=
-
1
.
0
f
;
coords
[
1
][
2
]
=
-
1
.
0
f
;
coords
[
2
][
0
]
=
1
.
0
f
;
coords
[
2
][
1
]
=
1
.
0
f
;
coords
[
2
][
2
]
=
1
.
0
f
;
coords
[
3
][
0
]
=
1
.
0
f
;
coords
[
3
][
1
]
=
1
.
0
f
;
coords
[
3
][
2
]
=
-
1
.
0
f
;
case
GL_TEXTURE_CUBE_MAP_NEGATIVE_X
:
info
->
binding
=
GL_TEXTURE_BINDING_CUBE_MAP_ARB
;
info
->
bind_target
=
GL_TEXTURE_CUBE_MAP_ARB
;
info
->
tex_type
=
tex_cube
;
coords
[
0
][
0
]
=
-
1
.
0
f
;
coords
[
0
][
1
]
=
-
1
.
0
f
;
coords
[
0
][
2
]
=
-
1
.
0
f
;
coords
[
1
][
0
]
=
-
1
.
0
f
;
coords
[
1
][
1
]
=
-
1
.
0
f
;
coords
[
1
][
2
]
=
1
.
0
f
;
coords
[
2
][
0
]
=
-
1
.
0
f
;
coords
[
2
][
1
]
=
1
.
0
f
;
coords
[
2
][
2
]
=
-
1
.
0
f
;
coords
[
3
][
0
]
=
-
1
.
0
f
;
coords
[
3
][
1
]
=
1
.
0
f
;
coords
[
3
][
2
]
=
1
.
0
f
;
case
GL_TEXTURE_CUBE_MAP_POSITIVE_Y
:
info
->
binding
=
GL_TEXTURE_BINDING_CUBE_MAP_ARB
;
info
->
bind_target
=
GL_TEXTURE_CUBE_MAP_ARB
;
info
->
tex_type
=
tex_cube
;
coords
[
0
][
0
]
=
-
1
.
0
f
;
coords
[
0
][
1
]
=
1
.
0
f
;
coords
[
0
][
2
]
=
1
.
0
f
;
coords
[
1
][
0
]
=
1
.
0
f
;
coords
[
1
][
1
]
=
1
.
0
f
;
coords
[
1
][
2
]
=
1
.
0
f
;
coords
[
2
][
0
]
=
-
1
.
0
f
;
coords
[
2
][
1
]
=
1
.
0
f
;
coords
[
2
][
2
]
=
-
1
.
0
f
;
coords
[
3
][
0
]
=
1
.
0
f
;
coords
[
3
][
1
]
=
1
.
0
f
;
coords
[
3
][
2
]
=
-
1
.
0
f
;
case
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
:
info
->
binding
=
GL_TEXTURE_BINDING_CUBE_MAP_ARB
;
info
->
bind_target
=
GL_TEXTURE_CUBE_MAP_ARB
;
info
->
tex_type
=
tex_cube
;
coords
[
0
][
0
]
=
-
1
.
0
f
;
coords
[
0
][
1
]
=
-
1
.
0
f
;
coords
[
0
][
2
]
=
-
1
.
0
f
;
coords
[
1
][
0
]
=
1
.
0
f
;
coords
[
1
][
1
]
=
-
1
.
0
f
;
coords
[
1
][
2
]
=
-
1
.
0
f
;
coords
[
2
][
0
]
=
-
1
.
0
f
;
coords
[
2
][
1
]
=
-
1
.
0
f
;
coords
[
2
][
2
]
=
1
.
0
f
;
coords
[
3
][
0
]
=
1
.
0
f
;
coords
[
3
][
1
]
=
-
1
.
0
f
;
coords
[
3
][
2
]
=
1
.
0
f
;
case
GL_TEXTURE_CUBE_MAP_POSITIVE_Z
:
info
->
binding
=
GL_TEXTURE_BINDING_CUBE_MAP_ARB
;
info
->
bind_target
=
GL_TEXTURE_CUBE_MAP_ARB
;
info
->
tex_type
=
tex_cube
;
coords
[
0
][
0
]
=
-
1
.
0
f
;
coords
[
0
][
1
]
=
-
1
.
0
f
;
coords
[
0
][
2
]
=
1
.
0
f
;
coords
[
1
][
0
]
=
1
.
0
f
;
coords
[
1
][
1
]
=
-
1
.
0
f
;
coords
[
1
][
2
]
=
1
.
0
f
;
coords
[
2
][
0
]
=
-
1
.
0
f
;
coords
[
2
][
1
]
=
1
.
0
f
;
coords
[
2
][
2
]
=
1
.
0
f
;
coords
[
3
][
0
]
=
1
.
0
f
;
coords
[
3
][
1
]
=
1
.
0
f
;
coords
[
3
][
2
]
=
1
.
0
f
;
case
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
:
info
->
binding
=
GL_TEXTURE_BINDING_CUBE_MAP_ARB
;
info
->
bind_target
=
GL_TEXTURE_CUBE_MAP_ARB
;
info
->
tex_type
=
tex_cube
;
coords
[
0
][
0
]
=
1
.
0
f
;
coords
[
0
][
1
]
=
-
1
.
0
f
;
coords
[
0
][
2
]
=
-
1
.
0
f
;
coords
[
1
][
0
]
=
-
1
.
0
f
;
coords
[
1
][
1
]
=
-
1
.
0
f
;
coords
[
1
][
2
]
=
-
1
.
0
f
;
coords
[
2
][
0
]
=
1
.
0
f
;
coords
[
2
][
1
]
=
1
.
0
f
;
coords
[
2
][
2
]
=
-
1
.
0
f
;
coords
[
3
][
0
]
=
-
1
.
0
f
;
coords
[
3
][
1
]
=
1
.
0
f
;
coords
[
3
][
2
]
=
-
1
.
0
f
;
}
}
static
void
surface_depth_blt
(
IWineD3DSurfaceImpl
*
This
,
GLuint
texture
,
GLsizei
w
,
GLsizei
h
,
GLenum
target
)
{
IWineD3DDeviceImpl
*
device
=
This
->
resource
.
wineD3DDevice
;
struct
depth_blt_info
info
;
GLint
old_binding
=
0
;
glPushAttrib
(
GL_ENABLE_BIT
|
GL_DEPTH_BUFFER_BIT
|
GL_COLOR_BUFFER_BIT
|
GL_VIEWPORT_BIT
);
...
...
@@ -3972,24 +4066,25 @@ static void surface_depth_blt(IWineD3DSurfaceImpl *This, GLuint texture, GLsizei
glBlendFunc
(
GL_ZERO
,
GL_ONE
);
glViewport
(
0
,
0
,
w
,
h
);
surface_get_depth_blt_info
(
target
,
w
,
h
,
&
info
);
GL_EXTCALL
(
glActiveTextureARB
(
GL_TEXTURE0_ARB
));
glGetIntegerv
(
GL_TEXTURE_BINDING_2D
,
&
old_binding
);
glBindTexture
(
GL_TEXTURE_2D
,
texture
);
glGetIntegerv
(
info
.
binding
,
&
old_binding
);
glBindTexture
(
info
.
bind_target
,
texture
);
device
->
shader_backend
->
shader_select_depth_blt
((
IWineD3DDevice
*
)
device
,
tex_2d
);
device
->
shader_backend
->
shader_select_depth_blt
((
IWineD3DDevice
*
)
device
,
info
.
tex_type
);
glBegin
(
GL_TRIANGLE_STRIP
);
glTexCoord
2f
(
0
.
0
f
,
1
.
0
f
);
glTexCoord
3fv
(
info
.
coords
[
0
]
);
glVertex2f
(
-
1
.
0
f
,
-
1
.
0
f
);
glTexCoord
2f
(
1
.
0
f
,
1
.
0
f
);
glTexCoord
3fv
(
info
.
coords
[
1
]
);
glVertex2f
(
1
.
0
f
,
-
1
.
0
f
);
glTexCoord
2f
(
0
.
0
f
,
0
.
0
f
);
glTexCoord
3fv
(
info
.
coords
[
2
]
);
glVertex2f
(
-
1
.
0
f
,
1
.
0
f
);
glTexCoord
2f
(
1
.
0
f
,
0
.
0
f
);
glTexCoord
3fv
(
info
.
coords
[
3
]
);
glVertex2f
(
1
.
0
f
,
1
.
0
f
);
glEnd
();
glBindTexture
(
GL_TEXTURE_2D
,
old_binding
);
glBindTexture
(
info
.
bind_target
,
old_binding
);
glPopAttrib
();
...
...
@@ -4079,7 +4174,7 @@ void surface_load_ds_location(IWineD3DSurface *iface, DWORD location) {
context_attach_depth_stencil_fbo
(
device
,
GL_FRAMEBUFFER_EXT
,
iface
,
FALSE
);
/* Do the actual blit */
surface_depth_blt
(
This
,
device
->
depth_blt_texture
,
This
->
currentDesc
.
Width
,
This
->
currentDesc
.
Height
);
surface_depth_blt
(
This
,
device
->
depth_blt_texture
,
This
->
currentDesc
.
Width
,
This
->
currentDesc
.
Height
,
GL_TEXTURE_2D
);
checkGLcall
(
"depth_blt"
);
if
(
device
->
activeContext
->
current_fbo
)
{
...
...
@@ -4101,7 +4196,7 @@ void surface_load_ds_location(IWineD3DSurface *iface, DWORD location) {
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
0
));
checkGLcall
(
"glBindFramebuffer()"
);
surface_depth_blt
(
This
,
This
->
glDescription
.
textureName
,
This
->
currentDesc
.
Width
,
This
->
currentDesc
.
Height
);
surface_depth_blt
(
This
,
This
->
glDescription
.
textureName
,
This
->
currentDesc
.
Width
,
This
->
currentDesc
.
Height
,
This
->
glDescription
.
target
);
checkGLcall
(
"depth_blt"
);
if
(
device
->
activeContext
->
current_fbo
)
{
...
...
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