(WIP) renamed a few values, new SceneTreeToRenderList
This commit is contained in:
@@ -201,13 +201,11 @@ bool VKDebugOut::Init(VkInstance i)
|
||||
create_info.pNext =nullptr;
|
||||
create_info.flags =0;
|
||||
|
||||
create_info.messageSeverity =VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT
|
||||
create_info.messageSeverity =VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT
|
||||
|VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT
|
||||
|VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT;
|
||||
|
||||
create_info.messageType =VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT
|
||||
|VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT
|
||||
|VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT;
|
||||
create_info.messageType =VK_DEBUG_UTILS_MESSAGE_TYPE_FLAG_BITS_MAX_ENUM_EXT;
|
||||
|
||||
create_info.pfnUserCallback =vulkan_debug_utils_callback;
|
||||
create_info.pUserData =this;
|
||||
|
@@ -38,19 +38,19 @@ void DescriptorSetLayoutCreater::Bind(const uint32_t binding,VkDescriptorType de
|
||||
index_by_binding.Add(binding,index);
|
||||
}
|
||||
|
||||
void DescriptorSetLayoutCreater::Bind(const uint32_t *binding,const uint32_t count,VkDescriptorType desc_type,VkShaderStageFlagBits stageFlags)
|
||||
void DescriptorSetLayoutCreater::Bind(const uint32_t *binding,const uint32_t binding_count,VkDescriptorType desc_type,VkShaderStageFlagBits stageFlags)
|
||||
{
|
||||
if(!binding||count<=0)return;
|
||||
if(!binding||binding_count<=0)return;
|
||||
|
||||
const uint old_count=layout_binding_list.GetCount();
|
||||
|
||||
layout_binding_list.PreMalloc(old_count+count);
|
||||
layout_binding_list.PreMalloc(old_count+binding_count);
|
||||
|
||||
VkDescriptorSetLayoutBinding *p=layout_binding_list.GetData()+old_count;
|
||||
|
||||
uint fin_count=0;
|
||||
|
||||
for(uint i=old_count;i<old_count+count;i++)
|
||||
for(uint i=old_count;i<old_count+binding_count;i++)
|
||||
{
|
||||
if(!index_by_binding.KeyExist(*binding))
|
||||
{
|
||||
|
@@ -2,6 +2,7 @@
|
||||
#include<hgl/graph/VKDevice.h>
|
||||
#include<hgl/graph/VKRenderableInstance.h>
|
||||
#include<hgl/graph/VKInlinePipeline.h>
|
||||
#include<hgl/graph/VKVertexAttribBuffer.h>
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
VAB *RenderResource::CreateVAB(VkFormat format,uint32_t count,const void *data,SharingMode sharing_mode)
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include<hgl/graph/VKRenderableInstance.h>
|
||||
#include<hgl/graph/VKMaterialInstance.h>
|
||||
#include<hgl/graph/VKMaterial.h>
|
||||
#include<hgl/graph/VKVertexAttribBuffer.h>
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
RenderableInstance::RenderableInstance(Renderable *r,MaterialInstance *mi,Pipeline *p,const uint32_t count,VkBuffer *bl,VkDeviceSize *bs)
|
||||
@@ -35,7 +36,11 @@ RenderableInstance *CreateRenderableInstance(Renderable *r,MaterialInstance *mi,
|
||||
const int input_count=ssl.GetCount();
|
||||
|
||||
if(r->GetBufferCount()<input_count) //小于材质要求的数量?那自然是不行的
|
||||
{
|
||||
LOG_ERROR("[FATAL ERROR] input buffer count of Renderable lesser than Material, Material name: "+mtl->GetName());
|
||||
|
||||
return(nullptr);
|
||||
}
|
||||
|
||||
AutoDeleteArray<VkBuffer> buffer_list(input_count);
|
||||
AutoDeleteArray<VkDeviceSize> buffer_size(input_count);
|
||||
@@ -53,10 +58,31 @@ RenderableInstance *CreateRenderableInstance(Renderable *r,MaterialInstance *mi,
|
||||
|
||||
vab=r->GetVAB((*ss)->name,buffer_size+i);
|
||||
|
||||
if(!vab)return(nullptr);
|
||||
if(!vab)
|
||||
{
|
||||
LOG_ERROR("[FATAL ERROR] can't find VAB \""+(*ss)->name+"\" in Material: "+mtl->GetName());
|
||||
return(nullptr);
|
||||
}
|
||||
|
||||
if(vab->GetFormat()!=attr->format)return(nullptr);
|
||||
if(vab->GetStride()!=desc->stride)return(nullptr);
|
||||
if(vab->GetFormat()!=attr->format)
|
||||
{
|
||||
LOG_ERROR( "[FATAL ERROR] VAB \""+(*ss)->name+
|
||||
UTF8String("\" format can't match Renderable, Material(")+mtl->GetName()+
|
||||
UTF8String(") Format(")+GetVulkanFormatName(attr->format)+
|
||||
UTF8String("), VAB Format(")+GetVulkanFormatName(vab->GetFormat())+
|
||||
")");
|
||||
return(nullptr);
|
||||
}
|
||||
|
||||
if(vab->GetStride()!=desc->stride)
|
||||
{
|
||||
LOG_ERROR( "[FATAL ERROR] VAB \""+(*ss)->name+
|
||||
UTF8String("\" stride can't match Renderable, Material(")+mtl->GetName()+
|
||||
UTF8String(") stride(")+UTF8String::valueOf(desc->stride)+
|
||||
UTF8String("), VAB stride(")+UTF8String::valueOf(vab->GetStride())+
|
||||
")");
|
||||
return(nullptr);
|
||||
}
|
||||
|
||||
buffer_list[i]=vab->GetBuffer();
|
||||
|
||||
|
Reference in New Issue
Block a user