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
3d2aa7af
Commit
3d2aa7af
authored
Jan 27, 2008
by
Stefan Dösinger
Committed by
Alexandre Julliard
Feb 05, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: De-Statify depth blit opengl resources.
parent
093d7d00
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
17 deletions
+54
-17
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+19
-6
baseshader.c
dlls/wined3d/baseshader.c
+2
-0
device.c
dlls/wined3d/device.c
+9
-1
drawprim.c
dlls/wined3d/drawprim.c
+4
-5
glsl_shader.c
dlls/wined3d/glsl_shader.c
+15
-5
wined3d_private.h
dlls/wined3d/wined3d_private.h
+5
-0
No files found.
dlls/wined3d/arb_program_shader.c
View file @
3d2aa7af
...
...
@@ -1713,18 +1713,30 @@ static void shader_arb_select(IWineD3DDevice *iface, BOOL usePS, BOOL useVS) {
static
void
shader_arb_select_depth_blt
(
IWineD3DDevice
*
iface
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
WineD3D_GL_Info
*
gl_info
=
&
This
->
adapter
->
gl_info
;
static
GLuint
vprogram_id
=
0
;
static
GLuint
fprogram_id
=
0
;
if
(
!
vprogram_id
)
vprogram_id
=
create_arb_blt_vertex_program
(
gl_info
);
GL_EXTCALL
(
glBindProgramARB
(
GL_VERTEX_PROGRAM_ARB
,
vprogram_id
));
if
(
!
This
->
depth_blt_vprogram_id
)
This
->
depth_blt_
vprogram_id
=
create_arb_blt_vertex_program
(
gl_info
);
GL_EXTCALL
(
glBindProgramARB
(
GL_VERTEX_PROGRAM_ARB
,
This
->
depth_blt_
vprogram_id
));
glEnable
(
GL_VERTEX_PROGRAM_ARB
);
if
(
!
fprogram_id
)
fprogram_id
=
create_arb_blt_fragment_program
(
gl_info
);
GL_EXTCALL
(
glBindProgramARB
(
GL_FRAGMENT_PROGRAM_ARB
,
fprogram_id
));
if
(
!
This
->
depth_blt_fprogram_id
)
This
->
depth_blt_
fprogram_id
=
create_arb_blt_fragment_program
(
gl_info
);
GL_EXTCALL
(
glBindProgramARB
(
GL_FRAGMENT_PROGRAM_ARB
,
This
->
depth_blt_
fprogram_id
));
glEnable
(
GL_FRAGMENT_PROGRAM_ARB
);
}
static
void
shader_arb_destroy_depth_blt
(
IWineD3DDevice
*
iface
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
WineD3D_GL_Info
*
gl_info
=
&
This
->
adapter
->
gl_info
;
if
(
This
->
depth_blt_vprogram_id
)
{
GL_EXTCALL
(
glDeleteProgramsARB
(
1
,
&
This
->
depth_blt_vprogram_id
));
This
->
depth_blt_vprogram_id
=
0
;
}
if
(
This
->
depth_blt_fprogram_id
)
{
GL_EXTCALL
(
glDeleteProgramsARB
(
1
,
&
This
->
depth_blt_fprogram_id
));
This
->
depth_blt_fprogram_id
=
0
;
}
}
static
void
shader_arb_cleanup
(
IWineD3DDevice
*
iface
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
WineD3D_GL_Info
*
gl_info
=
&
This
->
adapter
->
gl_info
;
...
...
@@ -1747,6 +1759,7 @@ static void shader_arb_destroy(IWineD3DBaseShader *iface) {
const
shader_backend_t
arb_program_shader_backend
=
{
&
shader_arb_select
,
&
shader_arb_select_depth_blt
,
&
shader_arb_destroy_depth_blt
,
&
shader_arb_load_constants
,
&
shader_arb_cleanup
,
&
shader_arb_color_correction
,
...
...
dlls/wined3d/baseshader.c
View file @
3d2aa7af
...
...
@@ -1098,6 +1098,7 @@ void shader_trace_init(
static
void
shader_none_select
(
IWineD3DDevice
*
iface
,
BOOL
usePS
,
BOOL
useVS
)
{}
static
void
shader_none_select_depth_blt
(
IWineD3DDevice
*
iface
)
{}
static
void
shader_none_destroy_depth_blt
(
IWineD3DDevice
*
iface
)
{}
static
void
shader_none_load_constants
(
IWineD3DDevice
*
iface
,
char
usePS
,
char
useVS
)
{}
static
void
shader_none_cleanup
(
IWineD3DDevice
*
iface
)
{}
static
void
shader_none_color_correction
(
SHADER_OPCODE_ARG
*
arg
)
{}
...
...
@@ -1106,6 +1107,7 @@ static void shader_none_destroy(IWineD3DBaseShader *iface) {}
const
shader_backend_t
none_shader_backend
=
{
&
shader_none_select
,
&
shader_none_select_depth_blt
,
&
shader_none_destroy_depth_blt
,
&
shader_none_load_constants
,
&
shader_none_cleanup
,
&
shader_none_color_correction
,
...
...
dlls/wined3d/device.c
View file @
3d2aa7af
...
...
@@ -6897,7 +6897,15 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE
This
->
shader_backend
->
shader_destroy
((
IWineD3DBaseShader
*
)
shader
);
}
if
(
pPresentationParameters
->
Windowed
)
{
if
(
This
->
depth_blt_texture
)
{
ENTER_GL
();
glDeleteTextures
(
1
,
&
This
->
depth_blt_texture
);
LEAVE_GL
();
This
->
depth_blt_texture
=
0
;
}
This
->
shader_backend
->
shader_destroy_depth_blt
(
iface
);
if
(
pPresentationParameters
->
Windowed
)
{
mode
.
Width
=
swapchain
->
orig_width
;
mode
.
Height
=
swapchain
->
orig_height
;
mode
.
RefreshRate
=
0
;
...
...
dlls/wined3d/drawprim.c
View file @
3d2aa7af
...
...
@@ -773,20 +773,19 @@ static void depth_copy(IWineD3DDevice *iface) {
}
if
(
This
->
render_offscreen
)
{
static
GLuint
tmp_texture
=
0
;
GLint
old_binding
=
0
;
TRACE
(
"Copying onscreen depth buffer to offscreen surface
\n
"
);
if
(
!
tmp
_texture
)
{
glGenTextures
(
1
,
&
tmp
_texture
);
if
(
!
This
->
depth_blt
_texture
)
{
glGenTextures
(
1
,
&
This
->
depth_blt
_texture
);
}
/* Note that we use depth_blt here as well, rather than glCopyTexImage2D
* directly on the FBO texture. That's because we need to flip. */
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
0
));
glGetIntegerv
(
GL_TEXTURE_BINDING_2D
,
&
old_binding
);
glBindTexture
(
GL_TEXTURE_2D
,
tmp
_texture
);
glBindTexture
(
GL_TEXTURE_2D
,
This
->
depth_blt
_texture
);
glCopyTexImage2D
(
depth_stencil
->
glDescription
.
target
,
depth_stencil
->
glDescription
.
level
,
depth_stencil
->
glDescription
.
glFormatInternal
,
...
...
@@ -802,7 +801,7 @@ static void depth_copy(IWineD3DDevice *iface) {
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
This
->
fbo
));
checkGLcall
(
"glBindFramebuffer()"
);
depth_blt
(
iface
,
tmp
_texture
);
depth_blt
(
iface
,
This
->
depth_blt
_texture
);
checkGLcall
(
"depth_blt"
);
}
else
{
TRACE
(
"Copying offscreen surface to onscreen depth buffer
\n
"
);
...
...
dlls/wined3d/glsl_shader.c
View file @
3d2aa7af
...
...
@@ -3229,18 +3229,27 @@ static void shader_glsl_select(IWineD3DDevice *iface, BOOL usePS, BOOL useVS) {
static
void
shader_glsl_select_depth_blt
(
IWineD3DDevice
*
iface
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
WineD3D_GL_Info
*
gl_info
=
&
This
->
adapter
->
gl_info
;
static
GLhandleARB
program_id
=
0
;
static
GLhandleARB
loc
=
-
1
;
if
(
!
program_id
)
{
program_id
=
create_glsl_blt_shader
(
gl_info
);
loc
=
GL_EXTCALL
(
glGetUniformLocationARB
(
program_id
,
"sampler"
));
if
(
!
This
->
depth_blt_glsl_
program_id
)
{
This
->
depth_blt_glsl_
program_id
=
create_glsl_blt_shader
(
gl_info
);
loc
=
GL_EXTCALL
(
glGetUniformLocationARB
(
This
->
depth_blt_glsl_
program_id
,
"sampler"
));
}
GL_EXTCALL
(
glUseProgramObjectARB
(
program_id
));
GL_EXTCALL
(
glUseProgramObjectARB
(
This
->
depth_blt_glsl_
program_id
));
GL_EXTCALL
(
glUniform1iARB
(
loc
,
0
));
}
static
void
shader_glsl_destroy_depth_blt
(
IWineD3DDevice
*
iface
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
WineD3D_GL_Info
*
gl_info
=
&
This
->
adapter
->
gl_info
;
if
(
This
->
depth_blt_glsl_program_id
)
{
GL_EXTCALL
(
glDeleteObjectARB
(
This
->
depth_blt_glsl_program_id
));
This
->
depth_blt_glsl_program_id
=
0
;
}
}
static
void
shader_glsl_cleanup
(
IWineD3DDevice
*
iface
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
WineD3D_GL_Info
*
gl_info
=
&
This
->
adapter
->
gl_info
;
...
...
@@ -3285,6 +3294,7 @@ static void shader_glsl_destroy(IWineD3DBaseShader *iface) {
const
shader_backend_t
glsl_shader_backend
=
{
&
shader_glsl_select
,
&
shader_glsl_select_depth_blt
,
&
shader_glsl_destroy_depth_blt
,
&
shader_glsl_load_constants
,
&
shader_glsl_cleanup
,
&
shader_glsl_color_correction
,
...
...
dlls/wined3d/wined3d_private.h
View file @
3d2aa7af
...
...
@@ -196,6 +196,7 @@ struct SHADER_OPCODE_ARG;
typedef
struct
{
void
(
*
shader_select
)(
IWineD3DDevice
*
iface
,
BOOL
usePS
,
BOOL
useVS
);
void
(
*
shader_select_depth_blt
)(
IWineD3DDevice
*
iface
);
void
(
*
shader_destroy_depth_blt
)(
IWineD3DDevice
*
iface
);
void
(
*
shader_load_constants
)(
IWineD3DDevice
*
iface
,
char
usePS
,
char
useVS
);
void
(
*
shader_cleanup
)(
IWineD3DDevice
*
iface
);
void
(
*
shader_color_correction
)(
struct
SHADER_OPCODE_ARG
*
arg
);
...
...
@@ -701,6 +702,10 @@ struct IWineD3DDeviceImpl
GLuint
src_fbo
;
GLuint
dst_fbo
;
GLenum
*
draw_buffers
;
GLuint
depth_blt_texture
;
GLuint
depth_blt_vprogram_id
;
GLuint
depth_blt_fprogram_id
;
GLhandleARB
depth_blt_glsl_program_id
;
/* Cursor management */
BOOL
bCursorVisible
;
...
...
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