code: Cleanup and warning fixes from the Vulkan PR (#6163)
Co-authored-by: emufan4568 <geoster3d@gmail.com> Co-authored-by: Kyle Kienapfel <Docteh@users.noreply.github.com>
This commit is contained in:
parent
aa84022704
commit
1ddea27ac8
72 changed files with 895 additions and 626 deletions
|
@ -78,6 +78,7 @@ add_library(common STATIC
|
|||
logging/backend.h
|
||||
logging/filter.cpp
|
||||
logging/filter.h
|
||||
logging/formatter.h
|
||||
logging/log.h
|
||||
logging/text_formatter.cpp
|
||||
logging/text_formatter.h
|
||||
|
|
|
@ -31,8 +31,10 @@
|
|||
#endif
|
||||
|
||||
// 64 bit offsets for MSVC and MinGW. MinGW also needs this for using _wstat64
|
||||
#ifndef __MINGW64__
|
||||
#define stat _stat64
|
||||
#define fstat _fstat64
|
||||
#endif
|
||||
|
||||
#else
|
||||
#ifdef __APPLE__
|
||||
|
|
|
@ -65,12 +65,16 @@ private:
|
|||
|
||||
BOOST_CLASS_EXPORT_KEY(BufferMem);
|
||||
|
||||
/// A managed reference to host-side memory. Fast enough to be used everywhere instead of u8*
|
||||
/// Supports serialization.
|
||||
/**
|
||||
* A managed reference to host-side memory.
|
||||
* Fast enough to be used everywhere instead of u8*
|
||||
* Supports serialization.
|
||||
*/
|
||||
class MemoryRef {
|
||||
public:
|
||||
MemoryRef() = default;
|
||||
MemoryRef(std::nullptr_t) {}
|
||||
|
||||
MemoryRef(std::shared_ptr<BackingMem> backing_mem_)
|
||||
: backing_mem(std::move(backing_mem_)), offset(0) {
|
||||
Init();
|
||||
|
@ -80,30 +84,38 @@ public:
|
|||
ASSERT(offset <= backing_mem->GetSize());
|
||||
Init();
|
||||
}
|
||||
|
||||
explicit operator bool() const {
|
||||
return cptr != nullptr;
|
||||
}
|
||||
|
||||
operator u8*() {
|
||||
return cptr;
|
||||
}
|
||||
|
||||
u8* GetPtr() {
|
||||
return cptr;
|
||||
}
|
||||
|
||||
operator const u8*() const {
|
||||
return cptr;
|
||||
}
|
||||
|
||||
const u8* GetPtr() const {
|
||||
return cptr;
|
||||
}
|
||||
|
||||
std::size_t GetSize() const {
|
||||
return csize;
|
||||
}
|
||||
|
||||
MemoryRef& operator+=(u32 offset_by) {
|
||||
ASSERT(offset_by < csize);
|
||||
offset += offset_by;
|
||||
Init();
|
||||
return *this;
|
||||
}
|
||||
|
||||
MemoryRef operator+(u32 offset_by) const {
|
||||
ASSERT(offset_by < csize);
|
||||
return MemoryRef(backing_mem, offset + offset_by);
|
||||
|
|
|
@ -23,12 +23,3 @@ typedef void* HANDLE;
|
|||
#include <microprofile.h>
|
||||
|
||||
#define MP_RGB(r, g, b) ((r) << 16 | (g) << 8 | (b) << 0)
|
||||
|
||||
// On OS X, some Mach header included by MicroProfile defines these as macros, conflicting with
|
||||
// identifiers we use.
|
||||
#ifdef PAGE_SIZE
|
||||
#undef PAGE_SIZE
|
||||
#endif
|
||||
#ifdef PAGE_MASK
|
||||
#undef PAGE_MASK
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue