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
d03e2696
Commit
d03e2696
authored
Jul 29, 2007
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Jul 30, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wgl: Replace glReadPixels in wglBindTexImage2D by the MUCH faster glCopyTexImage2D.
parent
8cbb0a6f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
opengl.c
dlls/winex11.drv/opengl.c
+15
-16
No files found.
dlls/winex11.drv/opengl.c
View file @
d03e2696
...
...
@@ -250,6 +250,7 @@ static void (*pglXFreeMemoryNV)(GLvoid *pointer);
MAKE_FUNCPTR
(
glBindTexture
)
MAKE_FUNCPTR
(
glBitmap
)
MAKE_FUNCPTR
(
glCopyTexSubImage1D
)
MAKE_FUNCPTR
(
glCopyTexImage2D
)
MAKE_FUNCPTR
(
glCopyTexSubImage2D
)
MAKE_FUNCPTR
(
glDisable
)
MAKE_FUNCPTR
(
glDrawBuffer
)
...
...
@@ -396,6 +397,7 @@ LOAD_FUNCPTR(glXGetFBConfigs)
LOAD_FUNCPTR
(
glBindTexture
)
LOAD_FUNCPTR
(
glBitmap
)
LOAD_FUNCPTR
(
glCopyTexSubImage1D
)
LOAD_FUNCPTR
(
glCopyTexImage2D
)
LOAD_FUNCPTR
(
glCopyTexSubImage2D
)
LOAD_FUNCPTR
(
glDisable
)
LOAD_FUNCPTR
(
glDrawBuffer
)
...
...
@@ -2134,7 +2136,7 @@ static HPBUFFERARB WINAPI X11DRV_wglCreatePbufferARB(HDC hdc, int iPixelFormat,
goto
create_failed
;
}
object
->
texture_target
=
GL_TEXTURE_CUBE_MAP
;
object
->
texture_bind_target
=
GL_TEXTURE_CUBE_MAP
;
object
->
texture_bind_target
=
GL_TEXTURE_
BINDING_
CUBE_MAP
;
break
;
}
case
WGL_TEXTURE_1D_ARB
:
{
...
...
@@ -2143,12 +2145,12 @@ static HPBUFFERARB WINAPI X11DRV_wglCreatePbufferARB(HDC hdc, int iPixelFormat,
goto
create_failed
;
}
object
->
texture_target
=
GL_TEXTURE_1D
;
object
->
texture_bind_target
=
GL_TEXTURE_1D
;
object
->
texture_bind_target
=
GL_TEXTURE_
BINDING_
1D
;
break
;
}
case
WGL_TEXTURE_2D_ARB
:
{
object
->
texture_target
=
GL_TEXTURE_2D
;
object
->
texture_bind_target
=
GL_TEXTURE_2D
;
object
->
texture_bind_target
=
GL_TEXTURE_
BINDING_
2D
;
break
;
}
case
WGL_TEXTURE_RECTANGLE_NV
:
{
...
...
@@ -2736,8 +2738,8 @@ static GLboolean WINAPI X11DRV_wglBindTexImageARB(HPBUFFERARB hPbuffer, int iBuf
}
if
(
!
use_render_texture_ati
&&
1
==
use_render_texture_emulation
)
{
void
*
buf
;
static
int
init
=
0
;
int
prev_binded_texture
=
0
;
GLXContext
prev_context
=
pglXGetCurrentContext
();
Drawable
prev_drawable
=
pglXGetCurrentDrawable
();
GLXContext
tmp_context
;
...
...
@@ -2751,25 +2753,22 @@ static GLboolean WINAPI X11DRV_wglBindTexImageARB(HPBUFFERARB hPbuffer, int iBuf
FIXME
(
"partial stub!
\n
"
);
}
buf
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
object
->
texture_bpp
*
object
->
width
*
object
->
height
);
if
(
!
buf
)
{
ERR
(
"Unable to allocate a buffer for render_texture emulation
\n
"
);
return
GL_FALSE
;
}
TRACE
(
"drawable=%p, context=%p
\n
"
,
(
void
*
)
object
->
drawable
,
prev_context
);
tmp_context
=
pglXCreateNewContext
(
gdi_display
,
object
->
fmt
->
fbconfig
,
object
->
fmt
->
render_type
,
NULL
,
True
);
tmp_context
=
pglXCreateNewContext
(
gdi_display
,
object
->
fmt
->
fbconfig
,
object
->
fmt
->
render_type
,
prev_context
,
True
);
pglGetIntegerv
(
object
->
texture_bind_target
,
&
prev_binded_texture
);
/* Switch to our pbuffer
and readback its contents
*/
/* Switch to our pbuffer */
pglXMakeCurrent
(
gdi_display
,
object
->
drawable
,
tmp_context
);
pglReadPixels
(
0
,
0
,
object
->
width
,
object
->
height
,
object
->
texture_format
,
object
->
texture_type
,
buf
);
/* Make sure that the prev_binded_texture is set as the current texture state isn't shared between contexts.
* After that upload the pbuffer texture data. */
pglBindTexture
(
object
->
texture_target
,
prev_binded_texture
);
pglCopyTexImage2D
(
object
->
texture_target
,
0
,
object
->
use_render_texture
,
0
,
0
,
object
->
width
,
object
->
height
,
0
);
/* Switch back to the original drawable and upload the pbuffer-texture */
pglXMakeCurrent
(
object
->
display
,
prev_drawable
,
prev_context
);
pglTexImage2D
(
object
->
texture_target
,
0
,
object
->
use_render_texture
,
object
->
width
,
object
->
height
,
0
,
object
->
texture_format
,
object
->
texture_type
,
buf
);
pglXDestroyContext
(
gdi_display
,
tmp_context
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
return
GL_TRUE
;
}
...
...
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