Browse Source

Nothing important

Panagiotis Christopoulos Charitos 11 years ago
parent
commit
5513a66d3d
3 changed files with 53 additions and 22 deletions
  1. 35 21
      include/anki/gl/GlCommon.h
  2. 0 1
      include/anki/gl/GlFramebuffer.h
  3. 18 0
      include/anki/gl/GlFramebufferHandle.h

+ 35 - 21
include/anki/gl/GlCommon.h

@@ -42,6 +42,25 @@ using GlCommandBufferAllocator = ChainAllocator<T>;
 /// The type of the allocator for heap allocations
 /// The type of the allocator for heap allocations
 template<typename T>
 template<typename T>
 using GlAllocator = HeapAllocator<T>;
 using GlAllocator = HeapAllocator<T>;
+/// @}
+
+/// @addtogroup opengl_containers
+/// @{
+
+/// Attachment load.
+enum class GlAttachmentLoadOperation: U8
+{
+	LOAD,
+	CLEAR,
+	DONT_CARE
+};
+
+/// Attachment store.
+enum class GlAttachmentStoreOperation: U8
+{
+	STORE,
+	DONT_CARE
+};
 
 
 /// Texture filtering method
 /// Texture filtering method
 enum class GlTextureFilter: U8
 enum class GlTextureFilter: U8
@@ -51,27 +70,6 @@ enum class GlTextureFilter: U8
 	TRILINEAR
 	TRILINEAR
 };
 };
 
 
-/// Split the initializer for re-using parts of it
-class GlTextureInitializerBase
-{
-public:
-	U32 m_width = 0;
-	U32 m_height = 0;
-	U32 m_depth = 0; ///< Relevant only for 3D and 2DArray textures
-	GLenum m_target = GL_TEXTURE_2D;
-	GLenum m_internalFormat = GL_NONE;
-	U32 m_mipmapsCount = 0;
-	GlTextureFilter m_filterType = GlTextureFilter::NEAREST;
-	Bool8 m_repeat = false;
-	I32 m_anisotropyLevel = 0;
-	U32 m_samples = 1;
-};
-
-/// @}
-
-/// @addtogroup opengl_containers
-/// @{
-
 /// Shader type
 /// Shader type
 enum class ShaderType: U8
 enum class ShaderType: U8
 {
 {
@@ -128,6 +126,22 @@ ANKI_SPECIALIZE_SHADER_VAR_TYPE_GET(Mat4, MAT4)
 
 
 #undef ANKI_SPECIALIZE_SHADER_VAR_TYPE_GET
 #undef ANKI_SPECIALIZE_SHADER_VAR_TYPE_GET
 
 
+/// Split the initializer for re-using parts of it
+class GlTextureInitializerBase
+{
+public:
+	U32 m_width = 0;
+	U32 m_height = 0;
+	U32 m_depth = 0; ///< Relevant only for 3D and 2DArray textures
+	GLenum m_target = GL_TEXTURE_2D;
+	GLenum m_internalFormat = GL_NONE;
+	U32 m_mipmapsCount = 0;
+	GlTextureFilter m_filterType = GlTextureFilter::NEAREST;
+	Bool8 m_repeat = false;
+	I32 m_anisotropyLevel = 0;
+	U32 m_samples = 1;
+};
+
 /// Shader block information.
 /// Shader block information.
 struct ShaderVariableBlockInfo
 struct ShaderVariableBlockInfo
 {
 {

+ 0 - 1
include/anki/gl/GlFramebuffer.h

@@ -78,7 +78,6 @@ private:
 
 
 	void destroy();
 	void destroy();
 };
 };
-
 /// @}
 /// @}
 
 
 } // end namespace anki
 } // end namespace anki

+ 18 - 0
include/anki/gl/GlFramebufferHandle.h

@@ -17,12 +17,30 @@ class GlCommandBufferHandle;
 /// @addtogroup opengl_other
 /// @addtogroup opengl_other
 /// @{
 /// @{
 
 
+/// Attachment.
+struct GlAttachment
+{
+	GlTextureHandle m_texture;
+	U32 m_layer = 0;
+	GlAttachmentLoadOperation m_loadOp;
+	GlAttachmentStoreOperation m_storeOp;
+};
+
+/// GlFramebuffer initializer.
+struct GlFramebufferInitializer
+{
+	GlAttachment* m_colorAttachments = nullptr;
+	U32 m_colorAttachmentsCount = 0;
+	GlAttachment* m_depthStencilAttachment = nullptr;
+};
+
 /// Framebuffer handle
 /// Framebuffer handle
 class GlFramebufferHandle: public GlContainerHandle<GlFramebuffer>
 class GlFramebufferHandle: public GlContainerHandle<GlFramebuffer>
 {
 {
 public:
 public:
 	using Base = GlContainerHandle<GlFramebuffer>;
 	using Base = GlContainerHandle<GlFramebuffer>;
 	using Attachment = GlFramebuffer::Attachment;
 	using Attachment = GlFramebuffer::Attachment;
+	using Initializer = GlFramebufferInitializer;
 
 
 	GlFramebufferHandle();
 	GlFramebufferHandle();