Change shader handling
This commit is contained in:
@@ -15,6 +15,7 @@ namespace openVulkanoCpp::Vulkan
|
||||
{
|
||||
void EncodeSimpleDrawable(Drawable* instance, Vulkan::VulkanDrawContext* drawContext)
|
||||
{
|
||||
drawContext->EncodeShader(instance->GetShader());
|
||||
Geometry* mesh = dynamic_cast<SimpleDrawable*>(instance)->GetMesh();
|
||||
VulkanGeometry* renderGeo = dynamic_cast<VulkanGeometry*>(mesh->renderGeo);
|
||||
if (!mesh->renderGeo) renderGeo = drawContext->renderer->GetResourceManager().PrepareGeometry(mesh);
|
||||
|
||||
@@ -23,15 +23,15 @@ namespace openVulkanoCpp
|
||||
class Context;
|
||||
class IShaderOwner;
|
||||
|
||||
struct VulkanShader final : virtual public ICloseable, virtual public IRecordable
|
||||
struct VulkanShader final : public ICloseable, public IRecordable
|
||||
{
|
||||
Scene::Shader* shader = nullptr;
|
||||
vk::Device device;
|
||||
std::vector<vk::ShaderModule> shaderModules; // TODO manage live time somewhere else to allow sharing of shader programs
|
||||
std::vector<vk::PipelineShaderStageCreateInfo> shaderStageCreateInfo;
|
||||
vk::Pipeline pipeline; // TODO pipeline and shader config should be split
|
||||
IShaderOwner* owner;
|
||||
Context* context;
|
||||
IShaderOwner* owner = nullptr;
|
||||
Context* context = nullptr;
|
||||
|
||||
VulkanShader() = default;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user