From 48ae500743651b5fbfc7c6a872ce307423258853 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sun, 9 Sep 2018 12:20:34 -0600 Subject: [PATCH] Added iOS plugin files (and fix .gitignore) --- .gitignore | 2 +- .../Plugins/iOS/EmojiTexture.mm.meta | 36 ++ .../EmojiTexture/Plugins/iOS/IUnityGraphics.h | 52 +++ .../Plugins/iOS/IUnityGraphics.h.meta | 91 +++++ .../Plugins/iOS/IUnityInterface.h | 200 +++++++++++ .../Plugins/iOS/IUnityInterface.h.meta | 91 +++++ .../Plugins/iOS/IUnityRenderingExtensions.h | 338 ++++++++++++++++++ .../iOS/IUnityRenderingExtensions.h.meta | 91 +++++ 8 files changed, 900 insertions(+), 1 deletion(-) create mode 100644 Assets/EmojiTexture/Plugins/iOS/EmojiTexture.mm.meta create mode 100755 Assets/EmojiTexture/Plugins/iOS/IUnityGraphics.h create mode 100644 Assets/EmojiTexture/Plugins/iOS/IUnityGraphics.h.meta create mode 100755 Assets/EmojiTexture/Plugins/iOS/IUnityInterface.h create mode 100644 Assets/EmojiTexture/Plugins/iOS/IUnityInterface.h.meta create mode 100755 Assets/EmojiTexture/Plugins/iOS/IUnityRenderingExtensions.h create mode 100644 Assets/EmojiTexture/Plugins/iOS/IUnityRenderingExtensions.h.meta diff --git a/.gitignore b/.gitignore index c027f25..9ffe046 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,6 @@ sysinfo.txt # Builds *.apk *.unitypackage -iOS +/iOS Assets/TextMesh Pro TextMesh Pro.meta diff --git a/Assets/EmojiTexture/Plugins/iOS/EmojiTexture.mm.meta b/Assets/EmojiTexture/Plugins/iOS/EmojiTexture.mm.meta new file mode 100644 index 0000000..a818e03 --- /dev/null +++ b/Assets/EmojiTexture/Plugins/iOS/EmojiTexture.mm.meta @@ -0,0 +1,36 @@ +fileFormatVersion: 2 +guid: d16d3895927bc434bbb009b9eaa241e9 +timeCreated: 1514760200 +licenseType: Free +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + - first: + tvOS: tvOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/EmojiTexture/Plugins/iOS/IUnityGraphics.h b/Assets/EmojiTexture/Plugins/iOS/IUnityGraphics.h new file mode 100755 index 0000000..855009b --- /dev/null +++ b/Assets/EmojiTexture/Plugins/iOS/IUnityGraphics.h @@ -0,0 +1,52 @@ +#pragma once +#include "IUnityInterface.h" + +typedef enum UnityGfxRenderer +{ + //kUnityGfxRendererOpenGL = 0, // Legacy OpenGL, removed + //kUnityGfxRendererD3D9 = 1, // Direct3D 9, removed + kUnityGfxRendererD3D11 = 2, // Direct3D 11 + kUnityGfxRendererGCM = 3, // PlayStation 3 + kUnityGfxRendererNull = 4, // "null" device (used in batch mode) + kUnityGfxRendererOpenGLES20 = 8, // OpenGL ES 2.0 + kUnityGfxRendererOpenGLES30 = 11, // OpenGL ES 3.0 + kUnityGfxRendererGXM = 12, // PlayStation Vita + kUnityGfxRendererPS4 = 13, // PlayStation 4 + kUnityGfxRendererXboxOne = 14, // Xbox One + kUnityGfxRendererMetal = 16, // iOS Metal + kUnityGfxRendererOpenGLCore = 17, // OpenGL core + kUnityGfxRendererD3D12 = 18, // Direct3D 12 + kUnityGfxRendererVulkan = 21, // Vulkan + kUnityGfxRendererNvn = 22, // Nintendo Switch NVN API + kUnityGfxRendererXboxOneD3D12 = 23 // MS XboxOne Direct3D 12 +} UnityGfxRenderer; + +typedef enum UnityGfxDeviceEventType +{ + kUnityGfxDeviceEventInitialize = 0, + kUnityGfxDeviceEventShutdown = 1, + kUnityGfxDeviceEventBeforeReset = 2, + kUnityGfxDeviceEventAfterReset = 3, +} UnityGfxDeviceEventType; + +typedef void (UNITY_INTERFACE_API * IUnityGraphicsDeviceEventCallback)(UnityGfxDeviceEventType eventType); + +// Should only be used on the rendering thread unless noted otherwise. +UNITY_DECLARE_INTERFACE(IUnityGraphics) +{ + UnityGfxRenderer(UNITY_INTERFACE_API * GetRenderer)(); // Thread safe + + // This callback will be called when graphics device is created, destroyed, reset, etc. + // It is possible to miss the kUnityGfxDeviceEventInitialize event in case plugin is loaded at a later time, + // when the graphics device is already created. + void(UNITY_INTERFACE_API * RegisterDeviceEventCallback)(IUnityGraphicsDeviceEventCallback callback); + void(UNITY_INTERFACE_API * UnregisterDeviceEventCallback)(IUnityGraphicsDeviceEventCallback callback); + int(UNITY_INTERFACE_API * ReserveEventIDRange)(int count); // reserves 'count' event IDs. Plugins should use the result as a base index when issuing events back and forth to avoid event id clashes. +}; +UNITY_REGISTER_INTERFACE_GUID(0x7CBA0A9CA4DDB544ULL, 0x8C5AD4926EB17B11ULL, IUnityGraphics) + + +// Certain Unity APIs (GL.IssuePluginEvent, CommandBuffer.IssuePluginEvent) can callback into native plugins. +// Provide them with an address to a function of this signature. +typedef void (UNITY_INTERFACE_API * UnityRenderingEvent)(int eventId); +typedef void (UNITY_INTERFACE_API * UnityRenderingEventAndData)(int eventId, void* data); diff --git a/Assets/EmojiTexture/Plugins/iOS/IUnityGraphics.h.meta b/Assets/EmojiTexture/Plugins/iOS/IUnityGraphics.h.meta new file mode 100644 index 0000000..2eb986e --- /dev/null +++ b/Assets/EmojiTexture/Plugins/iOS/IUnityGraphics.h.meta @@ -0,0 +1,91 @@ +fileFormatVersion: 2 +guid: 85914e2cb214c4166a21674aef0055c8 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: LinuxUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/EmojiTexture/Plugins/iOS/IUnityInterface.h b/Assets/EmojiTexture/Plugins/iOS/IUnityInterface.h new file mode 100755 index 0000000..190c5a0 --- /dev/null +++ b/Assets/EmojiTexture/Plugins/iOS/IUnityInterface.h @@ -0,0 +1,200 @@ +#pragma once + +// Unity native plugin API +// Compatible with C99 + +#if defined(__CYGWIN32__) + #define UNITY_INTERFACE_API __stdcall + #define UNITY_INTERFACE_EXPORT __declspec(dllexport) +#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(WINAPI_FAMILY) + #define UNITY_INTERFACE_API __stdcall + #define UNITY_INTERFACE_EXPORT __declspec(dllexport) +#elif defined(__MACH__) || defined(__ANDROID__) || defined(__linux__) + #define UNITY_INTERFACE_API + #define UNITY_INTERFACE_EXPORT +#else + #define UNITY_INTERFACE_API + #define UNITY_INTERFACE_EXPORT +#endif + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// IUnityInterface is a registry of interfaces we choose to expose to plugins. +// +// USAGE: +// --------- +// To retrieve an interface a user can do the following from a plugin, assuming they have the header file for the interface: +// +// IMyInterface * ptr = registry->Get(); +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// Unity Interface GUID +// Ensures global uniqueness. +// +// Template specialization is used to produce a means of looking up a GUID from its interface type at compile time. +// The net result should compile down to passing around the GUID. +// +// UNITY_REGISTER_INTERFACE_GUID should be placed in the header file of any interface definition outside of all namespaces. +// The interface structure and the registration GUID are all that is required to expose the interface to other systems. +struct UnityInterfaceGUID +{ +#ifdef __cplusplus + UnityInterfaceGUID(unsigned long long high, unsigned long long low) + : m_GUIDHigh(high) + , m_GUIDLow(low) + { + } + + UnityInterfaceGUID(const UnityInterfaceGUID& other) + { + m_GUIDHigh = other.m_GUIDHigh; + m_GUIDLow = other.m_GUIDLow; + } + + UnityInterfaceGUID& operator=(const UnityInterfaceGUID& other) + { + m_GUIDHigh = other.m_GUIDHigh; + m_GUIDLow = other.m_GUIDLow; + return *this; + } + + bool Equals(const UnityInterfaceGUID& other) const { return m_GUIDHigh == other.m_GUIDHigh && m_GUIDLow == other.m_GUIDLow; } + bool LessThan(const UnityInterfaceGUID& other) const { return m_GUIDHigh < other.m_GUIDHigh || (m_GUIDHigh == other.m_GUIDHigh && m_GUIDLow < other.m_GUIDLow); } +#endif + unsigned long long m_GUIDHigh; + unsigned long long m_GUIDLow; +}; +#ifdef __cplusplus +inline bool operator==(const UnityInterfaceGUID& left, const UnityInterfaceGUID& right) { return left.Equals(right); } +inline bool operator!=(const UnityInterfaceGUID& left, const UnityInterfaceGUID& right) { return !left.Equals(right); } +inline bool operator<(const UnityInterfaceGUID& left, const UnityInterfaceGUID& right) { return left.LessThan(right); } +inline bool operator>(const UnityInterfaceGUID& left, const UnityInterfaceGUID& right) { return right.LessThan(left); } +inline bool operator>=(const UnityInterfaceGUID& left, const UnityInterfaceGUID& right) { return !operator<(left, right); } +inline bool operator<=(const UnityInterfaceGUID& left, const UnityInterfaceGUID& right) { return !operator>(left, right); } +#else +typedef struct UnityInterfaceGUID UnityInterfaceGUID; +#endif + + +#ifdef __cplusplus + #define UNITY_DECLARE_INTERFACE(NAME) \ + struct NAME : IUnityInterface + +// Generic version of GetUnityInterfaceGUID to allow us to specialize it +// per interface below. The generic version has no actual implementation +// on purpose. +// +// If you get errors about return values related to this method then +// you have forgotten to include UNITY_REGISTER_INTERFACE_GUID with +// your interface, or it is not visible at some point when you are +// trying to retrieve or add an interface. +template +inline const UnityInterfaceGUID GetUnityInterfaceGUID(); + +// This is the macro you provide in your public interface header +// outside of a namespace to allow us to map between type and GUID +// without the user having to worry about it when attempting to +// add or retrieve and interface from the registry. + #define UNITY_REGISTER_INTERFACE_GUID(HASHH, HASHL, TYPE) \ + template<> \ + inline const UnityInterfaceGUID GetUnityInterfaceGUID() \ + { \ + return UnityInterfaceGUID(HASHH,HASHL); \ + } + +// Same as UNITY_REGISTER_INTERFACE_GUID but allows the interface to live in +// a particular namespace. As long as the namespace is visible at the time you call +// GetUnityInterfaceGUID< INTERFACETYPE >() or you explicitly qualify it in the template +// calls this will work fine, only the macro here needs to have the additional parameter + #define UNITY_REGISTER_INTERFACE_GUID_IN_NAMESPACE(HASHH, HASHL, TYPE, NAMESPACE) \ + const UnityInterfaceGUID TYPE##_GUID(HASHH, HASHL); \ + template<> \ + inline const UnityInterfaceGUID GetUnityInterfaceGUID< NAMESPACE :: TYPE >() \ + { \ + return UnityInterfaceGUID(HASHH,HASHL); \ + } + +// These macros allow for C compatibility in user code. + #define UNITY_GET_INTERFACE_GUID(TYPE) GetUnityInterfaceGUID< TYPE >() + + +#else + #define UNITY_DECLARE_INTERFACE(NAME) \ + typedef struct NAME NAME; \ + struct NAME + +// NOTE: This has the downside that one some compilers it will not get stripped from all compilation units that +// can see a header containing this constant. However, it's only for C compatibility and thus should have +// minimal impact. + #define UNITY_REGISTER_INTERFACE_GUID(HASHH, HASHL, TYPE) \ + const UnityInterfaceGUID TYPE##_GUID = {HASHH, HASHL}; + +// In general namespaces are going to be a problem for C code any interfaces we expose in a namespace are +// not going to be usable from C. + #define UNITY_REGISTER_INTERFACE_GUID_IN_NAMESPACE(HASHH, HASHL, TYPE, NAMESPACE) + +// These macros allow for C compatibility in user code. + #define UNITY_GET_INTERFACE_GUID(TYPE) TYPE##_GUID +#endif + +// Using this in user code rather than INTERFACES->Get() will be C compatible for those places in plugins where +// this may be needed. Unity code itself does not need this. +#define UNITY_GET_INTERFACE(INTERFACES, TYPE) (TYPE*)INTERFACES->GetInterfaceSplit (UNITY_GET_INTERFACE_GUID(TYPE).m_GUIDHigh, UNITY_GET_INTERFACE_GUID(TYPE).m_GUIDLow); + + +#ifdef __cplusplus +struct IUnityInterface +{ +}; +#else +typedef void IUnityInterface; +#endif + + +typedef struct IUnityInterfaces +{ + // Returns an interface matching the guid. + // Returns nullptr if the given interface is unavailable in the active Unity runtime. + IUnityInterface* (UNITY_INTERFACE_API * GetInterface)(UnityInterfaceGUID guid); + + // Registers a new interface. + void(UNITY_INTERFACE_API * RegisterInterface)(UnityInterfaceGUID guid, IUnityInterface * ptr); + + // Split APIs for C + IUnityInterface* (UNITY_INTERFACE_API * GetInterfaceSplit)(unsigned long long guidHigh, unsigned long long guidLow); + void(UNITY_INTERFACE_API * RegisterInterfaceSplit)(unsigned long long guidHigh, unsigned long long guidLow, IUnityInterface * ptr); + +#ifdef __cplusplus + // Helper for GetInterface. + template + INTERFACE* Get() + { + return static_cast(GetInterface(GetUnityInterfaceGUID())); + } + + // Helper for RegisterInterface. + template + void Register(IUnityInterface* ptr) + { + RegisterInterface(GetUnityInterfaceGUID(), ptr); + } + +#endif +} IUnityInterfaces; + + +#ifdef __cplusplus +extern "C" { +#endif + +// If exported by a plugin, this function will be called when the plugin is loaded. +void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API UnityPluginLoad(IUnityInterfaces* unityInterfaces); +// If exported by a plugin, this function will be called when the plugin is about to be unloaded. +void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API UnityPluginUnload(); + +#ifdef __cplusplus +} +#endif + +struct RenderSurfaceBase; +typedef struct RenderSurfaceBase* UnityRenderBuffer; +typedef unsigned int UnityTextureID; diff --git a/Assets/EmojiTexture/Plugins/iOS/IUnityInterface.h.meta b/Assets/EmojiTexture/Plugins/iOS/IUnityInterface.h.meta new file mode 100644 index 0000000..a21bacf --- /dev/null +++ b/Assets/EmojiTexture/Plugins/iOS/IUnityInterface.h.meta @@ -0,0 +1,91 @@ +fileFormatVersion: 2 +guid: d5d39d2e1bafd48d4bd5f0e723efe1e9 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: LinuxUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/EmojiTexture/Plugins/iOS/IUnityRenderingExtensions.h b/Assets/EmojiTexture/Plugins/iOS/IUnityRenderingExtensions.h new file mode 100755 index 0000000..4277d4e --- /dev/null +++ b/Assets/EmojiTexture/Plugins/iOS/IUnityRenderingExtensions.h @@ -0,0 +1,338 @@ +#pragma once + + +#include "IUnityGraphics.h" + +/* + Low-level Native Plugin Rendering Extensions + ============================================ + + On top of the Low-level native plugin interface, Unity also supports low level rendering extensions that can receive callbacks when certain events happen. + This is mostly used to implement and control low-level rendering in your plugin and enable it to work with Unity’s multithreaded rendering. + + Due to the low-level nature of this extension the plugin might need to be preloaded before the devices get created. + Currently the convention is name-based namely the plugin name must be prefixed by “GfxPlugin”. Example: GfxPluginMyFancyNativePlugin. + + + // Native plugin code example + + enum PluginCustomCommands + { + kPluginCustomCommandDownscale = kUnityRenderingExtUserEventsStart, + kPluginCustomCommandUpscale, + + // insert your own events here + + kPluginCustomCommandCount + }; + + static IUnityInterfaces* s_UnityInterfaces = NULL; + + extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API + UnityPluginLoad(IUnityInterfaces* unityInterfaces) + { + // initialization code here... + } + + extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API + UnityRenderingExtEvent(UnityRenderingExtEventType event, void* data) + { + switch (event) + { + case kUnityRenderingExtEventBeforeDrawCall: + // do some stuff + break; + case kUnityRenderingExtEventAfterDrawCall: + // undo some stuff + break; + case kPluginCustomCommandDownscale: + // downscale some stuff + break; + case kPluginCustomCommandUpscale: + // upscale some stuff + break; + } + } + +*/ + + +// These events will be propagated to all plugins that implement void UnityRenderingExtEvent(UnityRenderingExtEventType event, void* data); + +enum UnityRenderingExtEventType +{ + kUnityRenderingExtEventSetStereoTarget, // issued during SetStereoTarget and carrying the current 'eye' index as parameter + kUnityRenderingExtEventSetStereoEye, // issued during stereo rendering at the beginning of each eye's rendering loop. It carries the current 'eye' index as parameter + kUnityRenderingExtEventStereoRenderingDone, // issued after the rendering has finished + kUnityRenderingExtEventBeforeDrawCall, // issued during BeforeDrawCall and carrying UnityRenderingExtBeforeDrawCallParams as parameter + kUnityRenderingExtEventAfterDrawCall, // issued during AfterDrawCall. This event doesn't carry any parameters + kUnityRenderingExtEventCustomGrab, // issued during GrabIntoRenderTexture since we can't simply copy the resources + // when custom rendering is used - we need to let plugin handle this. It carries over + // a UnityRenderingExtCustomBlitParams params = { X, source, dest, 0, 0 } ( X means it's irrelevant ) + kUnityRenderingExtEventCustomBlit, // issued by plugin to insert custom blits. It carries over UnityRenderingExtCustomBlitParams as param. + kUnityRenderingExtEventUpdateTextureBegin, // issued to update a texture. It carries over UnityRenderingExtTextureUpdateParams + kUnityRenderingExtEventUpdateTextureEnd, // issued to signal the plugin that the texture update has finished. It carries over the same UnityRenderingExtTextureUpdateParams as kUnityRenderingExtEventUpdateTextureBegin + + // keep this last + kUnityRenderingExtEventCount, + kUnityRenderingExtUserEventsStart = kUnityRenderingExtEventCount +}; + + +enum UnityRenderingExtCustomBlitCommands +{ + kUnityRenderingExtCustomBlitVRFlush, // This event is mostly used in multi GPU configurations ( SLI, etc ) in order to allow the plugin to flush all GPU's targets + + // keep this last + kUnityRenderingExtCustomBlitCount, + kUnityRenderingExtUserCustomBlitStart = kUnityRenderingExtCustomBlitCount +}; + +/* + This will be propagated to all plugins implementing UnityRenderingExtQuery. +*/ +enum UnityRenderingExtQueryType +{ + kUnityRenderingExtQueryOverrideViewport = 1 << 0, // The plugin handles setting up the viewport rects. Unity will skip its internal SetViewport calls + kUnityRenderingExtQueryOverrideScissor = 1 << 1, // The plugin handles setting up the scissor rects. Unity will skip its internal SetScissor calls + kUnityRenderingExtQueryOverrideVROcclussionMesh = 1 << 2, // The plugin handles its own VR occlusion mesh rendering. Unity will skip rendering its internal VR occlusion mask + kUnityRenderingExtQueryOverrideVRSinglePass = 1 << 3, // The plugin uses its own single pass stereo technique. Unity will only traverse and render the render node graph once. + // and it will clear the whole render target not just per-eye on demand. + kUnityRenderingExtQueryKeepOriginalDoubleWideWidth_DEPRECATED = 1 << 4, // Instructs unity to keep the original double wide width. By default unity will try and have a power-of-two width for mip-mapping requirements. + kUnityRenderingExtQueryRequestVRFlushCallback = 1 << 5, // Instructs unity to provide callbacks when the VR eye textures need flushing. Useful for multi GPU synchronization. +}; + + +enum UnityRenderingExtTextureFormat +{ + kUnityRenderingExtFormatNone = 0, kUnityRenderingExtFormatFirst = kUnityRenderingExtFormatNone, + + // sRGB formats + kUnityRenderingExtFormatR8_SRGB, + kUnityRenderingExtFormatRG8_SRGB, + kUnityRenderingExtFormatRGB8_SRGB, + kUnityRenderingExtFormatRGBA8_SRGB, + + // 8 bit integer formats + kUnityRenderingExtFormatR8_UNorm, + kUnityRenderingExtFormatRG8_UNorm, + kUnityRenderingExtFormatRGB8_UNorm, + kUnityRenderingExtFormatRGBA8_UNorm, + kUnityRenderingExtFormatR8_SNorm, + kUnityRenderingExtFormatRG8_SNorm, + kUnityRenderingExtFormatRGB8_SNorm, + kUnityRenderingExtFormatRGBA8_SNorm, + kUnityRenderingExtFormatR8_UInt, + kUnityRenderingExtFormatRG8_UInt, + kUnityRenderingExtFormatRGB8_UInt, + kUnityRenderingExtFormatRGBA8_UInt, + kUnityRenderingExtFormatR8_SInt, + kUnityRenderingExtFormatRG8_SInt, + kUnityRenderingExtFormatRGB8_SInt, + kUnityRenderingExtFormatRGBA8_SInt, + + // 16 bit integer formats + kUnityRenderingExtFormatR16_UNorm, + kUnityRenderingExtFormatRG16_UNorm, + kUnityRenderingExtFormatRGB16_UNorm, + kUnityRenderingExtFormatRGBA16_UNorm, + kUnityRenderingExtFormatR16_SNorm, + kUnityRenderingExtFormatRG16_SNorm, + kUnityRenderingExtFormatRGB16_SNorm, + kUnityRenderingExtFormatRGBA16_SNorm, + kUnityRenderingExtFormatR16_UInt, + kUnityRenderingExtFormatRG16_UInt, + kUnityRenderingExtFormatRGB16_UInt, + kUnityRenderingExtFormatRGBA16_UInt, + kUnityRenderingExtFormatR16_SInt, + kUnityRenderingExtFormatRG16_SInt, + kUnityRenderingExtFormatRGB16_SInt, + kUnityRenderingExtFormatRGBA16_SInt, + + // 32 bit integer formats + kUnityRenderingExtFormatR32_UInt, + kUnityRenderingExtFormatRG32_UInt, + kUnityRenderingExtFormatRGB32_UInt, + kUnityRenderingExtFormatRGBA32_UInt, + kUnityRenderingExtFormatR32_SInt, + kUnityRenderingExtFormatRG32_SInt, + kUnityRenderingExtFormatRGB32_SInt, + kUnityRenderingExtFormatRGBA32_SInt, + + // HDR formats + kUnityRenderingExtFormatR16_SFloat, + kUnityRenderingExtFormatRG16_SFloat, + kUnityRenderingExtFormatRGB16_SFloat, + kUnityRenderingExtFormatRGBA16_SFloat, + kUnityRenderingExtFormatR32_SFloat, + kUnityRenderingExtFormatRG32_SFloat, + kUnityRenderingExtFormatRGB32_SFloat, + kUnityRenderingExtFormatRGBA32_SFloat, + + // Packed formats + kUnityRenderingExtFormatRGB10A2_UNorm, + kUnityRenderingExtFormatRGB10A2_UInt, + kUnityRenderingExtFormatRGB10A2_SInt, + kUnityRenderingExtFormatRGB9E5_UFloat, + kUnityRenderingExtFormatRG11B10_UFloat, + + // Alpha format + kUnityRenderingExtFormatA8_UNorm, + kUnityRenderingExtFormatA16_UNorm, + + // BGR formats + kUnityRenderingExtFormatBGR8_SRGB, + kUnityRenderingExtFormatBGRA8_SRGB, + kUnityRenderingExtFormatBGR8_UNorm, + kUnityRenderingExtFormatBGRA8_UNorm, + kUnityRenderingExtFormatBGR8_SNorm, + kUnityRenderingExtFormatBGRA8_SNorm, + kUnityRenderingExtFormatBGR8_UInt, + kUnityRenderingExtFormatBGRA8_UInt, + kUnityRenderingExtFormatBGR8_SInt, + kUnityRenderingExtFormatBGRA8_SInt, + + kUnityRenderingExtFormatBGR10A2_UNorm, + kUnityRenderingExtFormatBGR10A2_UInt, + kUnityRenderingExtFormatBGR10A2XR_SRGB, + kUnityRenderingExtFormatBGR10A2XR_UNorm, + kUnityRenderingExtFormatBGR10XR_SRGB, + kUnityRenderingExtFormatBGR10XR_UNorm, + kUnityRenderingExtFormatBGRA10XR_SRGB, + kUnityRenderingExtFormatBGRA10XR_UNorm, + + // 16 bit formats + kUnityRenderingExtFormatRGBA4_UNorm, + kUnityRenderingExtFormatBGRA4_UNorm, + kUnityRenderingExtFormatR5G6B5_UNorm, + kUnityRenderingExtFormatB5G6R5_UNorm, + kUnityRenderingExtFormatRGB5A1_UNorm, + kUnityRenderingExtFormatBGR5A1_UNorm, + kUnityRenderingExtFormatA1RGB5_UNorm, + + // ARGB formats... TextureFormat legacy + kUnityRenderingExtFormatARGB8_SRGB, + kUnityRenderingExtFormatARGB8_UNorm, + kUnityRenderingExtFormatARGB32_SFloat, + + // Depth Stencil for formats + kUnityRenderingExtFormatDepth16_UInt, + kUnityRenderingExtFormatDepth24_UInt, + kUnityRenderingExtFormatDepth24_UInt_Stencil8_UInt, + kUnityRenderingExtFormatDepth32_SFloat, + kUnityRenderingExtFormatD32_SFloat_Stencil8_Uint, + kUnityRenderingExtFormatStencil8_Uint, + + // Compression formats + kUnityRenderingExtFormatRGB_DXT1_SRGB, kUnityRenderingExtFormatDXTCFirst = kUnityRenderingExtFormatRGB_DXT1_SRGB, + kUnityRenderingExtFormatRGB_DXT1_UNorm, + kUnityRenderingExtFormatRGBA_DXT3_SRGB, + kUnityRenderingExtFormatRGBA_DXT3_UNorm, + kUnityRenderingExtFormatRGBA_DXT5_SRGB, + kUnityRenderingExtFormatRGBA_DXT5_UNorm, kUnityRenderingExtFormatDXTCLast = kUnityRenderingExtFormatRGBA_DXT5_UNorm, + kUnityRenderingExtFormatR_BC4_UNorm, kUnityRenderingExtFormatRGTCFirst = kUnityRenderingExtFormatR_BC4_UNorm, + kUnityRenderingExtFormatR_BC4_SNorm, + kUnityRenderingExtFormatRG_BC5_UNorm, + kUnityRenderingExtFormatRG_BC5_SNorm, kUnityRenderingExtFormatRGTCLast = kUnityRenderingExtFormatRG_BC5_SNorm, + kUnityRenderingExtFormatRGB_BC6H_UFloat, kUnityRenderingExtFormatBPTCFirst = kUnityRenderingExtFormatRGB_BC6H_UFloat, + kUnityRenderingExtFormatRGB_BC6H_SFloat, + kUnityRenderingExtFormatRGBA_BC7_SRGB, + kUnityRenderingExtFormatRGBA_BC7_UNorm, kUnityRenderingExtFormatBPTCLast = kUnityRenderingExtFormatRGBA_BC7_UNorm, + + kUnityRenderingExtFormatRGB_PVRTC_2Bpp_SRGB, kUnityRenderingExtFormatPVRTCFirst = kUnityRenderingExtFormatRGB_PVRTC_2Bpp_SRGB, + kUnityRenderingExtFormatRGB_PVRTC_2Bpp_UNorm, + kUnityRenderingExtFormatRGB_PVRTC_4Bpp_SRGB, + kUnityRenderingExtFormatRGB_PVRTC_4Bpp_UNorm, + kUnityRenderingExtFormatRGBA_PVRTC_2Bpp_SRGB, + kUnityRenderingExtFormatRGBA_PVRTC_2Bpp_UNorm, + kUnityRenderingExtFormatRGBA_PVRTC_4Bpp_SRGB, + kUnityRenderingExtFormatRGBA_PVRTC_4Bpp_UNorm, kUnityRenderingExtFormatPVRTCLast = kUnityRenderingExtFormatRGBA_PVRTC_4Bpp_UNorm, + + kUnityRenderingExtFormatRGB_ETC_UNorm, kUnityRenderingExtFormatETCFirst = kUnityRenderingExtFormatRGB_ETC_UNorm, + kUnityRenderingExtFormatRGB_ETC2_SRGB, + kUnityRenderingExtFormatRGB_ETC2_UNorm, + kUnityRenderingExtFormatRGB_A1_ETC2_SRGB, + kUnityRenderingExtFormatRGB_A1_ETC2_UNorm, + kUnityRenderingExtFormatRGBA_ETC2_SRGB, + kUnityRenderingExtFormatRGBA_ETC2_UNorm, kUnityRenderingExtFormatETCLast = kUnityRenderingExtFormatRGBA_ETC2_UNorm, + + kUnityRenderingExtFormatR_EAC_UNorm, kUnityRenderingExtFormatEACFirst = kUnityRenderingExtFormatR_EAC_UNorm, + kUnityRenderingExtFormatR_EAC_SNorm, + kUnityRenderingExtFormatRG_EAC_UNorm, + kUnityRenderingExtFormatRG_EAC_SNorm, kUnityRenderingExtFormatEACLast = kUnityRenderingExtFormatRG_EAC_SNorm, + + kUnityRenderingExtFormatRGBA_ASTC4X4_SRGB, kUnityRenderingExtFormatASTCFirst = kUnityRenderingExtFormatRGBA_ASTC4X4_SRGB, + kUnityRenderingExtFormatRGBA_ASTC4X4_UNorm, + kUnityRenderingExtFormatRGBA_ASTC5X5_SRGB, + kUnityRenderingExtFormatRGBA_ASTC5X5_UNorm, + kUnityRenderingExtFormatRGBA_ASTC6X6_SRGB, + kUnityRenderingExtFormatRGBA_ASTC6X6_UNorm, + kUnityRenderingExtFormatRGBA_ASTC8X8_SRGB, + kUnityRenderingExtFormatRGBA_ASTC8X8_UNorm, + kUnityRenderingExtFormatRGBA_ASTC10X10_SRGB, + kUnityRenderingExtFormatRGBA_ASTC10X10_UNorm, + kUnityRenderingExtFormatRGBA_ASTC12X12_SRGB, + kUnityRenderingExtFormatRGBA_ASTC12X12_UNorm, kUnityRenderingExtFormatASTCLast = kUnityRenderingExtFormatRGBA_ASTC12X12_UNorm, + + // Video formats + kUnityRenderingExtFormatYUV2, + + // Automatic formats, back-end decides + kUnityRenderingExtFormatLDRAuto, + kUnityRenderingExtFormatHDRAuto, + kUnityRenderingExtFormatDepthAuto, + kUnityRenderingExtFormatShadowAuto, + kUnityRenderingExtFormatVideoAuto, kUnityRenderingExtFormatLast = kUnityRenderingExtFormatVideoAuto, +}; + + +struct UnityRenderingExtBeforeDrawCallParams +{ + void* vertexShader; // bound vertex shader (platform dependent) + void* fragmentShader; // bound fragment shader (platform dependent) + void* geometryShader; // bound geometry shader (platform dependent) + void* hullShader; // bound hull shader (platform dependent) + void* domainShader; // bound domain shader (platform dependent) + int eyeIndex; // the index of the current stereo "eye" being currently rendered. +}; + + +struct UnityRenderingExtCustomBlitParams +{ + UnityTextureID source; // source texture + UnityRenderBuffer destination; // destination surface + unsigned int command; // command for the custom blit - could be any UnityRenderingExtCustomBlitCommands command or custom ones. + unsigned int commandParam; // custom parameters for the command + unsigned int commandFlags; // custom flags for the command +}; + +struct UnityRenderingExtTextureUpdateParams +{ + void* texData; // source data for the texture update. Must be set by the plugin + unsigned int userData; // user defined data. Set by the plugin + + unsigned int textureID; // texture ID of the texture to be updated. + UnityRenderingExtTextureFormat format; // format of the texture to be updated + unsigned int width; // width of the texture + unsigned int height; // height of the texture + unsigned int bpp; // texture bytes per pixel. +}; + + +// Certain Unity APIs (GL.IssuePluginEventAndData, CommandBuffer.IssuePluginEventAndData) can callback into native plugins. +// Provide them with an address to a function of this signature. +typedef void (UNITY_INTERFACE_API * UnityRenderingEventAndData)(int eventId, void* data); + + +#ifdef __cplusplus +extern "C" { +#endif + +// If exported by a plugin, this function will be called for all the events in UnityRenderingExtEventType +void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API UnityRenderingExtEvent(UnityRenderingExtEventType event, void* data); +// If exported by a plugin, this function will be called to query the plugin for the queries in UnityRenderingExtQueryType +bool UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API UnityRenderingExtQuery(UnityRenderingExtQueryType query); + +#ifdef __cplusplus +} +#endif diff --git a/Assets/EmojiTexture/Plugins/iOS/IUnityRenderingExtensions.h.meta b/Assets/EmojiTexture/Plugins/iOS/IUnityRenderingExtensions.h.meta new file mode 100644 index 0000000..a68eda0 --- /dev/null +++ b/Assets/EmojiTexture/Plugins/iOS/IUnityRenderingExtensions.h.meta @@ -0,0 +1,91 @@ +fileFormatVersion: 2 +guid: fb3cc8ba5a20d42f68103d328ba171dc +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: LinuxUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: