summaryrefslogtreecommitdiff
path: root/Runtime/GfxDevice/opengles30/UtilsGLES30.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-08-14 22:50:43 +0800
committerchai <chaifix@163.com>2019-08-14 22:50:43 +0800
commit15740faf9fe9fe4be08965098bbf2947e096aeeb (patch)
treea730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/GfxDevice/opengles30/UtilsGLES30.h
+Unity Runtime codeHEADmaster
Diffstat (limited to 'Runtime/GfxDevice/opengles30/UtilsGLES30.h')
-rw-r--r--Runtime/GfxDevice/opengles30/UtilsGLES30.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/Runtime/GfxDevice/opengles30/UtilsGLES30.h b/Runtime/GfxDevice/opengles30/UtilsGLES30.h
new file mode 100644
index 0000000..cde05de
--- /dev/null
+++ b/Runtime/GfxDevice/opengles30/UtilsGLES30.h
@@ -0,0 +1,37 @@
+#pragma once
+
+#include "UnityPrefix.h"
+#include "Runtime/Graphics/RenderTexture.h"
+
+// Shared GLES3 utilities
+
+class TransferFormatGLES30
+{
+public:
+ UInt32 format;
+ UInt32 dataType;
+
+ TransferFormatGLES30 (UInt32 format_, UInt32 dataType_)
+ : format (format_)
+ , dataType (dataType_)
+ {
+ }
+};
+
+// Map RenderTextureFormat to closest GL sized internal format.
+UInt32 GetColorFormatGLES30 (RenderTextureFormat format);
+
+// Get closest depth internal format.
+UInt32 GetDepthOnlyFormatGLES30 (DepthBufferFormat format);
+
+// Get closest depth&stencil internal format.
+UInt32 GetDepthStencilFormatGLES30 (DepthBufferFormat format);
+
+// Get transfer (upload) format, dataType pair for internal format.
+TransferFormatGLES30 GetTransferFormatGLES30 (UInt32 internalFormat);
+
+// Get default framebuffer (0) internal format (guess based on bits)
+UInt32 GetDefaultFramebufferColorFormatGLES30 (void);
+
+// Get default framebuffer (0) depth format
+UInt32 GetDefaultFramebufferDepthFormatGLES30 (void);