renamed to ShaderBufferSource from ShaderBuffer

This commit is contained in:
hyzboy 2025-03-04 22:41:07 +08:00
parent 21c7f36d03
commit b63edb2f89
13 changed files with 54 additions and 62 deletions

2
CMCore

@ -1 +1 @@
Subproject commit b5ef4424d47569447d374f0e86f50e8e04444148 Subproject commit 3f5baa99d0c0a76135b48fa67b43b9c4d58a8332

@ -1 +1 @@
Subproject commit 94686e90e0b8d09319809eda7233b9bc92b65368 Subproject commit 2b286a47b677b285e849fc5fa5afe132ed33948f

View File

@ -62,7 +62,9 @@ public:
void WaitIdle ()const {vkDeviceWaitIdle(attr->device);} void WaitIdle ()const {vkDeviceWaitIdle(attr->device);}
#ifdef _DEBUG
DebugUtils * GetDebugUtils (){return attr->debug_utils;} DebugUtils * GetDebugUtils (){return attr->debug_utils;}
#endif//_DEBUG
public: public:

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include<hgl/graph/mtl/StdMaterial.h> #include<hgl/graph/mtl/StdMaterial.h>
#include<hgl/graph/mtl/ShaderBuffer.h> #include<hgl/graph/mtl/ShaderBufferSource.h>
#include<hgl/math/Vector.h> #include<hgl/math/Vector.h>
STD_MTL_NAMESPACE_BEGIN STD_MTL_NAMESPACE_BEGIN
namespace blinnphong namespace blinnphong

View File

@ -1,18 +0,0 @@
#ifndef HGL_GRAPH_MTL_SHADER_BUFFER_INCLUDE
#define HGL_GRAPH_MTL_SHADER_BUFFER_INCLUDE
#include<hgl/type/DataType.h>
namespace hgl
{
namespace graph
{
struct ShaderBufferSource
{
const char *struct_name;
const char *name;
const char *codes;
};
}//namespace graph
}//namespace hgl
#endif//HGL_GRAPH_MTL_SHADER_BUFFER_INCLUDE

View File

@ -0,0 +1,11 @@
#pragma once
namespace hgl::graph
{
struct ShaderBufferSource
{
const char *struct_name;
const char *name;
const char *codes;
};
}//namespace hgl::graph

View File

@ -2,58 +2,55 @@
#include<hgl/type/String.h> #include<hgl/type/String.h>
#define STD_MTL_NAMESPACE_BEGIN namespace hgl{namespace graph{namespace mtl{ #define STD_MTL_NAMESPACE_BEGIN namespace hgl::graph::mtl{
#define STD_MTL_NAMESPACE_END }}} #define STD_MTL_NAMESPACE_END }
#define STD_MTL_NAMESPACE hgl::graph::mtl #define STD_MTL_NAMESPACE hgl::graph::mtl
#define STD_MTL_NAMESPACE_USING using namespace STD_MTL_NAMESPACE; #define STD_MTL_NAMESPACE_USING using namespace STD_MTL_NAMESPACE;
#define STD_MTL_FUNC_NAMESPACE_BEGIN namespace hgl{namespace graph{namespace mtl{namespace func{ #define STD_MTL_FUNC_NAMESPACE_BEGIN namespace hgl::graph::mtl::func{
#define STD_MTL_FUNC_NAMESPACE_END }}}} #define STD_MTL_FUNC_NAMESPACE_END }
#define STD_MTL_FUNC_NAMESPACE hgl::graph::mtl::func #define STD_MTL_FUNC_NAMESPACE hgl::graph::mtl::func
#define STD_MTL_FUNC_NAMESPACE_USING using namespace STD_MTL_FUNC_NAMESPACE; #define STD_MTL_FUNC_NAMESPACE_USING using namespace STD_MTL_FUNC_NAMESPACE;
namespace hgl namespace hgl::graph
{ {
namespace graph class ShaderCreateInfoVertex;
class ShaderCreateInfoGeometry;
class ShaderCreateInfoFragment;
namespace mtl
{ {
class ShaderCreateInfoVertex; namespace func
class ShaderCreateInfoGeometry;
class ShaderCreateInfoFragment;
namespace mtl
{ {
namespace func }//namespace func
{
}//namespace func
class MaterialCreateInfo; class MaterialCreateInfo;
struct MaterialCreateConfig; struct MaterialCreateConfig;
class StdMaterial class StdMaterial
{ {
protected: protected:
MaterialCreateInfo *mci; MaterialCreateInfo *mci;
protected: protected:
virtual bool BeginCustomShader(){return true;/*some work before create shader*/}; virtual bool BeginCustomShader(){return true;/*some work before create shader*/};
virtual bool CustomVertexShader(ShaderCreateInfoVertex *)=0; virtual bool CustomVertexShader(ShaderCreateInfoVertex *)=0;
virtual bool CustomGeometryShader(ShaderCreateInfoGeometry *){return false;} virtual bool CustomGeometryShader(ShaderCreateInfoGeometry *){return false;}
virtual bool CustomFragmentShader(ShaderCreateInfoFragment *)=0; virtual bool CustomFragmentShader(ShaderCreateInfoFragment *)=0;
virtual bool EndCustomShader(){return true;/*some work after create shader*/}; virtual bool EndCustomShader(){return true;/*some work after create shader*/};
public: public:
StdMaterial(const MaterialCreateConfig *); StdMaterial(const MaterialCreateConfig *);
virtual ~StdMaterial()=default; virtual ~StdMaterial()=default;
virtual MaterialCreateInfo *Create(); virtual MaterialCreateInfo *Create();
};//class StdMaterial };//class StdMaterial
}//namespace mtl }//namespace mtl
}//namespace graph }//namespace hgl::graph
}//namespace hgl

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include<hgl/graph/mtl/StdMaterial.h> #include<hgl/graph/mtl/StdMaterial.h>
#include<hgl/graph/mtl/ShaderBuffer.h> #include<hgl/graph/mtl/ShaderBufferSource.h>
STD_MTL_NAMESPACE_BEGIN STD_MTL_NAMESPACE_BEGIN
constexpr const ShaderBufferSource SBS_ViewportInfo= constexpr const ShaderBufferSource SBS_ViewportInfo=

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include<hgl/graph/mtl/StdMaterial.h> #include<hgl/graph/mtl/StdMaterial.h>
#include<hgl/graph/mtl/ShaderBuffer.h> #include<hgl/graph/mtl/ShaderBufferSource.h>
STD_MTL_NAMESPACE_BEGIN STD_MTL_NAMESPACE_BEGIN

View File

@ -7,7 +7,7 @@
#include<hgl/shadergen/ShaderCreateInfoMap.h> #include<hgl/shadergen/ShaderCreateInfoMap.h>
#include<hgl/graph/RenderTargetOutputConfig.h> #include<hgl/graph/RenderTargetOutputConfig.h>
#include<hgl/graph/mtl/MaterialConfig.h> #include<hgl/graph/mtl/MaterialConfig.h>
#include<hgl/graph/mtl/ShaderBuffer.h> #include<hgl/graph/mtl/ShaderBufferSource.h>
#include<hgl/graph/VKSamplerType.h> #include<hgl/graph/VKSamplerType.h>
namespace hgl::graph namespace hgl::graph

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include<hgl/graph/VKShaderDescriptorSet.h> #include<hgl/graph/VKShaderDescriptorSet.h>
#include<hgl/graph/mtl/ShaderBuffer.h> #include<hgl/graph/mtl/ShaderBufferSource.h>
#include<hgl/type/Map.h> #include<hgl/type/Map.h>
namespace hgl{namespace graph{ namespace hgl{namespace graph{

View File

@ -79,7 +79,7 @@ SET(STD_MTL_3D_SOURCE_FILES ${STD_MTL_HEADER_PATH}/Material3DCreateConfig.h
SET(STD_MTL_SOURCE ${STD_MTL_HEADER_PATH}/MaterialConfig.h SET(STD_MTL_SOURCE ${STD_MTL_HEADER_PATH}/MaterialConfig.h
${STD_MTL_HEADER_PATH}/StdMaterial.h ${STD_MTL_HEADER_PATH}/StdMaterial.h
${STD_MTL_HEADER_PATH}/ShaderBuffer.h ${STD_MTL_HEADER_PATH}/ShaderBufferSource.h
StandardMaterial.cpp StandardMaterial.cpp
MaterialFileData.h MaterialFileData.h
MaterialFileLoader.cpp) MaterialFileLoader.cpp)

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include"MFCamera.h" #include"MFCamera.h"
#include<hgl/graph/mtl/ShaderBuffer.h> #include<hgl/graph/mtl/ShaderBufferSource.h>
STD_MTL_NAMESPACE_BEGIN STD_MTL_NAMESPACE_BEGIN
namespace func namespace func