mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-08 18:43:24 +09:00
[Fix] (Build): restore the MSVC Windows build of the opengl32 drop-in
This commit is contained in:
@@ -348,8 +348,16 @@ namespace {
|
||||
void* EGLAPIENTRY VendorGetDispatchAddress(const char* procName) { return LookupEntryPoint(procName); }
|
||||
} // namespace
|
||||
|
||||
extern "C" MOBILEGL_EGL_API EGLBoolean __egl_Main(uint32_t version, const __EGLapiExports* exports,
|
||||
__EGLvendorInfo* vendor, __EGLapiImports* imports) {
|
||||
// libeglabi.h has already declared this prototype without an export attribute, and MSVC refuses a
|
||||
// redeclaration that adds dllexport. Windows has no glvnd to look the symbol up, so it is a plain
|
||||
// external definition there.
|
||||
#ifdef _WIN32
|
||||
#define MOBILEGL_GLVND_EGL_MAIN extern "C"
|
||||
#else
|
||||
#define MOBILEGL_GLVND_EGL_MAIN MOBILEGL_EGL_API
|
||||
#endif
|
||||
MOBILEGL_GLVND_EGL_MAIN EGLBoolean __egl_Main(uint32_t version, const __EGLapiExports* exports,
|
||||
__EGLvendorInfo* vendor, __EGLapiImports* imports) {
|
||||
(void)vendor;
|
||||
if (EGL_VENDOR_ABI_GET_MAJOR_VERSION(version) != EGL_VENDOR_ABI_MAJOR_VERSION) {
|
||||
// A vendor that does not know the ABI it is being handed must say so, not guess: the
|
||||
|
||||
@@ -1634,7 +1634,7 @@ namespace MobileGL::MG_Pipe {
|
||||
rectBoxes, rectCount, slab, pitch, m_regions.data(), m_regions.size());
|
||||
m_regions.resize(pieceRegions);
|
||||
fillRecord(slab.Box,
|
||||
reinterpret_cast<Uint64>(reinterpret_cast<std::uintptr_t>(shadow)) +
|
||||
static_cast<Uint64>(reinterpret_cast<std::uintptr_t>(shadow)) +
|
||||
slab.RunOffset);
|
||||
const Bool pieceAccepted = emitRecord(
|
||||
static_cast<const Uint8*>(shadow) + slab.RunOffset, slab.RunBytes);
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <Config.h>
|
||||
|
||||
#include <atomic>
|
||||
#include <bit>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
@@ -1012,7 +1013,7 @@ namespace MobileGL::MG_Record {
|
||||
for (SizeT wordIndex = 0; wordIndex < (tracked->pageCount + 63) / 64; ++wordIndex) {
|
||||
Uint64 word = tracked->pageBits[wordIndex].load(std::memory_order_relaxed);
|
||||
while (word != 0) {
|
||||
const SizeT bit = static_cast<SizeT>(__builtin_ctzll(word));
|
||||
const SizeT bit = static_cast<SizeT>(std::countr_zero(word));
|
||||
word &= word - 1;
|
||||
const SizeT pageIndex = (wordIndex << 6) + bit;
|
||||
// Clear the bit FIRST, per the order the correctness argument
|
||||
@@ -1026,7 +1027,7 @@ namespace MobileGL::MG_Record {
|
||||
std::memory_order_relaxed);
|
||||
SizeT runEnd = pageIndex + 1;
|
||||
while (word != 0) {
|
||||
const SizeT nextBit = static_cast<SizeT>(__builtin_ctzll(word));
|
||||
const SizeT nextBit = static_cast<SizeT>(std::countr_zero(word));
|
||||
if ((wordIndex << 6) + nextBit != runEnd) break;
|
||||
word &= word - 1;
|
||||
tracked->pageBits[wordIndex].fetch_and(~(1ull << nextBit),
|
||||
|
||||
Reference in New Issue
Block a user