lots of updates
This commit is contained in:
@@ -37,6 +37,11 @@ void CVkShader::AddOutputImage( int iImageIndex, EImageFormat eFormat )
|
||||
|
||||
void CVkShader::SetDepthImage( EImageFormat eFormat )
|
||||
{
|
||||
m_eDepthFormat = CVkImage::GetImageFormat(eFormat);
|
||||
}
|
||||
void CVkShader::DisablePixelShader( bool bDisable )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -71,12 +76,11 @@ void CVkShader::Build()
|
||||
VulkanInputMetaData_t *pMetaData = (VulkanInputMetaData_t*)m_shader.GetLumpPtr(m_shader.m_objects[i].m_nMetadataLump);
|
||||
for ( int u = 0; u < pMetaData->nDescriptorsCount; u++ )
|
||||
{
|
||||
VulkanDescriptor_t *pDescriptor = (VulkanDescriptor_t*)m_shader.GetLumpPtr(pMetaData->pDescriptorSets);
|
||||
V_printf("%s\n" ,pDescriptor->szName);
|
||||
VulkanDescriptor_t stDescriptor = ((VulkanDescriptor_t*)m_shader.GetLumpPtr(pMetaData->pDescriptorSets))[u];
|
||||
bool bFound = false;
|
||||
for ( auto &b: bindings )
|
||||
{
|
||||
if (b.binding != pDescriptor->uBinding)
|
||||
if (b.binding != stDescriptor.uBinding)
|
||||
continue;
|
||||
bFound = true;
|
||||
break;
|
||||
@@ -84,12 +88,12 @@ void CVkShader::Build()
|
||||
if (bFound)
|
||||
break;
|
||||
VkDescriptorSetLayoutBinding bind = {};
|
||||
bind.binding = pDescriptor->uBinding;
|
||||
bind.binding = stDescriptor.uBinding;
|
||||
bind.descriptorCount = 1;
|
||||
bind.descriptorType = pDescriptor->eDescriptorType;
|
||||
bind.descriptorType = stDescriptor.eDescriptorType;
|
||||
bind.stageFlags = VK_SHADER_STAGE_ALL;
|
||||
bindings.AppendTail(bind);
|
||||
m_bindings.AppendTail(*pDescriptor);
|
||||
m_bindings.AppendTail(stDescriptor);
|
||||
}
|
||||
modules[i].sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;
|
||||
modules[i].pCode = (uint32_t*)m_shader.GetLumpPtr(m_shader.m_objects[i].m_nDataLump);
|
||||
@@ -146,6 +150,13 @@ void CVkShader::Build()
|
||||
render.pColorAttachmentFormats = m_eFormats.GetData();
|
||||
|
||||
depthStencil.sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO;
|
||||
if (m_eDepthFormat == VK_FORMAT_D32_SFLOAT)
|
||||
{
|
||||
depthStencil.depthTestEnable = VK_TRUE;
|
||||
depthStencil.depthWriteEnable = VK_TRUE;
|
||||
depthStencil.depthCompareOp = VK_COMPARE_OP_LESS;
|
||||
render.depthAttachmentFormat = m_eDepthFormat;
|
||||
}
|
||||
|
||||
for ( auto e: m_eFormats )
|
||||
{
|
||||
@@ -159,10 +170,6 @@ void CVkShader::Build()
|
||||
blend.attachmentCount = attachments.GetSize();
|
||||
blend.pAttachments = attachments.GetData();
|
||||
|
||||
render.sType = VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO;
|
||||
render.colorAttachmentCount = m_eFormats.GetSize();
|
||||
render.pColorAttachmentFormats = m_eFormats.GetData();
|
||||
|
||||
createInfo.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
|
||||
createInfo.stageCount = stages.GetSize();
|
||||
createInfo.pStages = stages.GetData();
|
||||
|
||||
Reference in New Issue
Block a user