From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/GfxDevice/opengles20/CombinerGLES20.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Runtime/GfxDevice/opengles20/CombinerGLES20.cpp (limited to 'Runtime/GfxDevice/opengles20/CombinerGLES20.cpp') diff --git a/Runtime/GfxDevice/opengles20/CombinerGLES20.cpp b/Runtime/GfxDevice/opengles20/CombinerGLES20.cpp new file mode 100644 index 0000000..eaff5fb --- /dev/null +++ b/Runtime/GfxDevice/opengles20/CombinerGLES20.cpp @@ -0,0 +1,21 @@ +#include "UnityPrefix.h" +#include "CombinerGLES20.h" +#include "Runtime/Shaders/GraphicsCaps.h" +#include "VBOGLES20.h" + +#if GFX_SUPPORTS_OPENGLES20 + +TextureCombinersGLES2* TextureCombinersGLES2::Create (int count, const ShaderLab::TextureBinding* texEnvs) +{ + // check if we have enough vertex attributes to emulate this combiner + if (count + GL_TEXTURE_ARRAY0 >= gGraphicsCaps.gles20.maxAttributes) + return NULL; + + // create struct that holds texture combiner info object + TextureCombinersGLES2* combiners = new TextureCombinersGLES2(); + combiners->count = count; + combiners->texEnvs = texEnvs; + return combiners; +} + +#endif // GFX_SUPPORTS_OPENGLES20 -- cgit v1.1-26-g67d0