mirror of
https://github.com/libretro/RetroArch
synced 2025-03-01 16:13:40 +00:00
Don't use std::min/std::max
This commit is contained in:
parent
c99c5399f5
commit
b4e5a8fb70
@ -2145,10 +2145,11 @@ bool gl3_filter_chain::init_history()
|
||||
common.original_history.clear();
|
||||
|
||||
for (i = 0; i < passes.size(); i++)
|
||||
required_images =
|
||||
std::max(required_images,
|
||||
passes[i]->get_reflection().semantic_textures[
|
||||
SLANG_TEXTURE_SEMANTIC_ORIGINAL_HISTORY].size());
|
||||
{
|
||||
size_t _y = passes[i]->get_reflection().semantic_textures[
|
||||
SLANG_TEXTURE_SEMANTIC_ORIGINAL_HISTORY].size();
|
||||
required_images = MAX(required_images, _y);
|
||||
}
|
||||
|
||||
if (required_images < 2)
|
||||
{
|
||||
|
@ -1110,10 +1110,11 @@ bool vulkan_filter_chain::init_history()
|
||||
common.original_history.clear();
|
||||
|
||||
for (i = 0; i < passes.size(); i++)
|
||||
required_images =
|
||||
std::max(required_images,
|
||||
passes[i]->get_reflection().semantic_textures[
|
||||
SLANG_TEXTURE_SEMANTIC_ORIGINAL_HISTORY].size());
|
||||
{
|
||||
size_t _y = passes[i]->get_reflection().semantic_textures[
|
||||
SLANG_TEXTURE_SEMANTIC_ORIGINAL_HISTORY].size();
|
||||
required_images = MAX(required_images, _y);
|
||||
}
|
||||
|
||||
if (required_images < 2)
|
||||
{
|
||||
@ -2591,10 +2592,10 @@ Framebuffer::Framebuffer(
|
||||
unsigned max_levels) :
|
||||
size(max_size),
|
||||
format(format),
|
||||
max_levels(std::max(max_levels, 1u)),
|
||||
memory_properties(mem_props),
|
||||
device(device)
|
||||
{
|
||||
max_levels = MAX(max_levels, 1u);
|
||||
RARCH_LOG("[Vulkan filter chain]: Creating framebuffer %ux%u (max %u level(s)).\n",
|
||||
max_size.width, max_size.height, max_levels);
|
||||
vulkan_initialize_render_pass(device, format, &render_pass);
|
||||
@ -2608,6 +2609,7 @@ void Framebuffer::init(DeferredDisposer *disposer)
|
||||
VkImageCreateInfo info;
|
||||
VkMemoryAllocateInfo alloc;
|
||||
VkImageViewCreateInfo view_info;
|
||||
size_t _y = glslang_num_miplevels(size.width, size.height);
|
||||
|
||||
info.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
|
||||
info.pNext = NULL;
|
||||
@ -2617,8 +2619,7 @@ void Framebuffer::init(DeferredDisposer *disposer)
|
||||
info.extent.width = size.width;
|
||||
info.extent.height = size.height;
|
||||
info.extent.depth = 1;
|
||||
info.mipLevels = std::min(max_levels,
|
||||
glslang_num_miplevels(size.width, size.height));
|
||||
info.mipLevels = MIN(max_levels, _y);
|
||||
info.arrayLayers = 1;
|
||||
info.samples = VK_SAMPLE_COUNT_1_BIT;
|
||||
info.tiling = VK_IMAGE_TILING_OPTIMAL;
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <algorithm>
|
||||
#include <stdio.h>
|
||||
#include <compat/strl.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
#include "glslang_util.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
@ -523,40 +524,44 @@ bool slang_reflect(
|
||||
|
||||
if (vertex_ubo)
|
||||
{
|
||||
size_t _y;
|
||||
reflection->ubo_stage_mask |= SLANG_STAGE_VERTEX_MASK;
|
||||
reflection->ubo_size = std::max(reflection->ubo_size,
|
||||
vertex_compiler.get_declared_struct_size(
|
||||
_y = vertex_compiler.get_declared_struct_size(
|
||||
vertex_compiler.get_type(
|
||||
vertex.uniform_buffers[0].base_type_id)));
|
||||
vertex.uniform_buffers[0].base_type_id));
|
||||
reflection->ubo_size = MAX(reflection->ubo_size, _y);
|
||||
}
|
||||
|
||||
if (fragment_ubo)
|
||||
{
|
||||
size_t _y;
|
||||
reflection->ubo_stage_mask |= SLANG_STAGE_FRAGMENT_MASK;
|
||||
reflection->ubo_size = std::max(reflection->ubo_size,
|
||||
fragment_compiler.get_declared_struct_size(
|
||||
_y = fragment_compiler.get_declared_struct_size(
|
||||
fragment_compiler.get_type(
|
||||
fragment.uniform_buffers[0].base_type_id)));
|
||||
fragment.uniform_buffers[0].base_type_id));
|
||||
reflection->ubo_size = MAX(reflection->ubo_size, _y);
|
||||
}
|
||||
|
||||
if (vertex_push)
|
||||
{
|
||||
size_t _y;
|
||||
reflection->push_constant_stage_mask |= SLANG_STAGE_VERTEX_MASK;
|
||||
reflection->push_constant_size = std::max(
|
||||
reflection->push_constant_size,
|
||||
vertex_compiler.get_declared_struct_size(
|
||||
_y = vertex_compiler.get_declared_struct_size(
|
||||
vertex_compiler.get_type(
|
||||
vertex.push_constant_buffers[0].base_type_id)));
|
||||
vertex.push_constant_buffers[0].base_type_id));
|
||||
reflection->push_constant_size = MAX(
|
||||
reflection->push_constant_size, _y);
|
||||
}
|
||||
|
||||
if (fragment_push)
|
||||
{
|
||||
size_t _y;
|
||||
reflection->push_constant_stage_mask |= SLANG_STAGE_FRAGMENT_MASK;
|
||||
reflection->push_constant_size = std::max(
|
||||
reflection->push_constant_size,
|
||||
fragment_compiler.get_declared_struct_size(
|
||||
_y = fragment_compiler.get_declared_struct_size(
|
||||
fragment_compiler.get_type(
|
||||
fragment.push_constant_buffers[0].base_type_id)));
|
||||
fragment.push_constant_buffers[0].base_type_id));
|
||||
reflection->push_constant_size = MAX(
|
||||
reflection->push_constant_size, _y);
|
||||
}
|
||||
|
||||
/* Validate push constant size against Vulkan's
|
||||
|
Loading…
x
Reference in New Issue
Block a user