Skip to content

Commit

Permalink
Merge pull request #129 from adriengivry/reduced-definition-enum-foot…
Browse files Browse the repository at this point in the history
…print

Reduced memory footprint of graphics RHI definitions enums
  • Loading branch information
jmorton06 authored Dec 11, 2023
2 parents 0589c28 + c8affd4 commit 648688c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
46 changes: 23 additions & 23 deletions Lumos/Source/Lumos/Graphics/RHI/Definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,30 @@ namespace Lumos
static constexpr uint16_t DESCRIPTOR_MAX_SAMPLERS = 1024;
static constexpr uint16_t DESCRIPTOR_MAX_TEXTURES = 1024;

enum class CullMode
enum class CullMode : uint8_t
{
FRONT = 0,
BACK,
FRONTANDBACK,
NONE
};

enum class PolygonMode
enum class PolygonMode : uint8_t
{
FILL = 0,
LINE,
POINT
};

enum class BlendMode
enum class BlendMode : uint8_t
{
None = 0,
OneZero,
ZeroSrcColor,
SrcAlphaOneMinusSrcAlpha,
};

enum class TextureWrap
enum class TextureWrap : uint8_t
{
NONE = 0,
REPEAT,
Expand All @@ -67,14 +67,14 @@ namespace Lumos
CLAMP_TO_BORDER
};

enum class TextureFilter
enum class TextureFilter : uint8_t
{
NONE = 0,
LINEAR,
NEAREST
};

enum class RHIFormat : uint32_t
enum class RHIFormat : uint8_t
{
NONE = 0,
R8_Unorm,
Expand Down Expand Up @@ -115,22 +115,22 @@ namespace Lumos
SCREEN
};

enum class BufferUsage
enum class BufferUsage : uint8_t
{
STATIC,
DYNAMIC,
STREAM
};

enum class DescriptorType
enum class DescriptorType : uint8_t
{
UNIFORM_BUFFER,
UNIFORM_BUFFER_DYNAMIC,
IMAGE_SAMPLER,
IMAGE_STORAGE
};

enum class ShaderDataType
enum class ShaderDataType : uint8_t
{
NONE = 0,
FLOAT32,
Expand All @@ -150,7 +150,7 @@ namespace Lumos
MAT4ARRAY
};

enum class ShaderType : int
enum class ShaderType : uint8_t
{
VERTEX = 0,
FRAGMENT,
Expand All @@ -161,7 +161,7 @@ namespace Lumos
UNKNOWN
};

enum class TextureType
enum class TextureType : uint8_t
{
COLOUR = 0,
DEPTH,
Expand All @@ -170,13 +170,13 @@ namespace Lumos
OTHER
};

enum SubPassContents
enum SubPassContents : uint8_t
{
INLINE = 0,
SECONDARY
};

enum TextureFlags : uint32_t
enum TextureFlags : uint8_t
{
Texture_Sampled = BIT(0),
Texture_Storage = BIT(1),
Expand All @@ -187,7 +187,7 @@ namespace Lumos
Texture_MipViews = BIT(6)
};

enum RendererBufferType
enum RendererBufferType : uint8_t
{
RENDERER_BUFFER_COLOUR = BIT(0),
RENDERER_BUFFER_DEPTH = BIT(1),
Expand All @@ -196,14 +196,14 @@ namespace Lumos

};

enum class DrawType
enum class DrawType : uint8_t
{
POINT = 0,
TRIANGLE,
LINES
};

enum class StencilType
enum class StencilType : uint8_t
{
EQUAL = 0,
NOTEQUAL,
Expand All @@ -213,13 +213,13 @@ namespace Lumos
ALWAYS
};

enum class PixelPackType
enum class PixelPackType : uint8_t
{
PACK = 0,
UNPACK
};

enum class RendererBlendFunction
enum class RendererBlendFunction : uint8_t
{
NONE = 0,
ZERO,
Expand All @@ -229,27 +229,27 @@ namespace Lumos
ONE_MINUS_SOURCE_ALPHA
};

enum class RendererBlendEquation
enum class RendererBlendEquation : uint8_t
{
NONE = 0,
ADD,
SUBTRACT
};

enum class RenderMode
enum class RenderMode : uint8_t
{
FILL = 0,
WIREFRAME
};

enum class DataType
enum class DataType : uint8_t
{
FLOAT = 0,
UNSIGNED_INT,
UNSIGNED_BYTE
};

enum class PhysicalDeviceType
enum class PhysicalDeviceType : uint8_t
{
DISCRETE = 0,
INTEGRATED = 1,
Expand Down Expand Up @@ -323,7 +323,7 @@ namespace Lumos
std::vector<BufferMemberInfo> m_Members;
};

enum class CubeFace
enum class CubeFace : uint8_t
{
PositiveX = 0,
NegativeX,
Expand Down
2 changes: 1 addition & 1 deletion Lumos/Source/Lumos/Platform/OpenGL/GLFramebuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Lumos
{
namespace Graphics
{
enum class RHIFormat : uint32_t;
enum class RHIFormat : uint8_t;

class LUMOS_EXPORT GLFramebuffer : public Framebuffer
{
Expand Down

0 comments on commit 648688c

Please sign in to comment.