Add samples ImmutableSampler, InitTexture, InputAttachment (#315)

+ slightly adjust some other samples.
This commit is contained in:
Andreas Süßenbach
2019-04-09 15:19:18 +02:00
committed by Markus Tavenrath
parent d4ddb0a2cd
commit d965a74cc0
18 changed files with 800 additions and 212 deletions

View File

@@ -19,6 +19,13 @@ struct VertexPC
float r, g, b, a; // Color
};
struct VertexPT
{
float x, y, z, w; // Position data
float u, v; // texture u,v
};
static const VertexPC coloredCubeData[] =
{
// red face
@@ -65,3 +72,49 @@ static const VertexPC coloredCubeData[] =
{ -1.0f, -1.0f, -1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f },
};
static const VertexPT texturedCubeData[] =
{
// left face
{ -1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 0.0f },
{ -1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f },
{ -1.0f, -1.0f, 1.0f, 1.0f, 0.0f, 0.0f },
{ -1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f },
{ -1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 0.0f },
{ -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 1.0f },
// front face
{ -1.0f, -1.0f, -1.0f, 1.0f, 0.0f, 0.0f },
{ 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 0.0f },
{ 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 1.0f },
{ -1.0f, -1.0f, -1.0f, 1.0f, 0.0f, 0.0f },
{ 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 1.0f },
{ -1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 1.0f },
// top face
{ -1.0f, -1.0f, -1.0f, 1.0f, 0.0f, 1.0f },
{ 1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 0.0f },
{ 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f },
{ -1.0f, -1.0f, -1.0f, 1.0f, 0.0f, 1.0f },
{ -1.0f, -1.0f, 1.0f, 1.0f, 0.0f, 0.0f },
{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