// Generated by ShaderCompiler from TileMapMesh.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 Jazz2::ShadersGen
{
#if defined(WITH_RHI_GL) && !defined(RHI_GL_PROFILE_ES2)
	inline constexpr char TileMapMesh_Vs[] =
R"__SHDR__(#line 1

in vec2 aPosition;
in vec2 aTexCoords;
in vec4 aColor;

out vec2 vTexCoords;
out vec4 vColor;

uniform mat4 uProjectionMatrix;
uniform mat4 uViewMatrix;

layout (std140) uniform InstanceBlock
{
	mat4 modelMatrix;
	vec4 color;
	vec4 texRect;
	vec2 spriteSize;
	float palOffset;
};



void main()
{
	gl_Position = uProjectionMatrix * uViewMatrix * modelMatrix * vec4(aPosition.x, aPosition.y, 0.0, 1.0);
	vTexCoords = aTexCoords;
	vColor = aColor * color;
}
)__SHDR__";
#endif

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

attribute vec2 aPosition;
attribute vec2 aTexCoords;
attribute vec4 aColor;

varying vec2 vTexCoords;
varying vec4 vColor;

uniform mat4 uProjectionMatrix;
uniform mat4 uViewMatrix;

	uniform mat4 modelMatrix;
	uniform vec4 color;
	uniform vec4 texRect;
	uniform vec2 spriteSize;
	uniform float palOffset;



void main()
{
	gl_Position = uProjectionMatrix * uViewMatrix * modelMatrix * vec4(aPosition.x, aPosition.y, 0.0, 1.0);
	vTexCoords = aTexCoords;
	vColor = aColor * color;
}
)__SHDR__";
#endif

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

#ifdef GL_ES
precision mediump float;
#endif

in vec2 vTexCoords;
in vec4 vColor;

uniform sampler2D uTexture;

out vec4 COLOR;

void main() {
	COLOR = texture(uTexture, vTexCoords) * vColor;
}

)__SHDR__";
#endif

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

precision mediump float;

varying vec2 vTexCoords;
varying vec4 vColor;

uniform sampler2D uTexture;


void main() {
	vec4 COLOR;
	COLOR = texture2D(uTexture, vTexCoords) * vColor;
	gl_FragColor = COLOR;
}

)__SHDR__";
#endif

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

	inline constexpr ShaderCompiler::BlockMember TileMapMesh_Block0_Members[] = {
		{ "modelMatrix", ShaderCompiler::UniformType::Mat4, 0, 0 },
		{ "color", ShaderCompiler::UniformType::Vec4, 0, 64 },
		{ "texRect", ShaderCompiler::UniformType::Vec4, 0, 80 },
		{ "spriteSize", ShaderCompiler::UniformType::Vec2, 0, 96 },
		{ "palOffset", ShaderCompiler::UniformType::Float, 0, 104 },
	};

	inline constexpr ShaderCompiler::UniformBlock TileMapMesh_Blocks[] = {
		{ "InstanceBlock", 112, 0, 5, TileMapMesh_Block0_Members },
	};

	inline constexpr ShaderCompiler::TextureBinding TileMapMesh_Textures[] = {
		{ "uTexture", 0 },
	};

	inline constexpr ShaderCompiler::Attribute TileMapMesh_Attributes[] = {
		{ "aPosition", ShaderCompiler::UniformType::Vec2, -1 },
		{ "aTexCoords", ShaderCompiler::UniformType::Vec2, -1 },
		{ "aColor", ShaderCompiler::UniformType::Vec4, -1 },
	};

	inline constexpr ShaderCompiler::ProgramVariant TileMapMesh_Variants[] = {
		{ "", "",
#if defined(WITH_RHI_GL) && !defined(RHI_GL_PROFILE_ES2)
			TileMapMesh_Vs, TileMapMesh_Fs,
#else
			nullptr, nullptr,
#endif
			2, TileMapMesh_Uniforms, 1, TileMapMesh_Blocks, 1, TileMapMesh_Textures, 3, TileMapMesh_Attributes,
#if defined(WITH_RHI_GL) && defined(RHI_GL_PROFILE_ES2)
			TileMapMesh_Vs100, TileMapMesh_Fs100,
#else
			nullptr, nullptr,
#endif
#if defined(WITH_RHI_D3D11)
			TileMapMesh_VsHlsl, TileMapMesh_FsHlsl,
			TileMapMesh_VsDxbc, TileMapMesh_VsDxbcSize, TileMapMesh_FsDxbc, TileMapMesh_FsDxbcSize,
#else
			nullptr, nullptr,
			nullptr, 0, nullptr, 0,
#endif
#if defined(WITH_RHI_VULKAN)
			TileMapMesh_VkVs, TileMapMesh_VkVsSize, TileMapMesh_VkFs, TileMapMesh_VkFsSize },
#else
			nullptr, 0, nullptr, 0 },
#endif
	};

	inline constexpr ShaderCompiler::Program TileMapMesh = { "TileMapMesh", 0, 1, TileMapMesh_Variants };
}
#endif
