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
55714223
Commit
55714223
authored
Mar 21, 2024
by
Alexandros Frantzis
Committed by
Alexandre Julliard
Apr 24, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winewayland.drv: Enable wglDescribePixelFormat through p_get_pixel_formats.
parent
ab70da6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
58 deletions
+63
-58
opengl.c
dlls/winewayland.drv/opengl.c
+63
-58
No files found.
dlls/winewayland.drv/opengl.c
View file @
55714223
...
@@ -544,63 +544,6 @@ static BOOL wayland_wglDeleteContext(struct wgl_context *ctx)
...
@@ -544,63 +544,6 @@ static BOOL wayland_wglDeleteContext(struct wgl_context *ctx)
return
TRUE
;
return
TRUE
;
}
}
static
BOOL
has_opengl
(
void
);
static
int
wayland_wglDescribePixelFormat
(
HDC
hdc
,
int
fmt
,
UINT
size
,
PIXELFORMATDESCRIPTOR
*
pfd
)
{
EGLint
val
;
EGLConfig
config
;
if
(
!
has_opengl
())
return
0
;
if
(
!
pfd
)
return
num_egl_configs
;
if
(
size
<
sizeof
(
*
pfd
))
return
0
;
if
(
fmt
<=
0
||
fmt
>
num_egl_configs
)
return
0
;
config
=
egl_configs
[
fmt
-
1
];
memset
(
pfd
,
0
,
sizeof
(
*
pfd
));
pfd
->
nSize
=
sizeof
(
*
pfd
);
pfd
->
nVersion
=
1
;
pfd
->
dwFlags
=
PFD_SUPPORT_OPENGL
|
PFD_DRAW_TO_WINDOW
|
PFD_DOUBLEBUFFER
|
PFD_SUPPORT_COMPOSITION
;
pfd
->
iPixelType
=
PFD_TYPE_RGBA
;
pfd
->
iLayerType
=
PFD_MAIN_PLANE
;
/* Although the documentation describes cColorBits as excluding alpha, real
* drivers tend to return the full pixel size, so do the same. */
p_eglGetConfigAttrib
(
egl_display
,
config
,
EGL_BUFFER_SIZE
,
&
val
);
pfd
->
cColorBits
=
val
;
p_eglGetConfigAttrib
(
egl_display
,
config
,
EGL_RED_SIZE
,
&
val
);
pfd
->
cRedBits
=
val
;
p_eglGetConfigAttrib
(
egl_display
,
config
,
EGL_GREEN_SIZE
,
&
val
);
pfd
->
cGreenBits
=
val
;
p_eglGetConfigAttrib
(
egl_display
,
config
,
EGL_BLUE_SIZE
,
&
val
);
pfd
->
cBlueBits
=
val
;
p_eglGetConfigAttrib
(
egl_display
,
config
,
EGL_ALPHA_SIZE
,
&
val
);
pfd
->
cAlphaBits
=
val
;
p_eglGetConfigAttrib
(
egl_display
,
config
,
EGL_DEPTH_SIZE
,
&
val
);
pfd
->
cDepthBits
=
val
;
p_eglGetConfigAttrib
(
egl_display
,
config
,
EGL_STENCIL_SIZE
,
&
val
);
pfd
->
cStencilBits
=
val
;
/* Although we don't get information from EGL about the component shifts
* or the native format, the 0xARGB order is the most common. */
pfd
->
cBlueShift
=
0
;
pfd
->
cGreenShift
=
pfd
->
cBlueBits
;
pfd
->
cRedShift
=
pfd
->
cGreenBits
+
pfd
->
cBlueBits
;
if
(
pfd
->
cAlphaBits
)
pfd
->
cAlphaShift
=
pfd
->
cRedBits
+
pfd
->
cGreenBits
+
pfd
->
cBlueBits
;
else
pfd
->
cAlphaShift
=
0
;
TRACE
(
"fmt %u color %u %u/%u/%u/%u depth %u stencil %u
\n
"
,
fmt
,
pfd
->
cColorBits
,
pfd
->
cRedBits
,
pfd
->
cGreenBits
,
pfd
->
cBlueBits
,
pfd
->
cAlphaBits
,
pfd
->
cDepthBits
,
pfd
->
cStencilBits
);
return
num_egl_configs
;
}
static
const
char
*
wayland_wglGetExtensionsStringARB
(
HDC
hdc
)
static
const
char
*
wayland_wglGetExtensionsStringARB
(
HDC
hdc
)
{
{
TRACE
(
"() returning
\"
%s
\"\n
"
,
wgl_extensions
);
TRACE
(
"() returning
\"
%s
\"\n
"
,
wgl_extensions
);
...
@@ -762,6 +705,68 @@ static BOOL wayland_wglSwapIntervalEXT(int interval)
...
@@ -762,6 +705,68 @@ static BOOL wayland_wglSwapIntervalEXT(int interval)
return
ret
;
return
ret
;
}
}
static
void
describe_pixel_format
(
EGLConfig
config
,
struct
wgl_pixel_format
*
fmt
)
{
EGLint
value
;
PIXELFORMATDESCRIPTOR
*
pfd
=
&
fmt
->
pfd
;
memset
(
pfd
,
0
,
sizeof
(
*
pfd
));
pfd
->
nSize
=
sizeof
(
*
pfd
);
pfd
->
nVersion
=
1
;
pfd
->
dwFlags
=
PFD_SUPPORT_OPENGL
|
PFD_DRAW_TO_WINDOW
|
PFD_DOUBLEBUFFER
|
PFD_SUPPORT_COMPOSITION
;
pfd
->
iPixelType
=
PFD_TYPE_RGBA
;
pfd
->
iLayerType
=
PFD_MAIN_PLANE
;
#define SET_ATTRIB(field, attrib) \
value = 0; \
p_eglGetConfigAttrib(egl_display, config, attrib, &value); \
pfd->field = value;
/* Although the documentation describes cColorBits as excluding alpha, real
* drivers tend to return the full pixel size, so do the same. */
SET_ATTRIB
(
cColorBits
,
EGL_BUFFER_SIZE
);
SET_ATTRIB
(
cRedBits
,
EGL_RED_SIZE
);
SET_ATTRIB
(
cGreenBits
,
EGL_GREEN_SIZE
);
SET_ATTRIB
(
cBlueBits
,
EGL_BLUE_SIZE
);
SET_ATTRIB
(
cAlphaBits
,
EGL_ALPHA_SIZE
);
/* Although we don't get information from EGL about the component shifts
* or the native format, the 0xARGB order is the most common. */
pfd
->
cBlueShift
=
0
;
pfd
->
cGreenShift
=
pfd
->
cBlueBits
;
pfd
->
cRedShift
=
pfd
->
cGreenBits
+
pfd
->
cBlueBits
;
if
(
pfd
->
cAlphaBits
)
pfd
->
cAlphaShift
=
pfd
->
cRedBits
+
pfd
->
cGreenBits
+
pfd
->
cBlueBits
;
else
pfd
->
cAlphaShift
=
0
;
SET_ATTRIB
(
cDepthBits
,
EGL_DEPTH_SIZE
);
SET_ATTRIB
(
cStencilBits
,
EGL_STENCIL_SIZE
);
#undef SET_ATTRIB
}
static
BOOL
has_opengl
(
void
);
static
void
wayland_get_pixel_formats
(
struct
wgl_pixel_format
*
formats
,
UINT
max_formats
,
UINT
*
num_formats
,
UINT
*
num_onscreen_formats
)
{
UINT
i
;
if
(
!
has_opengl
())
{
*
num_formats
=
*
num_onscreen_formats
=
0
;
return
;
}
if
(
formats
)
{
for
(
i
=
0
;
i
<
min
(
max_formats
,
num_egl_configs
);
++
i
)
describe_pixel_format
(
egl_configs
[
i
],
&
formats
[
i
]);
}
*
num_formats
=
*
num_onscreen_formats
=
num_egl_configs
;
}
static
BOOL
has_extension
(
const
char
*
list
,
const
char
*
ext
)
static
BOOL
has_extension
(
const
char
*
list
,
const
char
*
ext
)
{
{
size_t
len
=
strlen
(
ext
);
size_t
len
=
strlen
(
ext
);
...
@@ -980,12 +985,12 @@ static struct opengl_funcs opengl_funcs =
...
@@ -980,12 +985,12 @@ static struct opengl_funcs opengl_funcs =
.
p_wglCopyContext
=
wayland_wglCopyContext
,
.
p_wglCopyContext
=
wayland_wglCopyContext
,
.
p_wglCreateContext
=
wayland_wglCreateContext
,
.
p_wglCreateContext
=
wayland_wglCreateContext
,
.
p_wglDeleteContext
=
wayland_wglDeleteContext
,
.
p_wglDeleteContext
=
wayland_wglDeleteContext
,
.
p_wglDescribePixelFormat
=
wayland_wglDescribePixelFormat
,
.
p_wglGetProcAddress
=
wayland_wglGetProcAddress
,
.
p_wglGetProcAddress
=
wayland_wglGetProcAddress
,
.
p_wglMakeCurrent
=
wayland_wglMakeCurrent
,
.
p_wglMakeCurrent
=
wayland_wglMakeCurrent
,
.
p_wglSetPixelFormat
=
wayland_wglSetPixelFormat
,
.
p_wglSetPixelFormat
=
wayland_wglSetPixelFormat
,
.
p_wglShareLists
=
wayland_wglShareLists
,
.
p_wglShareLists
=
wayland_wglShareLists
,
.
p_wglSwapBuffers
=
wayland_wglSwapBuffers
,
.
p_wglSwapBuffers
=
wayland_wglSwapBuffers
,
.
p_get_pixel_formats
=
wayland_get_pixel_formats
,
}
}
};
};
...
...
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