强制GBUFFER格式,用于调试

This commit is contained in:
hyzboy 2019-07-10 21:48:07 +08:00
parent f4268b02ba
commit ce5bc77185
2 changed files with 15 additions and 10 deletions

View File

@ -147,16 +147,21 @@ private:
gbuffer.extent.height =GBUFFER_HEIGHT;
//根据候选格式表选择格式
const VkFormat position_format =GetCandidateFormat(position_candidate_format, sizeof(position_candidate_format));
const VkFormat color_format =GetCandidateFormat(color_candidate_format, sizeof(color_candidate_format));
const VkFormat normal_format =GetCandidateFormat(normal_candidate_format, sizeof(normal_candidate_format));
const VkFormat depth_format =GetDepthCandidateFormat();
//const VkFormat position_format =GetCandidateFormat(position_candidate_format, sizeof(position_candidate_format));
//const VkFormat color_format =GetCandidateFormat(color_candidate_format, sizeof(color_candidate_format));
//const VkFormat normal_format =GetCandidateFormat(normal_candidate_format, sizeof(normal_candidate_format));
//const VkFormat depth_format =GetDepthCandidateFormat();
if(position_format ==FMT_UNDEFINED
||color_format ==FMT_UNDEFINED
||normal_format ==FMT_UNDEFINED
||depth_format ==FMT_UNDEFINED)
return(false);
//if(position_format ==FMT_UNDEFINED
// ||color_format ==FMT_UNDEFINED
// ||normal_format ==FMT_UNDEFINED
// ||depth_format ==FMT_UNDEFINED)
// return(false);
const VkFormat position_format =FMT_RGBA16F;
const VkFormat color_format =FMT_RGBA16F;
const VkFormat normal_format =FMT_RGBA16F;
const VkFormat depth_format =FMT_D16UN;
gbuffer.position=device->CreateAttachmentTextureColor(position_format, gbuffer.extent.width,gbuffer.extent.height);
gbuffer.color =device->CreateAttachmentTextureColor(color_format, gbuffer.extent.width,gbuffer.extent.height);

View File

@ -141,7 +141,7 @@ public: //material相关
Texture2D *CreateAttachmentTextureDepth(const VkFormat video_format,uint32_t width,uint32_t height)
{
return CreateAttachmentTexture( video_format,width,height,
VK_IMAGE_ASPECT_DEPTH_BIT|VK_IMAGE_ASPECT_STENCIL_BIT,
VK_IMAGE_ASPECT_DEPTH_BIT,//|VK_IMAGE_ASPECT_STENCIL_BIT,
VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,
VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL);
}