-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Texture binding system for Uniforms
* Implement MemoryPool to manage all device memory allocations * Remove Buffer class * Rename VkResult_log to VkResult_check * Remove redundant/verbose documentation for internal submodules (annoying to maintain)
- Loading branch information
Showing
29 changed files
with
1,175 additions
and
1,073 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
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,104 @@ | ||
#pragma once | ||
|
||
#include <vector> | ||
|
||
#include <Utils/SparseArray.hpp> | ||
|
||
namespace Dynamo::Graphics { | ||
/** | ||
* @brief Texture resource handle. | ||
* | ||
*/ | ||
DYN_DEFINE_ID_TYPE(Texture); | ||
|
||
/** | ||
* @brief Texture formats. | ||
* | ||
*/ | ||
enum class TextureFormat { | ||
F32_R_Norm, | ||
U8_RGB_Norm, | ||
U8_RGBA_Norm, | ||
}; | ||
|
||
/** | ||
* @brief Texture filter modes. | ||
* | ||
*/ | ||
enum class TextureFilter { | ||
Nearest, | ||
Linear, | ||
}; | ||
|
||
/** | ||
* @brief Texture addressing modes. | ||
* | ||
*/ | ||
enum class TextureAddressMode { | ||
Repeat, | ||
RepeatMirror, | ||
Clamp, | ||
ClampMirror, | ||
ClampBorder, | ||
}; | ||
|
||
/** | ||
* @brief Texture descriptor. | ||
* | ||
*/ | ||
struct TextureDescriptor { | ||
/** | ||
* @brief Texture unit byte buffer. | ||
* | ||
*/ | ||
std::vector<unsigned char> texels; | ||
|
||
/** | ||
* @brief Width of the texture in texture units. | ||
* | ||
*/ | ||
unsigned width = 0; | ||
|
||
/** | ||
* @brief Height of the texture in texture units. | ||
* | ||
*/ | ||
unsigned height = 0; | ||
|
||
/** | ||
* @brief Format of the texture determines how the byte buffer is interpreted. | ||
* | ||
*/ | ||
TextureFormat format = TextureFormat::U8_RGBA_Norm; | ||
|
||
/** | ||
* @brief Minification filter. | ||
* | ||
*/ | ||
TextureFilter min_filter = TextureFilter::Nearest; | ||
|
||
/** | ||
* @brief Magnification filter. | ||
* | ||
*/ | ||
TextureFilter mag_filter = TextureFilter::Nearest; | ||
|
||
/** | ||
* @brief How U coordinates are addressed outside [0, 1). | ||
* | ||
*/ | ||
TextureAddressMode u_address_mode = TextureAddressMode::Repeat; | ||
|
||
/** | ||
* @brief How V coordinates are addressed outside [0, 1). | ||
* | ||
*/ | ||
TextureAddressMode v_address_mode = TextureAddressMode::Repeat; | ||
|
||
/** | ||
* @brief How W coordinates are addressed outside [0, 1). | ||
* | ||
*/ | ||
TextureAddressMode w_address_mode = TextureAddressMode::Repeat; | ||
}; | ||
} // namespace Dynamo::Graphics |
Oops, something went wrong.