UNITY_DECLARE_TEX2DARRAY(name)
UNITY_SAMPLE_TEX2DARRAY(name,coord) // coord is float3
On DX11-like systems (DX11, and I'd assume XB1/PS4) the macros expand to:
#define UNITY_DECLARE_TEX2DARRAY(name) Texture2DArray(name); SamplerState sampler##name
#define UNITY_SAMPLE_TEX2DARRAY(name,coord) name.Sample(coord)
On hlsl2glsl-like systems (GL+EXT_texture_array, GLES3, Metal) the macros expand to:
#define UNITY_DECLARE_TEX2DARRAY(name) sampler2DArray name
#define UNITY_SAMPLE_TEX2DARRAY(name,coord) tex2DArray(name,coord)
and hlsl2glslfork has to learn how to parse that & emit proper GLSL. glsl-optimizer might also need minor updates, but concept of "texture arrays" should already be there
I'd assume that GfxDeviceTypes.h TextureDimension needs to get a new entry for kTexDim2DArray. Review all places that have any tables sized kTexDimCount.
Shader lexer/parser probably needs a keyword for 2D arrays, i.e. shader_lex.lpp.
Shader compiler side needs to emit reflection info for 2D arrays, CompilerHLSL11.cpp etc.
GraphicsCaps needs to get a bool for whether 2D arrays are supported.
Otherwise, probably basing implementation on Texture3D.cpp/h would be good - just like texture arrays, it needs to check for hardware support, has no asset pipeline just yet (only create/fill from code), etc. Expose it to scripts in TextureBindings.txt, similar to 3D textures.
Array uploading/update code added to GfxDevice.h interface, possibly with an empty base implementation (for platforms that can't have them), again probably similar to 3D textures.