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
d7250e97
Commit
d7250e97
authored
Jul 19, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Fetch GL functions from the WGL driver table, including glFinish and glFlush.
parent
72e87387
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
28 additions
and
38 deletions
+28
-38
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+1
-1
buffer.c
dlls/wined3d/buffer.c
+3
-3
device.c
dlls/wined3d/device.c
+2
-2
directx.c
dlls/wined3d/directx.c
+8
-13
drawprim.c
dlls/wined3d/drawprim.c
+1
-1
surface.c
dlls/wined3d/surface.c
+8
-8
swapchain.c
dlls/wined3d/swapchain.c
+1
-1
wined3d_gl.h
dlls/wined3d/wined3d_gl.h
+4
-9
No files found.
dlls/wined3d/arb_program_shader.c
View file @
d7250e97
...
...
@@ -7399,7 +7399,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
if
(
wined3d_settings
.
strict_draw_ordering
||
(
dst_surface
->
container
.
type
==
WINED3D_CONTAINER_SWAPCHAIN
&&
(
dst_surface
->
container
.
u
.
swapchain
->
front_buffer
==
dst_surface
)))
w
glFlush
();
/* Flush to ensure ordering across contexts. */
glFlush
();
/* Flush to ensure ordering across contexts. */
context_release
(
context
);
...
...
dlls/wined3d/buffer.c
View file @
d7250e97
...
...
@@ -635,7 +635,7 @@ static void buffer_sync_apple(struct wined3d_buffer *This, DWORD flags, const st
}
/* Since we don't know about old draws a glFinish is needed once */
w
glFinish
();
glFinish
();
return
;
}
TRACE
(
"Synchronizing buffer %p
\n
"
,
This
);
...
...
@@ -663,7 +663,7 @@ drop_query:
This
->
query
=
NULL
;
}
w
glFinish
();
glFinish
();
ENTER_GL
();
GL_EXTCALL
(
glBufferParameteriAPPLE
(
This
->
buffer_type_hint
,
GL_BUFFER_SERIALIZED_MODIFY_APPLE
,
GL_TRUE
));
checkGLcall
(
"glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_TRUE)"
);
...
...
@@ -1195,7 +1195,7 @@ void CDECL wined3d_buffer_unmap(struct wined3d_buffer *buffer)
GL_EXTCALL
(
glUnmapBufferARB
(
buffer
->
buffer_type_hint
));
LEAVE_GL
();
if
(
wined3d_settings
.
strict_draw_ordering
)
w
glFlush
();
/* Flush to ensure ordering across contexts. */
if
(
wined3d_settings
.
strict_draw_ordering
)
glFlush
();
/* Flush to ensure ordering across contexts. */
context_release
(
context
);
buffer
->
resource
.
allocatedMemory
=
NULL
;
...
...
dlls/wined3d/device.c
View file @
d7250e97
...
...
@@ -819,7 +819,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
if
(
wined3d_settings
.
strict_draw_ordering
||
(
flags
&
WINED3DCLEAR_TARGET
&&
target
->
container
.
type
==
WINED3D_CONTAINER_SWAPCHAIN
&&
target
->
container
.
u
.
swapchain
->
front_buffer
==
target
))
w
glFlush
();
/* Flush to ensure ordering across contexts. */
glFlush
();
/* Flush to ensure ordering across contexts. */
context_release
(
context
);
}
...
...
@@ -3811,7 +3811,7 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
context
=
context_acquire
(
device
,
NULL
);
/* We only have to do this if we need to read the, swapbuffers performs a flush for us */
w
glFlush
();
glFlush
();
/* No checkGLcall here to avoid locking the lock just for checking a call that hardly ever
* fails. */
context_release
(
context
);
...
...
dlls/wined3d/directx.c
View file @
d7250e97
...
...
@@ -556,7 +556,7 @@ static void test_pbo_functionality(struct wined3d_gl_info *gl_info)
GL_EXTCALL
(
glBindBufferARB
(
GL_PIXEL_UNPACK_BUFFER_ARB
,
0
));
LEAVE_GL
();
w
glFinish
();
/* just to be sure */
glFinish
();
/* just to be sure */
memset
(
check
,
0
,
sizeof
(
check
));
ENTER_GL
();
...
...
@@ -5408,11 +5408,14 @@ static BOOL InitAdapters(struct wined3d *wined3d)
}
}
/* Dynamically load all GL core functions */
#ifdef USE_WIN32_OPENGL
pwglGetProcAddress
=
(
void
*
)
GetProcAddress
(
mod_gl
,
"wglGetProcAddress"
);
#define USE_GL_FUNC(pfn) pfn = (void*)GetProcAddress(mod_gl, #pfn);
GL_FUNCS_GEN
;
#undef USE_GL_FUNC
#else
/* To bypass the opengl32 thunks
load wglGetProcAddress from gdi32
instead of opengl32 */
/* To bypass the opengl32 thunks
retrieve functions from the WGL driver
instead of opengl32 */
{
HDC
hdc
=
GetDC
(
0
);
const
struct
opengl_funcs
*
wgl_driver
=
__wine_get_wgl_driver
(
hdc
,
WINE_WGL_DRIVER_VERSION
);
...
...
@@ -5422,8 +5425,10 @@ static BOOL InitAdapters(struct wined3d *wined3d)
ReleaseDC
(
0
,
hdc
);
if
(
!
pwglGetProcAddress
)
goto
nogl_adapter
;
#define USE_GL_FUNC(pfn) pfn = wgl_driver->gl.p_##pfn;
GL_FUNCS_GEN
;
#undef USE_GL_FUNC
}
#define USE_GL_FUNC(pfn) pfn = (void*)pwglGetProcAddress(#pfn);
#endif
/* Load WGL core functions from opengl32.dll */
...
...
@@ -5431,16 +5436,6 @@ static BOOL InitAdapters(struct wined3d *wined3d)
WGL_FUNCS_GEN
;
#undef USE_WGL_FUNC
/* Dynamically load all GL core functions */
GL_FUNCS_GEN
;
#undef USE_GL_FUNC
/* Load glFinish and glFlush from opengl32.dll even if we're not using WIN32 opengl
* otherwise because we have to use winex11.drv's override
*/
wglFinish
=
(
void
*
)
GetProcAddress
(
mod_gl
,
"glFinish"
);
wglFlush
=
(
void
*
)
GetProcAddress
(
mod_gl
,
"glFlush"
);
glEnableWINE
=
glEnable
;
glDisableWINE
=
glDisable
;
...
...
dlls/wined3d/drawprim.c
View file @
d7250e97
...
...
@@ -767,7 +767,7 @@ void drawPrimitive(struct wined3d_device *device, UINT index_count, UINT StartId
wined3d_event_query_issue
(
device
->
buffer_queries
[
i
],
device
);
}
if
(
wined3d_settings
.
strict_draw_ordering
)
w
glFlush
();
/* Flush to ensure ordering across contexts. */
if
(
wined3d_settings
.
strict_draw_ordering
)
glFlush
();
/* Flush to ensure ordering across contexts. */
context_release
(
context
);
...
...
dlls/wined3d/surface.c
View file @
d7250e97
...
...
@@ -1136,7 +1136,7 @@ static void wined3d_surface_depth_blt_fbo(const struct wined3d_device *device, s
LEAVE_GL
();
if
(
wined3d_settings
.
strict_draw_ordering
)
w
glFlush
();
/* Flush to ensure ordering across contexts. */
glFlush
();
/* Flush to ensure ordering across contexts. */
context_release
(
context
);
}
...
...
@@ -1259,7 +1259,7 @@ static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_te
if
(
wined3d_settings
.
strict_draw_ordering
||
(
dst_location
==
SFLAG_INDRAWABLE
&&
dst_surface
->
container
.
u
.
swapchain
->
front_buffer
==
dst_surface
))
w
glFlush
();
glFlush
();
context_release
(
context
);
}
...
...
@@ -2378,7 +2378,7 @@ static void surface_upload_data(struct wined3d_surface *surface, const struct wi
LEAVE_GL
();
if
(
wined3d_settings
.
strict_draw_ordering
)
w
glFlush
();
glFlush
();
if
(
gl_info
->
quirks
&
WINED3D_QUIRK_FBO_TEX_UPDATE
)
{
...
...
@@ -4575,7 +4575,7 @@ static void flush_to_framebuffer_drawpixels(struct wined3d_surface *surface,
if
(
wined3d_settings
.
strict_draw_ordering
||
(
surface
->
container
.
type
==
WINED3D_CONTAINER_SWAPCHAIN
&&
surface
->
container
.
u
.
swapchain
->
front_buffer
==
surface
))
w
glFlush
();
glFlush
();
context_release
(
context
);
}
...
...
@@ -5260,7 +5260,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
LEAVE_GL
();
if
(
wined3d_settings
.
strict_draw_ordering
)
w
glFlush
();
/* Flush to ensure ordering across contexts. */
if
(
wined3d_settings
.
strict_draw_ordering
)
glFlush
();
/* Flush to ensure ordering across contexts. */
context_release
(
context
);
...
...
@@ -5363,7 +5363,7 @@ static void surface_blt_to_drawable(const struct wined3d_device *device,
if
(
wined3d_settings
.
strict_draw_ordering
||
(
dst_surface
->
container
.
type
==
WINED3D_CONTAINER_SWAPCHAIN
&&
(
dst_surface
->
container
.
u
.
swapchain
->
front_buffer
==
dst_surface
)))
w
glFlush
();
/* Flush to ensure ordering across contexts. */
glFlush
();
/* Flush to ensure ordering across contexts. */
context_release
(
context
);
}
...
...
@@ -5794,7 +5794,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
LEAVE_GL
();
if
(
wined3d_settings
.
strict_draw_ordering
)
w
glFlush
();
/* Flush to ensure ordering across contexts. */
if
(
wined3d_settings
.
strict_draw_ordering
)
glFlush
();
/* Flush to ensure ordering across contexts. */
}
else
if
(
location
==
SFLAG_INDRAWABLE
)
{
...
...
@@ -5812,7 +5812,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
LEAVE_GL
();
if
(
wined3d_settings
.
strict_draw_ordering
)
w
glFlush
();
/* Flush to ensure ordering across contexts. */
if
(
wined3d_settings
.
strict_draw_ordering
)
glFlush
();
/* Flush to ensure ordering across contexts. */
}
else
{
...
...
dlls/wined3d/swapchain.c
View file @
d7250e97
...
...
@@ -564,7 +564,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
}
if
(
swapchain
->
num_contexts
>
1
)
w
glFinish
();
glFinish
();
SwapBuffers
(
context
->
hdc
);
/* TODO: cycle through the swapchain buffers */
TRACE
(
"SwapBuffers called, Starting new frame
\n
"
);
...
...
dlls/wined3d/wined3d_gl.h
View file @
d7250e97
...
...
@@ -1095,6 +1095,8 @@ void (WINE_GLAPI *glEvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint
void
(
WINE_GLAPI
*
glEvalPoint1
)(
GLint
i
)
DECLSPEC_HIDDEN
;
void
(
WINE_GLAPI
*
glEvalPoint2
)(
GLint
i
,
GLint
j
)
DECLSPEC_HIDDEN
;
void
(
WINE_GLAPI
*
glFeedbackBuffer
)(
GLsizei
size
,
GLenum
type
,
GLfloat
*
buffer
)
DECLSPEC_HIDDEN
;
void
(
WINE_GLAPI
*
glFinish
)(
void
)
DECLSPEC_HIDDEN
;
void
(
WINE_GLAPI
*
glFlush
)(
void
)
DECLSPEC_HIDDEN
;
void
(
WINE_GLAPI
*
glFogf
)(
GLenum
pname
,
GLfloat
param
)
DECLSPEC_HIDDEN
;
void
(
WINE_GLAPI
*
glFogfv
)(
GLenum
pname
,
const
GLfloat
*
params
)
DECLSPEC_HIDDEN
;
void
(
WINE_GLAPI
*
glFogi
)(
GLenum
pname
,
GLint
param
)
DECLSPEC_HIDDEN
;
...
...
@@ -1353,15 +1355,6 @@ void (WINE_GLAPI *glVertex4sv)(const GLshort *v) DECLSPEC_HIDDEN;
void
(
WINE_GLAPI
*
glVertexPointer
)(
GLint
size
,
GLenum
type
,
GLsizei
stride
,
const
GLvoid
*
pointer
)
DECLSPEC_HIDDEN
;
void
(
WINE_GLAPI
*
glViewport
)(
GLint
x
,
GLint
y
,
GLsizei
width
,
GLsizei
height
)
DECLSPEC_HIDDEN
;
/* glFinish and glFlush are always loaded from opengl32.dll, thus they always have
* __stdcall calling convention.
*
* They are wgl functions and must not be called inside the gl lock, give them a
* name that makes this clear
*/
void
(
__stdcall
*
wglFinish
)(
void
)
DECLSPEC_HIDDEN
;
void
(
__stdcall
*
wglFlush
)(
void
)
DECLSPEC_HIDDEN
;
/* WGL functions */
HGLRC
(
WINAPI
*
pwglCreateContext
)(
HDC
)
DECLSPEC_HIDDEN
;
BOOL
(
WINAPI
*
pwglDeleteContext
)(
HGLRC
)
DECLSPEC_HIDDEN
;
...
...
@@ -1461,6 +1454,8 @@ BOOL (WINAPI *pwglShareLists)(HGLRC, HGLRC) DECLSPEC_HIDDEN;
USE_GL_FUNC(glEvalPoint1) \
USE_GL_FUNC(glEvalPoint2) \
USE_GL_FUNC(glFeedbackBuffer) \
USE_GL_FUNC(glFinish) \
USE_GL_FUNC(glFlush) \
USE_GL_FUNC(glFogf) \
USE_GL_FUNC(glFogfv) \
USE_GL_FUNC(glFogi) \
...
...
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