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.
todo: update dynamic buffers right before draw
- Loading branch information
Showing
8 changed files
with
316 additions
and
345 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#pragma once | ||
|
||
#include <cstddef> | ||
#include <type_traits> | ||
|
||
namespace Util | ||
{ | ||
template<typename T, typename TOffset, typename = std::enable_if_t<std::is_integral_v<TOffset>>> | ||
__forceinline T* OffsetPtr(T* base, TOffset offset) | ||
{ | ||
if (!base) | ||
return base; | ||
|
||
using byteType = std::conditional_t<std::is_const_v<T>, const std::byte*, std::byte*>; | ||
return reinterpret_cast<T*>(reinterpret_cast<byteType>(base) + offset); | ||
} | ||
} |
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
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.