Run with latest clang-format.

This commit is contained in:
Ben Vanik 2015-07-15 22:44:30 -07:00
parent c3415e6332
commit f520d3a2a4
19 changed files with 307 additions and 318 deletions

View File

@ -162,7 +162,8 @@ inline WaitResult WaitAll(
WaitHandle* wait_handles[], size_t wait_handle_count, bool is_alertable, WaitHandle* wait_handles[], size_t wait_handle_count, bool is_alertable,
std::chrono::milliseconds timeout = std::chrono::milliseconds::max()) { std::chrono::milliseconds timeout = std::chrono::milliseconds::max()) {
return WaitMultiple(wait_handles, wait_handle_count, true, is_alertable, return WaitMultiple(wait_handles, wait_handle_count, true, is_alertable,
timeout).first; timeout)
.first;
} }
inline WaitResult WaitAll( inline WaitResult WaitAll(
std::vector<WaitHandle*> wait_handles, bool is_alertable, std::vector<WaitHandle*> wait_handles, bool is_alertable,

View File

@ -61,8 +61,8 @@ void set_name(DWORD thread_id, const std::string& name) {
__try { __try {
RaiseException(0x406D1388, 0, sizeof(info) / sizeof(ULONG_PTR), RaiseException(0x406D1388, 0, sizeof(info) / sizeof(ULONG_PTR),
reinterpret_cast<ULONG_PTR*>(&info)); reinterpret_cast<ULONG_PTR*>(&info));
} __except (EXCEPTION_EXECUTE_HANDLER) {
} }
__except(EXCEPTION_EXECUTE_HANDLER) {}
} }
void set_name(const std::string& name) { void set_name(const std::string& name) {

View File

@ -118,8 +118,7 @@ typedef struct {
uint32_t LK : 1; uint32_t LK : 1;
uint32_t AA : 1; uint32_t AA : 1;
uint32_t LI : 24; uint32_t LI : 24;
uint32_t: uint32_t : 6;
6;
} I; } I;
// kXEPPCInstrFormatB // kXEPPCInstrFormatB
struct { struct {
@ -128,8 +127,7 @@ typedef struct {
uint32_t BD : 14; uint32_t BD : 14;
uint32_t BI : 5; uint32_t BI : 5;
uint32_t BO : 5; uint32_t BO : 5;
uint32_t: uint32_t : 6;
6;
} B; } B;
// kXEPPCInstrFormatSC // kXEPPCInstrFormatSC
@ -138,87 +136,71 @@ typedef struct {
uint32_t DS : 16; uint32_t DS : 16;
uint32_t RA : 5; uint32_t RA : 5;
uint32_t RT : 5; uint32_t RT : 5;
uint32_t: uint32_t : 6;
6;
} D; } D;
// kXEPPCInstrFormatDS // kXEPPCInstrFormatDS
struct { struct {
uint32_t: uint32_t : 2;
2;
uint32_t DS : 14; uint32_t DS : 14;
uint32_t RA : 5; uint32_t RA : 5;
uint32_t RT : 5; uint32_t RT : 5;
uint32_t: uint32_t : 6;
6;
} DS; } DS;
// kXEPPCInstrFormatX // kXEPPCInstrFormatX
struct { struct {
uint32_t Rc : 1; uint32_t Rc : 1;
uint32_t: uint32_t : 10;
10;
uint32_t RB : 5; uint32_t RB : 5;
uint32_t RA : 5; uint32_t RA : 5;
uint32_t RT : 5; uint32_t RT : 5;
uint32_t: uint32_t : 6;
6;
} X; } X;
// kXEPPCInstrFormatXL // kXEPPCInstrFormatXL
struct { struct {
uint32_t LK : 1; uint32_t LK : 1;
uint32_t: uint32_t : 10;
10;
uint32_t BB : 5; uint32_t BB : 5;
uint32_t BI : 5; uint32_t BI : 5;
uint32_t BO : 5; uint32_t BO : 5;
uint32_t: uint32_t : 6;
6;
} XL; } XL;
// kXEPPCInstrFormatXFX // kXEPPCInstrFormatXFX
struct { struct {
uint32_t: uint32_t : 1;
1; uint32_t : 10;
uint32_t:
10;
uint32_t spr : 10; uint32_t spr : 10;
uint32_t RT : 5; uint32_t RT : 5;
uint32_t: uint32_t : 6;
6;
} XFX; } XFX;
// kXEPPCInstrFormatXFL // kXEPPCInstrFormatXFL
struct { struct {
uint32_t Rc : 1; uint32_t Rc : 1;
uint32_t: uint32_t : 10;
10;
uint32_t RB : 5; uint32_t RB : 5;
uint32_t W : 1; uint32_t W : 1;
uint32_t FM : 8; uint32_t FM : 8;
uint32_t L : 1; uint32_t L : 1;
uint32_t: uint32_t : 6;
6;
} XFL; } XFL;
// kXEPPCInstrFormatXS // kXEPPCInstrFormatXS
struct { struct {
uint32_t Rc : 1; uint32_t Rc : 1;
uint32_t SH5 : 1; uint32_t SH5 : 1;
uint32_t: uint32_t : 9;
9;
uint32_t SH : 5; uint32_t SH : 5;
uint32_t RA : 5; uint32_t RA : 5;
uint32_t RT : 5; uint32_t RT : 5;
uint32_t: uint32_t : 6;
6;
} XS; } XS;
// kXEPPCInstrFormatXO // kXEPPCInstrFormatXO
struct { struct {
uint32_t Rc : 1; uint32_t Rc : 1;
uint32_t: uint32_t : 9;
9;
uint32_t OE : 1; uint32_t OE : 1;
uint32_t RB : 5; uint32_t RB : 5;
uint32_t RA : 5; uint32_t RA : 5;
uint32_t RT : 5; uint32_t RT : 5;
uint32_t: uint32_t : 6;
6;
} XO; } XO;
// kXEPPCInstrFormatA // kXEPPCInstrFormatA
struct { struct {
@ -228,8 +210,7 @@ typedef struct {
uint32_t FRB : 5; uint32_t FRB : 5;
uint32_t FRA : 5; uint32_t FRA : 5;
uint32_t FRT : 5; uint32_t FRT : 5;
uint32_t: uint32_t : 6;
6;
} A; } A;
// kXEPPCInstrFormatM // kXEPPCInstrFormatM
struct { struct {
@ -239,8 +220,7 @@ typedef struct {
uint32_t SH : 5; uint32_t SH : 5;
uint32_t RA : 5; uint32_t RA : 5;
uint32_t RT : 5; uint32_t RT : 5;
uint32_t: uint32_t : 6;
6;
} M; } M;
// kXEPPCInstrFormatMD // kXEPPCInstrFormatMD
struct { struct {
@ -252,8 +232,7 @@ typedef struct {
uint32_t SH : 5; uint32_t SH : 5;
uint32_t RA : 5; uint32_t RA : 5;
uint32_t RT : 5; uint32_t RT : 5;
uint32_t: uint32_t : 6;
6;
} MD; } MD;
// kXEPPCInstrFormatMDS // kXEPPCInstrFormatMDS
struct { struct {
@ -264,40 +243,33 @@ typedef struct {
uint32_t RB : 5; uint32_t RB : 5;
uint32_t RA : 5; uint32_t RA : 5;
uint32_t RT : 5; uint32_t RT : 5;
uint32_t: uint32_t : 6;
6;
} MDS; } MDS;
// kXEPPCInstrFormatVXA // kXEPPCInstrFormatVXA
struct { struct {
uint32_t: uint32_t : 6;
6;
uint32_t VC : 5; uint32_t VC : 5;
uint32_t VB : 5; uint32_t VB : 5;
uint32_t VA : 5; uint32_t VA : 5;
uint32_t VD : 5; uint32_t VD : 5;
uint32_t: uint32_t : 6;
6;
} VXA; } VXA;
// kXEPPCInstrFormatVX // kXEPPCInstrFormatVX
struct { struct {
uint32_t: uint32_t : 11;
11;
uint32_t VB : 5; uint32_t VB : 5;
uint32_t VA : 5; uint32_t VA : 5;
uint32_t VD : 5; uint32_t VD : 5;
uint32_t: uint32_t : 6;
6;
} VX; } VX;
// kXEPPCInstrFormatVXR // kXEPPCInstrFormatVXR
struct { struct {
uint32_t: uint32_t : 10;
10;
uint32_t Rc : 1; uint32_t Rc : 1;
uint32_t VB : 5; uint32_t VB : 5;
uint32_t VA : 5; uint32_t VA : 5;
uint32_t VD : 5; uint32_t VD : 5;
uint32_t: uint32_t : 6;
6;
} VXR; } VXR;
// kXEPPCInstrFormatVX128 // kXEPPCInstrFormatVX128
struct { struct {
@ -306,31 +278,25 @@ typedef struct {
// VB128 = VB128l | (VB128h << 5) // VB128 = VB128l | (VB128h << 5)
uint32_t VB128h : 2; uint32_t VB128h : 2;
uint32_t VD128h : 2; uint32_t VD128h : 2;
uint32_t: uint32_t : 1;
1;
uint32_t VA128h : 1; uint32_t VA128h : 1;
uint32_t: uint32_t : 4;
4;
uint32_t VA128H : 1; uint32_t VA128H : 1;
uint32_t VB128l : 5; uint32_t VB128l : 5;
uint32_t VA128l : 5; uint32_t VA128l : 5;
uint32_t VD128l : 5; uint32_t VD128l : 5;
uint32_t: uint32_t : 6;
6;
} VX128; } VX128;
// kXEPPCInstrFormatVX128_1 // kXEPPCInstrFormatVX128_1
struct { struct {
// VD128 = VD128l | (VD128h << 5) // VD128 = VD128l | (VD128h << 5)
uint32_t: uint32_t : 2;
2;
uint32_t VD128h : 2; uint32_t VD128h : 2;
uint32_t: uint32_t : 7;
7;
uint32_t RB : 5; uint32_t RB : 5;
uint32_t RA : 5; uint32_t RA : 5;
uint32_t VD128l : 5; uint32_t VD128l : 5;
uint32_t: uint32_t : 6;
6;
} VX128_1; } VX128_1;
// kXEPPCInstrFormatVX128_2 // kXEPPCInstrFormatVX128_2
struct { struct {
@ -339,18 +305,15 @@ typedef struct {
// VB128 = VB128l | (VB128h << 5) // VB128 = VB128l | (VB128h << 5)
uint32_t VB128h : 2; uint32_t VB128h : 2;
uint32_t VD128h : 2; uint32_t VD128h : 2;
uint32_t: uint32_t : 1;
1;
uint32_t VA128h : 1; uint32_t VA128h : 1;
uint32_t VC : 3; uint32_t VC : 3;
uint32_t: uint32_t : 1;
1;
uint32_t VA128H : 1; uint32_t VA128H : 1;
uint32_t VB128l : 5; uint32_t VB128l : 5;
uint32_t VA128l : 5; uint32_t VA128l : 5;
uint32_t VD128l : 5; uint32_t VD128l : 5;
uint32_t: uint32_t : 6;
6;
} VX128_2; } VX128_2;
// kXEPPCInstrFormatVX128_3 // kXEPPCInstrFormatVX128_3
struct { struct {
@ -358,13 +321,11 @@ typedef struct {
// VB128 = VB128l | (VB128h << 5) // VB128 = VB128l | (VB128h << 5)
uint32_t VB128h : 2; uint32_t VB128h : 2;
uint32_t VD128h : 2; uint32_t VD128h : 2;
uint32_t: uint32_t : 7;
7;
uint32_t VB128l : 5; uint32_t VB128l : 5;
uint32_t IMM : 5; uint32_t IMM : 5;
uint32_t VD128l : 5; uint32_t VD128l : 5;
uint32_t: uint32_t : 6;
6;
} VX128_3; } VX128_3;
// kXEPPCInstrFormatVX128_4 // kXEPPCInstrFormatVX128_4
struct { struct {
@ -372,16 +333,13 @@ typedef struct {
// VB128 = VB128l | (VB128h << 5) // VB128 = VB128l | (VB128h << 5)
uint32_t VB128h : 2; uint32_t VB128h : 2;
uint32_t VD128h : 2; uint32_t VD128h : 2;
uint32_t: uint32_t : 2;
2;
uint32_t z : 2; uint32_t z : 2;
uint32_t: uint32_t : 3;
3;
uint32_t VB128l : 5; uint32_t VB128l : 5;
uint32_t IMM : 5; uint32_t IMM : 5;
uint32_t VD128l : 5; uint32_t VD128l : 5;
uint32_t: uint32_t : 6;
6;
} VX128_4; } VX128_4;
// kXEPPCInstrFormatVX128_5 // kXEPPCInstrFormatVX128_5
struct { struct {
@ -390,16 +348,14 @@ typedef struct {
// VB128 = VB128l | (VB128h << 5) // VB128 = VB128l | (VB128h << 5)
uint32_t VB128h : 2; uint32_t VB128h : 2;
uint32_t VD128h : 2; uint32_t VD128h : 2;
uint32_t: uint32_t : 1;
1;
uint32_t VA128h : 1; uint32_t VA128h : 1;
uint32_t SH : 4; uint32_t SH : 4;
uint32_t VA128H : 1; uint32_t VA128H : 1;
uint32_t VB128l : 5; uint32_t VB128l : 5;
uint32_t VA128l : 5; uint32_t VA128l : 5;
uint32_t VD128l : 5; uint32_t VD128l : 5;
uint32_t: uint32_t : 6;
6;
} VX128_5; } VX128_5;
// kXEPPCInstrFormatVX128_P // kXEPPCInstrFormatVX128_P
struct { struct {
@ -408,16 +364,13 @@ typedef struct {
// PERM = PERMl | (PERMh << 5) // PERM = PERMl | (PERMh << 5)
uint32_t VB128h : 2; uint32_t VB128h : 2;
uint32_t VD128h : 2; uint32_t VD128h : 2;
uint32_t: uint32_t : 2;
2;
uint32_t PERMh : 3; uint32_t PERMh : 3;
uint32_t: uint32_t : 2;
2;
uint32_t VB128l : 5; uint32_t VB128l : 5;
uint32_t PERMl : 5; uint32_t PERMl : 5;
uint32_t VD128l : 5; uint32_t VD128l : 5;
uint32_t: uint32_t : 6;
6;
} VX128_P; } VX128_P;
// kXEPPCInstrFormatVX128_R // kXEPPCInstrFormatVX128_R
struct { struct {
@ -426,18 +379,15 @@ typedef struct {
// VB128 = VB128l | (VB128h << 5) // VB128 = VB128l | (VB128h << 5)
uint32_t VB128h : 2; uint32_t VB128h : 2;
uint32_t VD128h : 2; uint32_t VD128h : 2;
uint32_t: uint32_t : 1;
1;
uint32_t VA128h : 1; uint32_t VA128h : 1;
uint32_t Rc : 1; uint32_t Rc : 1;
uint32_t: uint32_t : 3;
3;
uint32_t VA128H : 1; uint32_t VA128H : 1;
uint32_t VB128l : 5; uint32_t VB128l : 5;
uint32_t VA128l : 5; uint32_t VA128l : 5;
uint32_t VD128l : 5; uint32_t VD128l : 5;
uint32_t: uint32_t : 6;
6;
} VX128_R; } VX128_R;
// kXEPPCInstrFormatXDSS // kXEPPCInstrFormatXDSS
struct { struct {

View File

@ -371,8 +371,7 @@ void ProtectedRunTest(TestSuite& test_suite, TestRunner& runner,
} }
#if XE_COMPILER_MSVC #if XE_COMPILER_MSVC
} } __except (filter(GetExceptionCode())) {
__except(filter(GetExceptionCode())) {
XELOGE(" TEST FAILED (UNSUPPORTED INSTRUCTION)"); XELOGE(" TEST FAILED (UNSUPPORTED INSTRUCTION)");
++failed_count; ++failed_count;
} }

View File

@ -229,7 +229,8 @@ void Debugger::OnMessage(std::vector<uint8_t> buffer) {
fbb.CreateString(xe::to_string(code_cache->file_name())), fbb.CreateString(xe::to_string(code_cache->file_name())),
code_cache->base_address(), code_cache->total_size(), code_cache->base_address(), code_cache->total_size(),
fbb.CreateString(xe::to_string(functions_path_)), fbb.CreateString(xe::to_string(functions_path_)),
fbb.CreateString(xe::to_string(functions_trace_path_))).Union(); fbb.CreateString(xe::to_string(functions_trace_path_)))
.Union();
// Allow continuation if we were blocked waiting for a client. // Allow continuation if we were blocked waiting for a client.
accept_fence_.Signal(); accept_fence_.Signal();

View File

@ -99,12 +99,22 @@ enum RequestData {
}; };
inline const char** EnumNamesRequestData() { inline const char** EnumNamesRequestData() {
static const char* names[] = { static const char* names[] = {"NONE",
"NONE", "AttachRequest", "ListBreakpointsRequest", "AttachRequest",
"AddBreakpointsRequest", "UpdateBreakpointsRequest", "ListBreakpointsRequest",
"RemoveBreakpointsRequest", "ListModulesRequest", "GetModuleRequest", "AddBreakpointsRequest",
"ListFunctionsRequest", "GetFunctionRequest", "ListThreadsRequest", "UpdateBreakpointsRequest",
"StopRequest", "BreakRequest", "ContinueRequest", "StepRequest", nullptr}; "RemoveBreakpointsRequest",
"ListModulesRequest",
"GetModuleRequest",
"ListFunctionsRequest",
"GetFunctionRequest",
"ListThreadsRequest",
"StopRequest",
"BreakRequest",
"ContinueRequest",
"StepRequest",
nullptr};
return names; return names;
} }
@ -136,13 +146,24 @@ enum ResponseData {
}; };
inline const char** EnumNamesResponseData() { inline const char** EnumNamesResponseData() {
static const char* names[] = { static const char* names[] = {"NONE",
"NONE", "AttachResponse", "ListBreakpointsResponse", "AttachResponse",
"AddBreakpointsResponse", "UpdateBreakpointsResponse", "ListBreakpointsResponse",
"RemoveBreakpointsResponse", "ListModulesResponse", "GetModuleResponse", "AddBreakpointsResponse",
"ListFunctionsResponse", "GetFunctionResponse", "ListThreadsResponse", "UpdateBreakpointsResponse",
"StopResponse", "BreakResponse", "ContinueResponse", "StepResponse", "RemoveBreakpointsResponse",
"BreakpointEvent", "AccessViolationEvent", nullptr}; "ListModulesResponse",
"GetModuleResponse",
"ListFunctionsResponse",
"GetFunctionResponse",
"ListThreadsResponse",
"StopResponse",
"BreakResponse",
"ContinueResponse",
"StepResponse",
"BreakpointEvent",
"AccessViolationEvent",
nullptr};
return names; return names;
} }

View File

@ -460,7 +460,8 @@ struct ListFunctionsResponse FLATBUFFERS_FINAL_CLASS
struct ListFunctionsResponseBuilder { struct ListFunctionsResponseBuilder {
flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_entry(flatbuffers::Offset< void add_entry(
flatbuffers::Offset<
flatbuffers::Vector<flatbuffers::Offset<FunctionEntry>>> entry) { flatbuffers::Vector<flatbuffers::Offset<FunctionEntry>>> entry) {
fbb_.AddOffset(4, entry); fbb_.AddOffset(4, entry);
} }

View File

@ -177,16 +177,15 @@ void GL4GraphicsSystem::EndTracing() { command_processor_->EndTracing(); }
void GL4GraphicsSystem::PlayTrace(const uint8_t* trace_data, size_t trace_size, void GL4GraphicsSystem::PlayTrace(const uint8_t* trace_data, size_t trace_size,
TracePlaybackMode playback_mode) { TracePlaybackMode playback_mode) {
command_processor_->CallInThread( command_processor_->CallInThread([this, trace_data, trace_size,
[this, trace_data, trace_size, playback_mode]() { playback_mode]() {
command_processor_->set_swap_mode(SwapMode::kIgnored); command_processor_->set_swap_mode(SwapMode::kIgnored);
auto trace_ptr = trace_data; auto trace_ptr = trace_data;
bool pending_break = false; bool pending_break = false;
const PacketStartCommand* pending_packet = nullptr; const PacketStartCommand* pending_packet = nullptr;
while (trace_ptr < trace_data + trace_size) { while (trace_ptr < trace_data + trace_size) {
auto type = auto type = static_cast<TraceCommandType>(xe::load<uint32_t>(trace_ptr));
static_cast<TraceCommandType>(xe::load<uint32_t>(trace_ptr));
switch (type) { switch (type) {
case TraceCommandType::kPrimaryBufferStart: { case TraceCommandType::kPrimaryBufferStart: {
auto cmd = auto cmd =
@ -203,8 +202,8 @@ void GL4GraphicsSystem::PlayTrace(const uint8_t* trace_data, size_t trace_size,
break; break;
} }
case TraceCommandType::kIndirectBufferStart: { case TraceCommandType::kIndirectBufferStart: {
auto cmd = reinterpret_cast<const IndirectBufferStartCommand*>( auto cmd =
trace_ptr); reinterpret_cast<const IndirectBufferStartCommand*>(trace_ptr);
// //
trace_ptr += sizeof(*cmd) + cmd->count * 4; trace_ptr += sizeof(*cmd) + cmd->count * 4;
break; break;

View File

@ -47,9 +47,22 @@ using namespace xe::gpu::ucode;
using namespace xe::gpu::xenos; using namespace xe::gpu::xenos;
static const char* levels[] = { static const char* levels[] = {
"", "\t", "\t\t", "\t\t\t", "\t\t\t\t", "\t\t\t\t\t", "\t\t\t\t\t\t", "",
"\t\t\t\t\t\t\t", "\t\t\t\t\t\t\t\t", "\t\t\t\t\t\t\t\t\t", "x", "x", "x", "\t",
"x", "x", "x", "\t\t",
"\t\t\t",
"\t\t\t\t",
"\t\t\t\t\t",
"\t\t\t\t\t\t",
"\t\t\t\t\t\t\t",
"\t\t\t\t\t\t\t\t",
"\t\t\t\t\t\t\t\t\t",
"x",
"x",
"x",
"x",
"x",
"x",
}; };
/* /*

View File

@ -508,8 +508,11 @@ void XThread::DeliverAPCs() {
// kernel_routine(apc_address, &normal_routine, &normal_context, // kernel_routine(apc_address, &normal_routine, &normal_context,
// &system_arg1, &system_arg2) // &system_arg1, &system_arg2)
uint64_t kernel_args[] = { uint64_t kernel_args[] = {
apc_ptr, scratch_address_ + 0, scratch_address_ + 4, apc_ptr,
scratch_address_ + 8, scratch_address_ + 12, scratch_address_ + 0,
scratch_address_ + 4,
scratch_address_ + 8,
scratch_address_ + 12,
}; };
processor->Execute(thread_state_, apc->kernel_routine, kernel_args, processor->Execute(thread_state_, apc->kernel_routine, kernel_args,
xe::countof(kernel_args)); xe::countof(kernel_args));

View File

@ -464,8 +464,8 @@ xe::cpu::Export* RegisterExport(void (*fn)(Ps&...), const char* name,
using xe::cpu::ExportTag; using xe::cpu::ExportTag;
#define DECLARE_EXPORT(module_name, name, tags) \ #define DECLARE_EXPORT(module_name, name, tags) \
const auto EXPORT_##module_name##_##name = \ const auto EXPORT_##module_name##_##name = RegisterExport_##module_name( \
RegisterExport_##module_name(xe::kernel::shim::RegisterExport< \ xe::kernel::shim::RegisterExport< \
xe::kernel::shim::KernelModuleId::module_name, ordinals::##name>( \ xe::kernel::shim::KernelModuleId::module_name, ordinals::##name>( \
&name, #name, tags)); &name, #name, tags));

View File

@ -962,21 +962,11 @@ const uint32_t error_table_0xC0980001[] = {
#define MAKE_ENTRY(x) \ #define MAKE_ENTRY(x) \
{ ##x, xe::countof(error_table_##x), error_table_##x } { ##x, xe::countof(error_table_##x), error_table_##x }
const error_lookup_table error_tables[] = { const error_lookup_table error_tables[] = {
MAKE_ENTRY(0x00000103), MAKE_ENTRY(0x00000103), MAKE_ENTRY(0x40000002), MAKE_ENTRY(0x40020056),
MAKE_ENTRY(0x40000002), MAKE_ENTRY(0x400200AF), MAKE_ENTRY(0x80000001), MAKE_ENTRY(0x80000288),
MAKE_ENTRY(0x40020056), MAKE_ENTRY(0x80090300), MAKE_ENTRY(0xC0000001), MAKE_ENTRY(0xC0000202),
MAKE_ENTRY(0x400200AF), MAKE_ENTRY(0xC0020001), MAKE_ENTRY(0xC0030001), MAKE_ENTRY(0xC0030059),
MAKE_ENTRY(0x80000001), MAKE_ENTRY(0xC0050003), MAKE_ENTRY(0xC0980001), {0, 0, nullptr},
MAKE_ENTRY(0x80000288),
MAKE_ENTRY(0x80090300),
MAKE_ENTRY(0xC0000001),
MAKE_ENTRY(0xC0000202),
MAKE_ENTRY(0xC0020001),
MAKE_ENTRY(0xC0030001),
MAKE_ENTRY(0xC0030059),
MAKE_ENTRY(0xC0050003),
MAKE_ENTRY(0xC0980001),
{0, 0, nullptr},
}; };
#undef MAKE_ENTRY #undef MAKE_ENTRY

View File

@ -131,9 +131,12 @@ bool GLContext::Initialize(Window* target_window) {
context_flags |= WGL_CONTEXT_DEBUG_BIT_ARB; context_flags |= WGL_CONTEXT_DEBUG_BIT_ARB;
} }
int attrib_list[] = {WGL_CONTEXT_MAJOR_VERSION_ARB, 4, // int attrib_list[] = {WGL_CONTEXT_MAJOR_VERSION_ARB,
WGL_CONTEXT_MINOR_VERSION_ARB, 5, // 4, //
WGL_CONTEXT_FLAGS_ARB, context_flags, // WGL_CONTEXT_MINOR_VERSION_ARB,
5, //
WGL_CONTEXT_FLAGS_ARB,
context_flags, //
0}; 0};
glrc_ = wglCreateContextAttribsARB(dc_, nullptr, attrib_list); glrc_ = wglCreateContextAttribsARB(dc_, nullptr, attrib_list);
@ -187,10 +190,14 @@ std::unique_ptr<GraphicsContext> GLContext::CreateShared() {
context_flags |= WGL_CONTEXT_DEBUG_BIT_ARB; context_flags |= WGL_CONTEXT_DEBUG_BIT_ARB;
} }
int attrib_list[] = {WGL_CONTEXT_MAJOR_VERSION_ARB, 4, // int attrib_list[] = {WGL_CONTEXT_MAJOR_VERSION_ARB,
WGL_CONTEXT_MINOR_VERSION_ARB, 5, // 4, //
WGL_CONTEXT_FLAGS_ARB, context_flags, // WGL_CONTEXT_MINOR_VERSION_ARB,
WGL_CONTEXT_PROFILE_MASK_ARB, profile, // 5, //
WGL_CONTEXT_FLAGS_ARB,
context_flags, //
WGL_CONTEXT_PROFILE_MASK_ARB,
profile, //
0}; 0};
new_glrc = wglCreateContextAttribsARB(dc_, glrc_, attrib_list); new_glrc = wglCreateContextAttribsARB(dc_, glrc_, attrib_list);
if (!new_glrc) { if (!new_glrc) {
@ -234,7 +241,8 @@ void FatalGLError(std::string error) {
XEFATAL( XEFATAL(
(error + (error +
"\nEnsure you have the latest drivers for your GPU and that it supports " "\nEnsure you have the latest drivers for your GPU and that it supports "
"OpenGL 4.5. See http://xenia.jp/faq/ for more information.").c_str()); "OpenGL 4.5. See http://xenia.jp/faq/ for more information.")
.c_str());
} }
void GLContext::AssertExtensionsPresent() { void GLContext::AssertExtensionsPresent() {
@ -350,10 +358,11 @@ void GLContext::DebugMessage(GLenum source, GLenum type, GLuint id,
message); message);
} }
void GLAPIENTRY void GLAPIENTRY GLContext::DebugMessageThunk(GLenum source, GLenum type,
GLContext::DebugMessageThunk(GLenum source, GLenum type, GLuint id, GLuint id, GLenum severity,
GLenum severity, GLsizei length, GLsizei length,
const GLchar* message, GLvoid* user_param) { const GLchar* message,
GLvoid* user_param) {
reinterpret_cast<GLContext*>(user_param) reinterpret_cast<GLContext*>(user_param)
->DebugMessage(source, type, id, severity, length, message); ->DebugMessage(source, type, id, severity, length, message);
} }

View File

@ -58,9 +58,11 @@ class GLContext : public GraphicsContext {
void SetupDebugging(); void SetupDebugging();
void DebugMessage(GLenum source, GLenum type, GLuint id, GLenum severity, void DebugMessage(GLenum source, GLenum type, GLuint id, GLenum severity,
GLsizei length, const GLchar* message); GLsizei length, const GLchar* message);
static void GLAPIENTRY static void GLAPIENTRY DebugMessageThunk(GLenum source, GLenum type,
DebugMessageThunk(GLenum source, GLenum type, GLuint id, GLenum severity, GLuint id, GLenum severity,
GLsizei length, const GLchar* message, GLvoid* user_param); GLsizei length,
const GLchar* message,
GLvoid* user_param);
HDC dc_ = nullptr; HDC dc_ = nullptr;
HGLRC glrc_ = nullptr; HGLRC glrc_ = nullptr;

View File

@ -53,8 +53,8 @@ class Win32Window : public Window {
void OnResize(UIEvent& e) override; void OnResize(UIEvent& e) override;
static LRESULT CALLBACK static LRESULT CALLBACK WndProcThunk(HWND hWnd, UINT message, WPARAM wParam,
WndProcThunk(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); LPARAM lParam);
virtual LRESULT WndProc(HWND hWnd, UINT message, WPARAM wParam, virtual LRESULT WndProc(HWND hWnd, UINT message, WPARAM wParam,
LPARAM lParam); LPARAM lParam);