Vulkan: Uber shader support

This commit is contained in:
Stenzek
2017-07-20 15:25:35 +10:00
parent 4bf5625895
commit 81b4ed2a81
16 changed files with 738 additions and 164 deletions

View File

@ -150,7 +150,7 @@ layout(std140, push_constant) uniform PCBlock {
vec4 color;
} PC;
layout(set = 1, binding = 0) uniform sampler2D samp0;
layout(set = 1, binding = 0) uniform sampler2DArray samp0;
layout(location = 0) in vec2 uv0;
@ -158,7 +158,7 @@ layout(location = 0) out vec4 ocol0;
void main()
{
ocol0 = texture(samp0, uv0) * PC.color;
ocol0 = texture(samp0, float3(uv0, 0.0)) * PC.color;
}
)";
@ -209,7 +209,7 @@ bool RasterFont::CreateTexture()
// create the actual texture object
m_texture = Texture2D::Create(CHARACTER_WIDTH * CHARACTER_COUNT, CHARACTER_HEIGHT, 1, 1,
VK_FORMAT_R8G8B8A8_UNORM, VK_SAMPLE_COUNT_1_BIT,
VK_IMAGE_VIEW_TYPE_2D, VK_IMAGE_TILING_OPTIMAL,
VK_IMAGE_VIEW_TYPE_2D_ARRAY, VK_IMAGE_TILING_OPTIMAL,
VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT);
if (!m_texture)
return false;