mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
wgl: Add no-gdi-single-buffered and gdi-double-buffered PFDs
Reviewed-by: Sil Vilerino <sivileri@microsoft.com> Reviewed-by: Jose Fonseca <jose.fonseca@broadcom.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27512>
This commit is contained in:
parent
610dcc178a
commit
c432fbe534
1 changed files with 20 additions and 29 deletions
|
|
@ -107,18 +107,12 @@ stw_pf_depth_stencil[] = {
|
|||
{ PIPE_FORMAT_S8_UINT_Z24_UNORM, {24, 8} }
|
||||
};
|
||||
|
||||
|
||||
static const bool
|
||||
stw_pf_doublebuffer[] = {
|
||||
false,
|
||||
true,
|
||||
};
|
||||
|
||||
|
||||
static const stw_pfd_flag
|
||||
stw_pf_flag[] = {
|
||||
0,
|
||||
stw_pfd_double_buffer,
|
||||
stw_pfd_gdi_support,
|
||||
stw_pfd_double_buffer | stw_pfd_gdi_support,
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -247,7 +241,7 @@ add_color_format_variants(const struct stw_pf_color_info *color_formats,
|
|||
unsigned num_color_formats, bool extended)
|
||||
{
|
||||
struct pipe_screen *screen = stw_dev->screen;
|
||||
unsigned cfmt, ms, db, ds, acc, f;
|
||||
unsigned cfmt, ms, ds, acc, f;
|
||||
unsigned bind_flags = PIPE_BIND_RENDER_TARGET;
|
||||
unsigned num_added = 0;
|
||||
int force_samples = 0;
|
||||
|
|
@ -292,29 +286,26 @@ add_color_format_variants(const struct stw_pf_color_info *color_formats,
|
|||
continue;
|
||||
}
|
||||
|
||||
for (db = 0; db < ARRAY_SIZE(stw_pf_doublebuffer); db++) {
|
||||
unsigned doublebuffer = stw_pf_doublebuffer[db];
|
||||
for (ds = 0; ds < ARRAY_SIZE(stw_pf_depth_stencil); ds++) {
|
||||
const struct stw_pf_depth_info *depth = &stw_pf_depth_stencil[ds];
|
||||
|
||||
for (ds = 0; ds < ARRAY_SIZE(stw_pf_depth_stencil); ds++) {
|
||||
const struct stw_pf_depth_info *depth = &stw_pf_depth_stencil[ds];
|
||||
if (!screen->is_format_supported(screen, depth->format,
|
||||
PIPE_TEXTURE_2D, samples,
|
||||
samples,
|
||||
PIPE_BIND_DEPTH_STENCIL)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!screen->is_format_supported(screen, depth->format,
|
||||
PIPE_TEXTURE_2D, samples,
|
||||
samples,
|
||||
PIPE_BIND_DEPTH_STENCIL)) {
|
||||
for (f = 0; f < ARRAY_SIZE(stw_pf_flag); f++) {
|
||||
stw_pfd_flag flag = stw_pf_flag[f];
|
||||
if ((supported_flags & flag) != flag)
|
||||
continue;
|
||||
}
|
||||
|
||||
for (f = 0; f < ARRAY_SIZE(stw_pf_flag); f++) {
|
||||
stw_pfd_flag flag = stw_pf_flag[f];
|
||||
if (!(supported_flags & flag) || (flag == stw_pfd_double_buffer && !doublebuffer))
|
||||
continue;
|
||||
for (acc = 0; acc < 2; acc++) {
|
||||
stw_pixelformat_add(stw_dev, extended, &color_formats[cfmt],
|
||||
depth, acc * 16, doublebuffer,
|
||||
(flag == stw_pfd_gdi_support), samples);
|
||||
num_added++;
|
||||
}
|
||||
for (acc = 0; acc < 2; acc++) {
|
||||
stw_pixelformat_add(stw_dev, extended, &color_formats[cfmt],
|
||||
depth, acc * 16,
|
||||
(flag & stw_pfd_double_buffer) != 0,
|
||||
(flag == stw_pfd_gdi_support) != 0, samples);
|
||||
num_added++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue