Hash :
3960e63b
Author :
Date :
2022-08-09T14:02:59
Infra: Enable angle_deqp_gl46_tests on SwiftShader This change disables the WGL frontend by default on Windows when building ANGLE for desktop GL. This is because the WGL frontend is not yet fully implemented and it causes some of the trace tests to fail. The WGL frontend should be enabled by default on windows when more of its functionality gets implemented. Test: angle_deqp_gl46_tests --use-angle=swiftshader Bug: angleproject:7566 Bug: angleproject:7628 Change-Id: I69c695eb56d3858f715eeb86d28cc805e25c60eb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3858142 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
//
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// gl_enum_utils.cpp:
// Utility functions for converting GLenums to string.
#include "libANGLE/capture/gl_enum_utils.h"
#include "common/bitset_utils.h"
#include <iomanip>
#include <sstream>
namespace gl
{
namespace
{
template <typename EnumType>
void OutputGLenumStringImpl(std::ostream &out, EnumType enumGroup, unsigned int value)
{
const char *enumStr = GLenumToString(enumGroup, value);
if (enumStr != kUnknownGLenumString)
{
out << enumStr;
return;
}
if (enumGroup == EnumType::Boolean)
{
// If an unknown enum was submitted as GLboolean, just write out the value.
if (enumStr == kUnknownGLenumString)
{
out << value;
}
else
{
out << enumStr;
}
return;
}
if (enumGroup != EnumType::AllEnums)
{
// Retry with the "Default" group
enumStr = GLenumToString(EnumType::AllEnums, value);
if (enumStr != kUnknownGLenumString)
{
out << enumStr;
return;
}
}
out << std::hex << "0x" << std::setfill('0') << std::setw(4) << value << std::dec;
}
template <typename EnumType>
std::string GLbitfieldToStringImpl(EnumType enumGroup, unsigned int value)
{
std::stringstream st;
if (value == 0)
{
return "0";
}
const angle::BitSet<32> bitSet(value);
bool first = true;
for (const auto index : bitSet)
{
if (!first)
{
st << " | ";
}
first = false;
unsigned int mask = 1u << index;
OutputGLenumString(st, enumGroup, mask);
}
return st.str();
}
} // namespace
const char kUnknownGLenumString[] = "EnumUnknown";
void OutputGLenumString(std::ostream &out, GLESEnum enumGroup, unsigned int value)
{
return OutputGLenumStringImpl(out, enumGroup, value);
}
void OutputGLenumString(std::ostream &out, BigGLEnum enumGroup, unsigned int value)
{
return OutputGLenumStringImpl(out, enumGroup, value);
}
void OutputGLbitfieldString(std::ostream &out, GLESEnum enumGroup, unsigned int value)
{
out << GLbitfieldToString(enumGroup, value);
}
const char *GLbooleanToString(unsigned int value)
{
return GLenumToString(GLESEnum::Boolean, value);
}
std::string GLbitfieldToString(GLESEnum enumGroup, unsigned int value)
{
return GLbitfieldToStringImpl(enumGroup, value);
}
std::string GLbitfieldToString(BigGLEnum enumGroup, unsigned int value)
{
return GLbitfieldToStringImpl(enumGroup, value);
}
const char *GLinternalFormatToString(unsigned int format)
{
return GLenumToString(gl::GLESEnum::InternalFormat, format);
}
} // namespace gl