#pragma once #include "common/rectangle.h" #include "core/types.h" #include #include #include #include namespace FrontendCommon { class PostProcessingShader { public: enum : u32 { PUSH_CONSTANT_SIZE_THRESHOLD = 128 }; struct Option { enum : u32 { MAX_VECTOR_COMPONENTS = 4 }; enum class Type { Invalid, Bool, Int, Float }; union Value { s32 int_value; float float_value; }; static_assert(sizeof(Value) == sizeof(u32)); using ValueVector = std::array; static_assert(sizeof(ValueVector) == sizeof(u32) * MAX_VECTOR_COMPONENTS); std::string name; std::string ui_name; std::string dependent_option; Type type; u32 vector_size; ValueVector default_value; ValueVector min_value; ValueVector max_value; ValueVector step_value; ValueVector value; }; PostProcessingShader(); PostProcessingShader(std::string name, std::string code); PostProcessingShader(const PostProcessingShader& copy); PostProcessingShader(PostProcessingShader& move); ~PostProcessingShader(); PostProcessingShader& operator=(const PostProcessingShader& copy); PostProcessingShader& operator=(PostProcessingShader& move); ALWAYS_INLINE const std::string& GetName() const { return m_name; } ALWAYS_INLINE const std::string& GetCode() const { return m_code; } ALWAYS_INLINE const std::vector