Removed KRSurface dependencies from KRPipeline

This commit is contained in:
2022-09-28 22:16:04 -07:00
parent 230783b3c9
commit eecde09734
3 changed files with 1 additions and 9 deletions

View File

@@ -109,12 +109,6 @@ const char* KRPipeline::KRENGINE_PUSH_CONSTANT_NAMES[] = {
"fade_color", // PushConstant::fade_color "fade_color", // PushConstant::fade_color
}; };
KRPipeline::KRPipeline(KRContext& context, KRSurface& surface, const PipelineInfo& info, const char* szKey, const std::vector<KRShader*>& shaders, uint32_t vertexAttributes, ModelFormat modelFormat)
: KRPipeline(context, surface.m_deviceHandle, surface.getForwardOpaquePass(), surface.getDimensions(), surface.getDimensions(), info, szKey, shaders, vertexAttributes, modelFormat)
{
// TODO - renderPass needs to be selected dynamically from info.render_pass
}
KRPipeline::KRPipeline(KRContext& context, KrDeviceHandle deviceHandle, KRRenderPass& renderPass, Vector2i viewport_size, Vector2i scissor_size, const PipelineInfo& info, const char* szKey, const std::vector<KRShader*>& shaders, uint32_t vertexAttributes, ModelFormat modelFormat) KRPipeline::KRPipeline(KRContext& context, KrDeviceHandle deviceHandle, KRRenderPass& renderPass, Vector2i viewport_size, Vector2i scissor_size, const PipelineInfo& info, const char* szKey, const std::vector<KRShader*>& shaders, uint32_t vertexAttributes, ModelFormat modelFormat)
: KRContextObject(context) : KRContextObject(context)
, m_deviceHandle(deviceHandle) , m_deviceHandle(deviceHandle)

View File

@@ -41,7 +41,6 @@
class KRSampler; class KRSampler;
class KRShader; class KRShader;
class KRSurface;
class KRRenderPass; class KRRenderPass;
class KRUniformBuffer; class KRUniformBuffer;
class KRTexture; class KRTexture;
@@ -216,7 +215,6 @@ class KRPipeline : public KRContextObject
public: public:
KRPipeline(KRContext& context, KrDeviceHandle deviceHandle, KRRenderPass& renderPass, Vector2i viewport_size, Vector2i scissor_size, const PipelineInfo& info, const char* szKey, const std::vector<KRShader*>& shaders, uint32_t vertexAttributes, ModelFormat modelFormat); KRPipeline(KRContext& context, KrDeviceHandle deviceHandle, KRRenderPass& renderPass, Vector2i viewport_size, Vector2i scissor_size, const PipelineInfo& info, const char* szKey, const std::vector<KRShader*>& shaders, uint32_t vertexAttributes, ModelFormat modelFormat);
KRPipeline(KRContext& context, KRSurface& surface, const PipelineInfo& info, const char* szKey, const std::vector<KRShader*>& shaders, uint32_t vertexAttributes, ModelFormat modelFormat);
virtual ~KRPipeline(); virtual ~KRPipeline();
const char* getKey() const; const char* getKey() const;

View File

@@ -83,7 +83,7 @@ KRPipeline* KRPipelineManager::getPipeline(KRSurface& surface, const PipelineInf
std::vector<KRShader*> shaders; std::vector<KRShader*> shaders;
shaders.push_back(m_pContext->getShaderManager()->get(*info.shader_name + ".vert", "spv")); shaders.push_back(m_pContext->getShaderManager()->get(*info.shader_name + ".vert", "spv"));
shaders.push_back(m_pContext->getShaderManager()->get(*info.shader_name + ".frag", "spv")); shaders.push_back(m_pContext->getShaderManager()->get(*info.shader_name + ".frag", "spv"));
KRPipeline* pipeline = new KRPipeline(*m_pContext, surface, info, info.shader_name->c_str(), shaders, info.vertexAttributes, info.modelFormat); KRPipeline* pipeline = new KRPipeline(*m_pContext, surface.m_deviceHandle, surface.getForwardOpaquePass(), surface.getDimensions(), surface.getDimensions(), info, info.shader_name->c_str(), shaders, info.vertexAttributes, info.modelFormat);
m_pipelines[key] = pipeline; m_pipelines[key] = pipeline;