// Generated by ShaderCompiler from DefaultBatchedSpritesNoTexture.shader. Do not edit manually.
#pragma once

#include "ShaderCompilerTypes.h"
#if defined(WITH_RHI_D3D11)
#	include "D3d11GeneratedShaders.h"
#endif
#if defined(WITH_RHI_VULKAN)
#	include "VulkanGeneratedShaders.h"
#endif

#ifndef DOXYGEN_GENERATING_OUTPUT
namespace nCine::ShadersGen
{
#if defined(WITH_RHI_GL) && !defined(RHI_GL_PROFILE_ES2)
	inline constexpr char DefaultBatchedSpritesNoTexture_Vs[] =
R"__SHDR__(#line 1

out vec4 vColor;

uniform mat4 uProjectionMatrix;
uniform mat4 uViewMatrix;

struct Instance
{
	mat4 modelMatrix;
	vec4 color;
	vec2 spriteSize;
};

layout (std140) uniform InstancesBlock
{
#ifndef BATCH_SIZE
	#define BATCH_SIZE (682) // 64 Kb / 96 b
#endif
	Instance[BATCH_SIZE] instances;
} block;

#define i block.instances[gl_VertexID / 6]

void main()
{
	vec2 aPosition = vec2(1.0 - float(((gl_VertexID + 2) / 3) % 2), 1.0 - float(((gl_VertexID + 1) / 3) % 2));
	vec4 position = vec4(aPosition.x * i.spriteSize.x, aPosition.y * i.spriteSize.y, 0.0, 1.0);

	gl_Position = uProjectionMatrix * uViewMatrix * i.modelMatrix * position;
	vColor = i.color;
}
)__SHDR__";
#endif

#if defined(WITH_RHI_GL) && defined(RHI_GL_PROFILE_ES2)
	inline constexpr char DefaultBatchedSpritesNoTexture_Vs100[] =
R"__SHDR__(attribute vec2 aQuadCorner;
attribute float aInstanceIndex;
#line 1

varying vec4 vColor;

uniform mat4 uProjectionMatrix;
uniform mat4 uViewMatrix;

struct Instance
{
	mat4 modelMatrix;
	vec4 color;
	vec2 spriteSize;
};

#ifndef BATCH_SIZE
	#define BATCH_SIZE (682) // 64 Kb / 96 b
#endif
	uniform Instance instances[BATCH_SIZE];

#define i instances[int(aInstanceIndex)]

void main()
{
	vec2 aPosition = vec2(1.0 - (1.0 - aQuadCorner.x), 1.0 - (1.0 - aQuadCorner.y));
	vec4 position = vec4(aPosition.x * i.spriteSize.x, aPosition.y * i.spriteSize.y, 0.0, 1.0);

	gl_Position = uProjectionMatrix * uViewMatrix * i.modelMatrix * position;
	vColor = i.color;
}
)__SHDR__";
#endif

#if defined(WITH_RHI_GL) && !defined(RHI_GL_PROFILE_ES2)
	inline constexpr char DefaultBatchedSpritesNoTexture_Fs[] =
R"__SHDR__(#line 1

#ifdef GL_ES
precision mediump float;
#endif

in vec4 vColor;

out vec4 COLOR;

void main() {
	COLOR = vColor;
}

)__SHDR__";
#endif

#if defined(WITH_RHI_GL) && defined(RHI_GL_PROFILE_ES2)
	inline constexpr char DefaultBatchedSpritesNoTexture_Fs100[] =
R"__SHDR__(#line 1

precision mediump float;

varying vec4 vColor;


void main() {
	vec4 COLOR;
	COLOR = vColor;
	gl_FragColor = COLOR;
}

)__SHDR__";
#endif

	inline constexpr ShaderCompiler::Uniform DefaultBatchedSpritesNoTexture_Uniforms[] = {
		{ "uProjectionMatrix", ShaderCompiler::UniformType::Mat4, 0 },
		{ "uViewMatrix", ShaderCompiler::UniformType::Mat4, 0 },
	};

	inline constexpr ShaderCompiler::BlockMember DefaultBatchedSpritesNoTexture_Block0_Members[] = {
		{ "instances", ShaderCompiler::UniformType::Struct, ShaderCompiler::SymbolicArraySize, 0 },
	};

	inline constexpr ShaderCompiler::UniformBlock DefaultBatchedSpritesNoTexture_Blocks[] = {
		{ "InstancesBlock", 0, 96, 1, DefaultBatchedSpritesNoTexture_Block0_Members },
	};

	inline constexpr ShaderCompiler::ProgramVariant DefaultBatchedSpritesNoTexture_Variants[] = {
		{ "", "",
#if defined(WITH_RHI_GL) && !defined(RHI_GL_PROFILE_ES2)
			DefaultBatchedSpritesNoTexture_Vs, DefaultBatchedSpritesNoTexture_Fs,
#else
			nullptr, nullptr,
#endif
			2, DefaultBatchedSpritesNoTexture_Uniforms, 1, DefaultBatchedSpritesNoTexture_Blocks, 0, nullptr, 0, nullptr,
#if defined(WITH_RHI_GL) && defined(RHI_GL_PROFILE_ES2)
			DefaultBatchedSpritesNoTexture_Vs100, DefaultBatchedSpritesNoTexture_Fs100,
#else
			nullptr, nullptr,
#endif
#if defined(WITH_RHI_D3D11)
			DefaultBatchedSpritesNoTexture_VsHlsl, DefaultBatchedSpritesNoTexture_FsHlsl,
			DefaultBatchedSpritesNoTexture_VsDxbc, DefaultBatchedSpritesNoTexture_VsDxbcSize, DefaultBatchedSpritesNoTexture_FsDxbc, DefaultBatchedSpritesNoTexture_FsDxbcSize,
#else
			nullptr, nullptr,
			nullptr, 0, nullptr, 0,
#endif
#if defined(WITH_RHI_VULKAN)
			DefaultBatchedSpritesNoTexture_VkVs, DefaultBatchedSpritesNoTexture_VkVsSize, DefaultBatchedSpritesNoTexture_VkFs, DefaultBatchedSpritesNoTexture_VkFsSize },
#else
			nullptr, 0, nullptr, 0 },
#endif
	};

	inline constexpr ShaderCompiler::Program DefaultBatchedSpritesNoTexture = { "DefaultBatchedSpritesNoTexture", 0, 1, DefaultBatchedSpritesNoTexture_Variants };
}
#endif
