#pragma once #include // simple wrapper of dk mesh class StaticMesh { public: StaticMesh(); bool LoadMeshResourceFromFile(DKObject inDevice , DKResourcePool& inDKResourcePool, const DKString& inFileName); bool LoadShaderFromFile(DKResourcePool& inDKResourcePool , const DKString& inFileName , DKShaderStage inStage); // Should be seperated bool LoadTextureFromFile(DKResourcePool& inDKResourcePool , const DKString& inFileName); bool LoadRenderResourceTexture(DKObject queue); bool LoadRenderResourceShader(DKObject inDevice, DKShaderStage inStage); DKObject Mesh() { return mesh; } void SetupPipelineDecriptor(DKRenderPipelineDescriptor& pipelineDescriptor); void SetupMaterial(DKObject inDevice); void SetupExternalUniformBuffer(DKObject uniformBuffer , size_t uniformBufferSize, int index); bool EncodeRenderCommand(DKRenderCommandEncoder* encoder) const; private: DKString fileName; DKObject mesh; // Temporary variables before material work DKObject textureSrc; DKObject texture; DKObject textureSampler; DKObject bindSet; DKObject shaderData[static_cast(DKShaderStage::Compute)]; DKObject shaderModule[static_cast(DKShaderStage::Compute)]; DKObject shaderFunction[static_cast(DKShaderStage::Compute)]; DKAabb aabb; };