Added vertex attributes

This commit is contained in:
Brandon Mak 2022-09-13 09:13:39 +08:00
parent 506d3a1c35
commit 8f7d8cd8bc
4 changed files with 19 additions and 2 deletions

View File

@ -305,7 +305,16 @@ namespace SHADE
void SHImGuiVulkanBackend::SHBreachInstance::InitializePipeline(ImGuiIO& io) noexcept
{
SHVertexInputState vInputState{};
vInputState.AddBinding(false, true,
{
SHVertexAttribute(SHAttribFormat::FLOAT_2D),
SHVertexAttribute(SHAttribFormat::FLOAT_2D),
SHVertexAttribute(SHAttribFormat::UINT32_1D),
}
);
//Handle<SHVkPipeline> newPipeline = device->CreatePipeline()
}
}

View File

@ -35,11 +35,13 @@ namespace SHADE
struct SHBreachInstance : public SHImGuiWindow
{
Handle<SHVkPipeline> pipeline;
Handle<SHVkRenderpass> renderpass;
std::chrono::time_point<std::chrono::steady_clock> lastFrameTime;
Handle<SHVkImage> fontsTexture;
std::vector<uint32_t> fontsMipOffset;
public:
void CreateFontsTexture (Handle<SHVkImage> image, ImGuiIO& io) noexcept;
void InitializeRenderpass (void) noexcept;
void InitializePipeline(ImGuiIO& io) noexcept;
};
public:

View File

@ -117,7 +117,7 @@ namespace SHADE
dirty = isDirty;
}
std::tuple<uint32_t, uint32_t, vk::Format> SHVertexInputState::GetInfoFromAttribFormat(SHAttribFormat attribFormat) const noexcept
std::tuple<SHVertexInputState::numAttribSlots, SHVertexInputState::bytesRequired, vk::Format> SHVertexInputState::GetInfoFromAttribFormat(SHAttribFormat attribFormat) const noexcept
{
switch (attribFormat)
{
@ -138,6 +138,9 @@ namespace SHADE
case SHAttribFormat::MAT_4D:
return std::make_tuple(4, 16, vk::Format::eR32G32B32A32Sfloat);
break;
case SHAttribFormat::UINT32_1D:
return std::make_tuple(1, 4, vk::Format::eR32Uint);
}
return std::make_tuple(0, 0, vk::Format::eR32Sfloat);
}

View File

@ -18,7 +18,10 @@ namespace SHADE
// that a mat2 can be interpreted as (x, y, x, y), (o, o, o, o) instead of (x, y, o, o), (o, o, o, o)?
MAT_2D,
MAT_3D,
MAT_4D
MAT_4D,
// integer formats
UINT32_1D,
};
struct SHVertexAttribute