- replaced MIN/MAX in common code.

This commit is contained in:
Christoph Oelckers 2021-10-30 10:46:17 +02:00
commit eb69bbcae0
63 changed files with 200 additions and 236 deletions

View file

@ -218,8 +218,8 @@ int VkHardwareTexture::GetMipLevels(int w, int h)
int levels = 1;
while (w > 1 || h > 1)
{
w = std::max(w >> 1, 1);
h = std::max(h >> 1, 1);
w = max(w >> 1, 1);
h = max(h >> 1, 1);
levels++;
}
return levels;
@ -391,7 +391,7 @@ VulkanDescriptorSet* VkMaterial::GetDescriptorSet(const FMaterialState& state)
int numLayers = NumLayers();
auto fb = GetVulkanFrameBuffer();
auto descriptor = fb->GetRenderPassManager()->AllocateTextureDescriptorSet(std::max(numLayers, SHADER_MIN_REQUIRED_TEXTURE_LAYERS));
auto descriptor = fb->GetRenderPassManager()->AllocateTextureDescriptorSet(max(numLayers, SHADER_MIN_REQUIRED_TEXTURE_LAYERS));
descriptor->SetDebugName("VkHardwareTexture.mDescriptorSets");

View file

@ -117,8 +117,8 @@ void VkTextureImage::GenerateMipmaps(VulkanCommandBuffer *cmdbuffer)
barrier0.execute(cmdbuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT);
Layout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;
int nextWidth = std::max(mipWidth >> 1, 1);
int nextHeight = std::max(mipHeight >> 1, 1);
int nextWidth = max(mipWidth >> 1, 1);
int nextHeight = max(mipHeight >> 1, 1);
VkImageBlit blit = {};
blit.srcOffsets[0] = { 0, 0, 0 };