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
8a107bc6
Commit
8a107bc6
authored
Mar 14, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 15, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Kill pbuffer offscreen rendering support.
Our pbuffer support is broken, nobody cares.
parent
a8b76781
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
19 additions
and
95 deletions
+19
-95
context.c
dlls/wined3d/context.c
+0
-0
device.c
dlls/wined3d/device.c
+1
-16
directx.c
dlls/wined3d/directx.c
+12
-34
surface.c
dlls/wined3d/surface.c
+0
-2
swapchain.c
dlls/wined3d/swapchain.c
+3
-3
wined3d_gl.h
dlls/wined3d/wined3d_gl.h
+0
-26
wined3d_main.c
dlls/wined3d/wined3d_main.c
+0
-5
wined3d_private.h
dlls/wined3d/wined3d_private.h
+3
-9
No files found.
dlls/wined3d/context.c
View file @
8a107bc6
This diff is collapsed.
Click to expand it.
dlls/wined3d/device.c
View file @
8a107bc6
...
...
@@ -1583,10 +1583,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface,
This
->
offscreenBuffer
=
GL_COLOR_ATTACHMENT0
;
break
;
case
ORM_PBUFFER
:
This
->
offscreenBuffer
=
GL_BACK
;
break
;
case
ORM_BACKBUFFER
:
{
if
(
context_get_current
()
->
aux_buffers
>
0
)
...
...
@@ -1720,9 +1716,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface,
}
}
/* Delete the pbuffer context if there is any */
if
(
This
->
pbufferContext
)
context_destroy
(
This
,
This
->
pbufferContext
);
/* Delete the mouse cursor texture */
if
(
This
->
cursorTexture
)
{
ENTER_GL
();
...
...
@@ -6387,7 +6380,7 @@ HRESULT create_primary_opengl_context(IWineD3DDevice *iface, IWineD3DSwapChain *
}
target
=
(
IWineD3DSurfaceImpl
*
)(
swapchain
->
backBuffer
?
swapchain
->
backBuffer
[
0
]
:
swapchain
->
frontBuffer
);
context
=
context_create
(
This
,
target
,
swapchain
->
win_handle
,
FALSE
,
&
swapchain
->
presentParms
);
context
=
context_create
(
This
,
target
,
swapchain
->
win_handle
,
&
swapchain
->
presentParms
);
if
(
!
context
)
{
WARN
(
"Failed to create context.
\n
"
);
...
...
@@ -7090,14 +7083,6 @@ void IWineD3DDeviceImpl_MarkStateDirty(IWineD3DDeviceImpl *This, DWORD state) {
}
}
void
get_drawable_size_pbuffer
(
struct
wined3d_context
*
context
,
UINT
*
width
,
UINT
*
height
)
{
IWineD3DDeviceImpl
*
device
=
((
IWineD3DSurfaceImpl
*
)
context
->
current_rt
)
->
resource
.
device
;
/* The drawable size of a pbuffer render target is the current pbuffer size. */
*
width
=
device
->
pbufferWidth
;
*
height
=
device
->
pbufferHeight
;
}
void
get_drawable_size_fbo
(
struct
wined3d_context
*
context
,
UINT
*
width
,
UINT
*
height
)
{
IWineD3DSurfaceImpl
*
surface
=
(
IWineD3DSurfaceImpl
*
)
context
->
current_rt
;
...
...
dlls/wined3d/directx.c
View file @
8a107bc6
...
...
@@ -2522,10 +2522,6 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_adapter *adapter)
ThisExtn
[
len
]
=
'\0'
;
TRACE_
(
d3d_caps
)(
"- %s
\n
"
,
debugstr_a
(
ThisExtn
));
if
(
!
strcmp
(
ThisExtn
,
"WGL_ARB_pbuffer"
))
{
gl_info
->
supported
[
WGL_ARB_PBUFFER
]
=
TRUE
;
TRACE_
(
d3d_caps
)(
"FOUND: WGL_ARB_pbuffer support
\n
"
);
}
if
(
!
strcmp
(
ThisExtn
,
"WGL_ARB_pixel_format"
))
{
gl_info
->
supported
[
WGL_ARB_PIXEL_FORMAT
]
=
TRUE
;
TRACE_
(
d3d_caps
)(
"FOUND: WGL_ARB_pixel_format support
\n
"
);
...
...
@@ -3204,23 +3200,9 @@ static BOOL CheckRenderTargetCapability(struct wined3d_adapter *adapter,
return
TRUE
;
}
}
}
else
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_PBUFFER
)
{
/* We can probably use this function in FBO mode too on some drivers to get some basic indication of the capabilities. */
WineD3D_PixelFormat
*
cfgs
=
adapter
->
cfgs
;
int
it
;
/* Check if there is a WGL pixel format matching the requirements, the pixel format should also be usable with pbuffers */
for
(
it
=
0
;
it
<
adapter
->
nCfgs
;
++
it
)
{
if
(
cfgs
[
it
].
pbufferDrawable
&&
IWineD3DImpl_IsPixelFormatCompatibleWithRenderFmt
(
&
adapter
->
gl_info
,
&
cfgs
[
it
],
check_format_desc
))
{
TRACE_
(
d3d_caps
)(
"iPixelFormat=%d is compatible with CheckFormat=%s
\n
"
,
cfgs
[
it
].
iPixelFormat
,
debug_d3dformat
(
check_format_desc
->
format
));
return
TRUE
;
}
}
}
else
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
){
else
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
{
/* For now return TRUE for FBOs until we have some proper checks.
* Note that this function will only be called when the format is around for texturing. */
return
TRUE
;
...
...
@@ -5120,17 +5102,6 @@ BOOL InitAdapters(IWineD3DImpl *This)
cfgs
->
doubleBuffer
=
values
[
9
];
cfgs
->
auxBuffers
=
values
[
10
];
cfgs
->
pbufferDrawable
=
FALSE
;
/* Check for pbuffer support when it is around as
* wglGetPixelFormatAttribiv fails for unknown attributes. */
if
(
gl_info
->
supported
[
WGL_ARB_PBUFFER
])
{
int
attrib
=
WGL_DRAW_TO_PBUFFER_ARB
;
int
value
;
if
(
GL_EXTCALL
(
wglGetPixelFormatAttribivARB
(
hdc
,
iPixelFormat
,
0
,
1
,
&
attrib
,
&
value
)))
cfgs
->
pbufferDrawable
=
value
;
}
cfgs
->
numSamples
=
0
;
/* Check multisample support */
if
(
gl_info
->
supported
[
ARB_MULTISAMPLE
])
...
...
@@ -5145,7 +5116,11 @@ BOOL InitAdapters(IWineD3DImpl *This)
}
}
TRACE
(
"iPixelFormat=%d, iPixelType=%#x, doubleBuffer=%d, RGBA=%d/%d/%d/%d, depth=%d, stencil=%d, samples=%d, windowDrawable=%d, pbufferDrawable=%d
\n
"
,
cfgs
->
iPixelFormat
,
cfgs
->
iPixelType
,
cfgs
->
doubleBuffer
,
cfgs
->
redSize
,
cfgs
->
greenSize
,
cfgs
->
blueSize
,
cfgs
->
alphaSize
,
cfgs
->
depthSize
,
cfgs
->
stencilSize
,
cfgs
->
numSamples
,
cfgs
->
windowDrawable
,
cfgs
->
pbufferDrawable
);
TRACE
(
"iPixelFormat=%d, iPixelType=%#x, doubleBuffer=%d, RGBA=%d/%d/%d/%d, "
"depth=%d, stencil=%d, samples=%d, windowDrawable=%d
\n
"
,
cfgs
->
iPixelFormat
,
cfgs
->
iPixelType
,
cfgs
->
doubleBuffer
,
cfgs
->
redSize
,
cfgs
->
greenSize
,
cfgs
->
blueSize
,
cfgs
->
alphaSize
,
cfgs
->
depthSize
,
cfgs
->
stencilSize
,
cfgs
->
numSamples
,
cfgs
->
windowDrawable
);
cfgs
++
;
}
}
...
...
@@ -5182,14 +5157,17 @@ BOOL InitAdapters(IWineD3DImpl *This)
cfgs
->
colorSize
=
ppfd
.
cColorBits
;
cfgs
->
depthSize
=
ppfd
.
cDepthBits
;
cfgs
->
stencilSize
=
ppfd
.
cStencilBits
;
cfgs
->
pbufferDrawable
=
0
;
cfgs
->
windowDrawable
=
(
ppfd
.
dwFlags
&
PFD_DRAW_TO_WINDOW
)
?
1
:
0
;
cfgs
->
iPixelType
=
(
ppfd
.
iPixelType
==
PFD_TYPE_RGBA
)
?
WGL_TYPE_RGBA_ARB
:
WGL_TYPE_COLORINDEX_ARB
;
cfgs
->
doubleBuffer
=
(
ppfd
.
dwFlags
&
PFD_DOUBLEBUFFER
)
?
1
:
0
;
cfgs
->
auxBuffers
=
ppfd
.
cAuxBuffers
;
cfgs
->
numSamples
=
0
;
TRACE
(
"iPixelFormat=%d, iPixelType=%#x, doubleBuffer=%d, RGBA=%d/%d/%d/%d, depth=%d, stencil=%d, windowDrawable=%d, pbufferDrawable=%d
\n
"
,
cfgs
->
iPixelFormat
,
cfgs
->
iPixelType
,
cfgs
->
doubleBuffer
,
cfgs
->
redSize
,
cfgs
->
greenSize
,
cfgs
->
blueSize
,
cfgs
->
alphaSize
,
cfgs
->
depthSize
,
cfgs
->
stencilSize
,
cfgs
->
windowDrawable
,
cfgs
->
pbufferDrawable
);
TRACE
(
"iPixelFormat=%d, iPixelType=%#x, doubleBuffer=%d, RGBA=%d/%d/%d/%d, "
"depth=%d, stencil=%d, windowDrawable=%d
\n
"
,
cfgs
->
iPixelFormat
,
cfgs
->
iPixelType
,
cfgs
->
doubleBuffer
,
cfgs
->
redSize
,
cfgs
->
greenSize
,
cfgs
->
blueSize
,
cfgs
->
alphaSize
,
cfgs
->
depthSize
,
cfgs
->
stencilSize
,
cfgs
->
windowDrawable
);
cfgs
++
;
adapter
->
nCfgs
++
;
}
...
...
dlls/wined3d/surface.c
View file @
8a107bc6
...
...
@@ -4458,7 +4458,6 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_PrivateSetup(IWineD3DSurface *iface) {
if
(
This
->
resource
.
usage
&
WINED3DUSAGE_RENDERTARGET
)
{
switch
(
wined3d_settings
.
offscreen_rendering_mode
)
{
case
ORM_FBO
:
This
->
get_drawable_size
=
get_drawable_size_fbo
;
break
;
case
ORM_PBUFFER
:
This
->
get_drawable_size
=
get_drawable_size_pbuffer
;
break
;
case
ORM_BACKBUFFER
:
This
->
get_drawable_size
=
get_drawable_size_backbuffer
;
break
;
}
}
...
...
@@ -5056,7 +5055,6 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_SetContainer(IWineD3DSurface *iface, I
}
else
if
(
This
->
resource
.
usage
&
WINED3DUSAGE_RENDERTARGET
)
{
switch
(
wined3d_settings
.
offscreen_rendering_mode
)
{
case
ORM_FBO
:
This
->
get_drawable_size
=
get_drawable_size_fbo
;
break
;
case
ORM_PBUFFER
:
This
->
get_drawable_size
=
get_drawable_size_pbuffer
;
break
;
case
ORM_BACKBUFFER
:
This
->
get_drawable_size
=
get_drawable_size_backbuffer
;
break
;
}
}
...
...
dlls/wined3d/swapchain.c
View file @
8a107bc6
...
...
@@ -547,7 +547,7 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_SetDestWindowOverride(IWineD3DSwapCh
context_destroy
(
This
->
device
,
This
->
context
[
0
]);
This
->
context
[
0
]
=
context_create
(
This
->
device
,
(
IWineD3DSurfaceImpl
*
)
This
->
frontBuffer
,
This
->
win_handle
,
FALSE
/* pbuffer */
,
&
This
->
presentParms
);
This
->
win_handle
,
&
This
->
presentParms
);
context_release
(
This
->
context
[
0
]);
IWineD3DSurface_LockRect
(
This
->
backBuffer
[
0
],
&
r
,
NULL
,
WINED3DLOCK_DISCARD
);
...
...
@@ -817,7 +817,7 @@ HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface
if
(
surface_type
==
SURFACE_OPENGL
)
{
swapchain
->
context
[
0
]
=
context_create
(
device
,
(
IWineD3DSurfaceImpl
*
)
swapchain
->
frontBuffer
,
window
,
FALSE
/* pbuffer */
,
present_parameters
);
window
,
present_parameters
);
if
(
!
swapchain
->
context
[
0
])
{
WARN
(
"Failed to create context.
\n
"
);
...
...
@@ -936,7 +936,7 @@ struct wined3d_context *swapchain_create_context_for_thread(IWineD3DSwapChain *i
TRACE
(
"Creating a new context for swapchain %p, thread %d
\n
"
,
This
,
GetCurrentThreadId
());
ctx
=
context_create
(
This
->
device
,
(
IWineD3DSurfaceImpl
*
)
This
->
frontBuffer
,
This
->
context
[
0
]
->
win_handle
,
FALSE
/* pbuffer */
,
&
This
->
presentParms
);
This
->
context
[
0
]
->
win_handle
,
&
This
->
presentParms
);
if
(
!
ctx
)
{
ERR
(
"Failed to create a new context for the swapchain
\n
"
);
...
...
dlls/wined3d/wined3d_gl.h
View file @
8a107bc6
...
...
@@ -1829,7 +1829,6 @@ typedef enum wined3d_gl_extension
SGIS_GENERATE_MIPMAP
,
SGI_VIDEO_SYNC
,
/* WGL extensions */
WGL_ARB_PBUFFER
,
WGL_ARB_PIXEL_FORMAT
,
WGL_WINE_PIXEL_FORMAT_PASSTHROUGH
,
/* Internally used */
...
...
@@ -3680,26 +3679,6 @@ typedef const char *(WINAPI *WINED3D_PFNWGLGETEXTENSIONSSTRINGARBPROC)(HDC hdc);
#define WGL_SAMPLES_ARB 0x2042
#endif
/* WGL_ARB_pbuffer */
#ifndef WGL_ARB_pbuffer
#define WGL_ARB_pbuffer 1
#define WGL_DRAW_TO_PBUFFER_ARB 0x202d
#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202e
#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202f
#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
#define WGL_PBUFFER_LARGEST_ARB 0x2033
#define WGL_PBUFFER_WIDTH_ARB 0x2034
#define WGL_PBUFFER_HEIGHT_ARB 0x2035
#define WGL_PBUFFER_LOST_ARB 0x2036
#endif
DECLARE_HANDLE
(
HPBUFFERARB
);
typedef
HPBUFFERARB
(
WINAPI
*
WINED3D_PFNWGLCREATEPBUFFERARBPROC
)(
HDC
hDC
,
int
iPixelFormat
,
int
iWidth
,
int
iHeight
,
const
int
*
piAttribList
);
typedef
HDC
(
WINAPI
*
WINED3D_PFNWGLGETPBUFFERDCARBPROC
)(
HPBUFFERARB
hPbuffer
);
typedef
int
(
WINAPI
*
WINED3D_PFNWGLRELEASEPBUFFERDCARBPROC
)(
HPBUFFERARB
hPbuffer
,
HDC
hDC
);
typedef
BOOL
(
WINAPI
*
WINED3D_PFNWGLDESTROYPBUFFERARBPROC
)(
HPBUFFERARB
hPbuffer
);
typedef
BOOL
(
WINAPI
*
WINED3D_PFNWGLQUERYPBUFFERARBPROC
)(
HPBUFFERARB
hPbuffer
,
int
iAttribute
,
int
*
piValue
);
/* WGL_ARB_pixel_format */
#ifndef WGL_ARB_pixel_format
#define WGL_ARB_pixel_format 1
...
...
@@ -4489,11 +4468,6 @@ typedef BOOL (WINAPI *WINED3D_PFNWGLSETPIXELFORMATWINE)(HDC hdc, int iPixelForma
USE_GL_FUNC(WINED3D_PFNWGLGETPIXELFORMATATTRIBIVARBPROC, wglGetPixelFormatAttribivARB, 0, NULL) \
USE_GL_FUNC(WINED3D_PFNWGLGETPIXELFORMATATTRIBFVARBPROC, wglGetPixelFormatAttribfvARB, 0, NULL) \
USE_GL_FUNC(WINED3D_PFNWGLCHOOSEPIXELFORMATARBPROC, wglChoosePixelFormatARB, 0, NULL) \
USE_GL_FUNC(WINED3D_PFNWGLCREATEPBUFFERARBPROC, wglCreatePbufferARB, 0, NULL) \
USE_GL_FUNC(WINED3D_PFNWGLGETPBUFFERDCARBPROC, wglGetPbufferDCARB, 0, NULL) \
USE_GL_FUNC(WINED3D_PFNWGLRELEASEPBUFFERDCARBPROC, wglReleasePbufferDCARB, 0, NULL) \
USE_GL_FUNC(WINED3D_PFNWGLDESTROYPBUFFERARBPROC, wglDestroyPbufferARB, 0, NULL) \
USE_GL_FUNC(WINED3D_PFNWGLQUERYPBUFFERARBPROC, wglQueryPbufferARB, 0, NULL) \
USE_GL_FUNC(WINED3D_PFNWGLSETPIXELFORMATWINE, wglSetPixelFormatWINE, 0, NULL)
#endif
/* __WINE_WINED3D_GL */
dlls/wined3d/wined3d_main.c
View file @
8a107bc6
...
...
@@ -236,11 +236,6 @@ static BOOL wined3d_init(HINSTANCE hInstDLL)
TRACE
(
"Using the backbuffer for offscreen rendering
\n
"
);
wined3d_settings
.
offscreen_rendering_mode
=
ORM_BACKBUFFER
;
}
else
if
(
!
strcmp
(
buffer
,
"pbuffer"
))
{
TRACE
(
"Using PBuffers for offscreen rendering
\n
"
);
wined3d_settings
.
offscreen_rendering_mode
=
ORM_PBUFFER
;
}
else
if
(
!
strcmp
(
buffer
,
"fbo"
))
{
TRACE
(
"Using FBOs for offscreen rendering
\n
"
);
...
...
dlls/wined3d/wined3d_private.h
View file @
8a107bc6
...
...
@@ -234,8 +234,7 @@ static inline float float_24_to_32(DWORD in)
#define VBO_HW 1
#define ORM_BACKBUFFER 0
#define ORM_PBUFFER 1
#define ORM_FBO 2
#define ORM_FBO 1
#define SHADER_ARB 1
#define SHADER_GLSL 2
...
...
@@ -1089,7 +1088,6 @@ struct wined3d_context
HGLRC
glCtx
;
HWND
win_handle
;
HDC
hdc
;
HPBUFFERARB
pbuffer
;
GLint
aux_buffers
;
/* FBOs */
...
...
@@ -1201,8 +1199,8 @@ void context_attach_depth_stencil_fbo(struct wined3d_context *context,
GLenum
fbo_target
,
IWineD3DSurface
*
depth_stencil
,
BOOL
use_render_buffer
)
DECLSPEC_HIDDEN
;
void
context_attach_surface_fbo
(
const
struct
wined3d_context
*
context
,
GLenum
fbo_target
,
DWORD
idx
,
IWineD3DSurface
*
surface
)
DECLSPEC_HIDDEN
;
struct
wined3d_context
*
context_create
(
IWineD3DDeviceImpl
*
This
,
IWineD3DSurfaceImpl
*
target
,
HWND
win
,
BOOL
create_pbuffer
,
const
WINED3DPRESENT_PARAMETERS
*
present_parameters
)
DECLSPEC_HIDDEN
;
struct
wined3d_context
*
context_create
(
IWineD3DDeviceImpl
*
This
,
IWineD3DSurfaceImpl
*
target
,
HWND
win
,
const
WINED3DPRESENT_PARAMETERS
*
present_parameters
)
DECLSPEC_HIDDEN
;
void
context_destroy
(
IWineD3DDeviceImpl
*
This
,
struct
wined3d_context
*
context
)
DECLSPEC_HIDDEN
;
void
context_free_event_query
(
struct
wined3d_event_query
*
query
)
DECLSPEC_HIDDEN
;
void
context_free_occlusion_query
(
struct
wined3d_occlusion_query
*
query
)
DECLSPEC_HIDDEN
;
...
...
@@ -1251,7 +1249,6 @@ typedef struct WineD3D_PixelFormat
int
redSize
,
greenSize
,
blueSize
,
alphaSize
,
colorSize
;
int
depthSize
,
stencilSize
;
BOOL
windowDrawable
;
BOOL
pbufferDrawable
;
BOOL
doubleBuffer
;
int
auxBuffers
;
int
numSamples
;
...
...
@@ -1705,8 +1702,6 @@ struct IWineD3DDeviceImpl
/* Context management */
struct
wined3d_context
**
contexts
;
UINT
numContexts
;
struct
wined3d_context
*
pbufferContext
;
/* The context that has a pbuffer as drawable */
DWORD
pbufferWidth
,
pbufferHeight
;
/* Size of the buffer drawable */
/* High level patch management */
#define PATCHMAP_SIZE 43
...
...
@@ -2153,7 +2148,6 @@ const void *WINAPI IWineD3DBaseSurfaceImpl_GetData(IWineD3DSurface *iface) DECLS
void
get_drawable_size_swapchain
(
struct
wined3d_context
*
context
,
UINT
*
width
,
UINT
*
height
)
DECLSPEC_HIDDEN
;
void
get_drawable_size_backbuffer
(
struct
wined3d_context
*
context
,
UINT
*
width
,
UINT
*
height
)
DECLSPEC_HIDDEN
;
void
get_drawable_size_pbuffer
(
struct
wined3d_context
*
context
,
UINT
*
width
,
UINT
*
height
)
DECLSPEC_HIDDEN
;
void
get_drawable_size_fbo
(
struct
wined3d_context
*
context
,
UINT
*
width
,
UINT
*
height
)
DECLSPEC_HIDDEN
;
void
flip_surface
(
IWineD3DSurfaceImpl
*
front
,
IWineD3DSurfaceImpl
*
back
)
DECLSPEC_HIDDEN
;
...
...
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