internal static void SetRenderTargetImpl(RenderTargetSetup setup)
{
if (setup.color.Length == 0)
{
throw new ArgumentException("Invalid color buffer count for SetRenderTarget");
}
if (setup.color.Length != setup.colorLoad.Length)
{
throw new ArgumentException("Color LoadAction and Buffer arrays have different sizes");
}
if (setup.color.Length != setup.colorStore.Length)
{
throw new ArgumentException("Color StoreAction and Buffer arrays have different sizes");
}
RenderBufferLoadAction[] colorLoad = setup.colorLoad;
for (int i = 0; i < colorLoad.Length; i++)
{
RenderBufferLoadAction load = colorLoad[i];
Graphics.CheckLoadActionValid(load, "Color");
}
RenderBufferStoreAction[] colorStore = setup.colorStore;
for (int j = 0; j < colorStore.Length; j++)
{
RenderBufferStoreAction store = colorStore[j];
Graphics.CheckStoreActionValid(store, "Color");
}
Graphics.CheckLoadActionValid(setup.depthLoad, "Depth");
Graphics.CheckStoreActionValid(setup.depthStore, "Depth");
if (setup.cubemapFace < CubemapFace.Unknown || setup.cubemapFace > CubemapFace.NegativeZ)
{
throw new ArgumentException("Bad CubemapFace provided");
}
Graphics.Internal_SetMRTFullSetup(setup.color, out setup.depth, setup.mipLevel, setup.cubemapFace, setup.colorLoad, setup.colorStore, setup.depthLoad, setup.depthStore);
}