Vertex attributes are now bound automatically to shaders using spirv reflection.

This commit is contained in:
2022-02-27 23:51:29 -08:00
parent 3c948e2337
commit df344d0d7b
8 changed files with 103 additions and 79 deletions

View File

@@ -52,9 +52,9 @@ class KRPipelineManager : public KRContextObject {
public:
KRPipelineManager(KRContext &context);
virtual ~KRPipelineManager();
void createPipelines(KRSurface& surface);
KRPipeline* get(const char* szKey);
KRPipeline *getPipeline(KRSurface& surface, const std::string& shader_name, uint32_t vertexAttributes);
KRPipeline *getPipeline(const std::string &pipeline_name, KRCamera *pCamera, const std::vector<KRPointLight *> &point_lights, const std::vector<KRDirectionalLight *> &directional_lights, const std::vector<KRSpotLight *>&spot_lights, int bone_count, bool bDiffuseMap, bool bNormalMap, bool bSpecMap, bool bReflectionMap, bool bReflectionCubeMap, bool bLightMap, bool bDiffuseMapScale,bool bSpecMapScale, bool bNormalMapScale, bool bReflectionMapScale, bool bDiffuseMapOffset, bool bSpecMapOffset, bool bNormalMapOffset, bool bReflectionMapOffset, bool bAlphaTest, bool bAlphaBlend, KRNode::RenderPass renderPass, bool bRimColor = false);
bool selectPipeline(KRCamera &camera, KRPipeline *pPipeline, const KRViewport &viewport, const Matrix4 &matModel, const std::vector<KRPointLight *> &point_lights, const std::vector<KRDirectionalLight *> &directional_lights, const std::vector<KRSpotLight *>&spot_lights, int bone_count, const KRNode::RenderPass &renderPass, const Vector3 &rim_color, float rim_power, const Vector4 &fade_color);
@@ -66,7 +66,8 @@ public:
KRPipeline *m_active_pipeline;
private:
std::map<std::pair<std::string, std::vector<int> >, KRPipeline *> m_pipelines;
typedef std::map<std::pair<std::string, std::vector<int> >, KRPipeline*> PipelineMap;
PipelineMap m_pipelines;
};
#endif