From 8855f0b880064fcf0dd2945087c831d027e51950 Mon Sep 17 00:00:00 2001 From: "HuYingzhuo(hugo/hyzboy)" Date: Fri, 12 May 2023 20:28:44 +0800 Subject: [PATCH] renamed MaterialID to MaterialInstanceID --- CMSceneGraph | 2 +- inc/hgl/graph/VKMaterialInstance.h | 4 ++-- inc/hgl/shadergen/ShaderCreateInfoVertex.h | 2 +- src/SceneGraph/RenderNode.cpp | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMSceneGraph b/CMSceneGraph index bc0f03e2..1251e2a7 160000 --- a/CMSceneGraph +++ b/CMSceneGraph @@ -1 +1 @@ -Subproject commit bc0f03e2ba281ec30a331c3d0490e45797da8b17 +Subproject commit 1251e2a735c87995b57c0e7fa3bd41981dee086f diff --git a/inc/hgl/graph/VKMaterialInstance.h b/inc/hgl/graph/VKMaterialInstance.h index 4421870d..203ea89d 100644 --- a/inc/hgl/graph/VKMaterialInstance.h +++ b/inc/hgl/graph/VKMaterialInstance.h @@ -8,7 +8,7 @@ VK_NAMESPACE_BEGIN /** * * -* layout(location=?) in uint MaterialID +* layout(location=?) in uint MaterialInstanceID * * #define MI_MAX_COUNT ??? //该值由引擎根据 UBORange/sizeof(MaterialInstance) 计算出来 * @@ -26,7 +26,7 @@ VK_NAMESPACE_BEGIN * * void main() * { -* MaterialInstance mi=mtl.mi[(MaterialID>=MI_MAX_COUNT)?:0:MaterialID]; //如果超出范围则使用0号材质实例数据 +* MaterialInstance mi=mtl.mi[(MaterialInstanceID>=MI_MAX_COUNT)?:0:MaterialInstanceID]; //如果超出范围则使用0号材质实例数据 * * vec4 BaseColor =mi.BaseColor; * vec4 Emissive =mi.Emissive; diff --git a/inc/hgl/shadergen/ShaderCreateInfoVertex.h b/inc/hgl/shadergen/ShaderCreateInfoVertex.h index 136b7ef2..bb777209 100644 --- a/inc/hgl/shadergen/ShaderCreateInfoVertex.h +++ b/inc/hgl/shadergen/ShaderCreateInfoVertex.h @@ -23,7 +23,7 @@ namespace hgl { constexpr const VAT vat{VertexAttribType::BaseType::UInt,1}; //使用uint8 - AddInput(vat,VAN::MaterialID,VK_VERTEX_INPUT_RATE_VERTEX,VertexInputGroup::MaterialID); + AddInput(vat,VAN::MaterialInstanceID,VK_VERTEX_INPUT_RATE_VERTEX,VertexInputGroup::MaterialInstanceID); } void AddBone() diff --git a/src/SceneGraph/RenderNode.cpp b/src/SceneGraph/RenderNode.cpp index 79d4bf54..6945d142 100644 --- a/src/SceneGraph/RenderNode.cpp +++ b/src/SceneGraph/RenderNode.cpp @@ -273,11 +273,11 @@ namespace hgl if(countGetCount(VertexInputGroup::MaterialID); + const uint mtl_binding_count=vil->GetCount(VertexInputGroup::MaterialInstanceID); if(mtl_binding_count>0) { - if(mtl_binding_count!=1) //只有MaterialID + if(mtl_binding_count!=1) //只有MaterialInstanceID return(false); count+=mtl_binding_count;