forked from PazerOP/TF2Vulkan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hitting a "Called function that cannot be supported" issue somewhere.…
….. needs further investigation. But we're making significant progress on getting into the game!
- Loading branch information
Showing
54 changed files
with
2,089 additions
and
446 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#pragma once | ||
|
||
#include <cassert> | ||
#include <mutex> | ||
|
||
namespace Util | ||
{ | ||
template<typename T> | ||
class MutexDbgWrapper | ||
{ | ||
public: | ||
void lock() | ||
{ | ||
m_Mutex.lock(); | ||
|
||
#ifdef _DEBUG | ||
if (m_LockCount++ == 0) | ||
m_OwningThread = std::this_thread::get_id(); | ||
#endif | ||
} | ||
|
||
void unlock() | ||
{ | ||
#if _DEBUG | ||
auto oldLock = m_LockCount--; | ||
assert(oldLock > 0); | ||
if (oldLock == 1) | ||
m_OwningThread = {}; | ||
#endif | ||
|
||
m_Mutex.unlock(); | ||
} | ||
|
||
void assert_has_lock() | ||
{ | ||
#ifdef _DEBUG | ||
assert(m_OwningThread == std::this_thread::get_id()); | ||
#endif | ||
} | ||
|
||
private: | ||
#ifdef _DEBUG | ||
std::thread::id m_OwningThread; | ||
uint32_t m_LockCount = 0; | ||
#endif | ||
T m_Mutex; | ||
}; | ||
|
||
using MutexDbg = MutexDbgWrapper<std::mutex>; | ||
using RecursiveMutexDbg = MutexDbgWrapper<std::recursive_mutex>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#pragma once | ||
|
||
#include "TF2Vulkan/Util/std_compare.h" | ||
|
||
namespace TF2Vulkan | ||
{ | ||
struct LogicalFogParams final | ||
{ | ||
constexpr LogicalFogParams() = default; | ||
|
||
DEFAULT_PARTIAL_ORDERING_OPERATOR(LogicalFogParams); | ||
|
||
float m_Start = 0; | ||
float m_End = 0; | ||
float m_Z = 0; | ||
float m_MaxDensity = 0; | ||
MaterialFogMode_t m_Mode = MATERIAL_FOG_NONE; | ||
uint8_t m_ColorR = 255; | ||
uint8_t m_ColorG = 255; | ||
uint8_t m_ColorB = 255; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#pragma once | ||
|
||
#include "TF2Vulkan/Util/std_compare.h" | ||
|
||
namespace TF2Vulkan | ||
{ | ||
struct FogParams final | ||
{ | ||
constexpr FogParams() = default; | ||
|
||
DEFAULT_PARTIAL_ORDERING_OPERATOR(FogParams); | ||
|
||
float m_Start = 0; | ||
float m_End = 0; | ||
float m_Z = 0; | ||
float m_MaxDensity = 0; | ||
MaterialFogMode_t m_Mode = MATERIAL_FOG_NONE; | ||
uint8_t m_ColorR = 255; | ||
uint8_t m_ColorG = 255; | ||
uint8_t m_ColorB = 255; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#pragma once | ||
|
||
#include <bitmap/imageformat.h> | ||
#include <vtf/vtf.h> | ||
|
||
namespace TF2Vulkan | ||
{ | ||
struct TextureSubrect | ||
{ | ||
uint_fast8_t m_MipLevel = uint_fast8_t(-1); | ||
CubeMapFaceIndex_t m_CubeFace{}; | ||
uint_fast32_t m_Width = 0; | ||
uint_fast32_t m_Height = 0; | ||
uint_fast32_t m_Depth = 1; | ||
|
||
uint_fast32_t m_OffsetX = 0; | ||
uint_fast32_t m_OffsetY = 0; | ||
uint_fast32_t m_OffsetZ = 0; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.