aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/buffer_cache/buffer_cache.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/buffer_cache/buffer_cache.h')
-rw-r--r--src/video_core/buffer_cache/buffer_cache.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h
index 0cd6861b6d..94ef1a48df 100644
--- a/src/video_core/buffer_cache/buffer_cache.h
+++ b/src/video_core/buffer_cache/buffer_cache.h
@@ -36,14 +36,14 @@ BufferCache<P>::BufferCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, R
const s64 device_local_memory = static_cast<s64>(runtime.GetDeviceLocalMemory());
const s64 min_spacing_expected = device_local_memory - 1_GiB;
const s64 min_spacing_critical = device_local_memory - 512_MiB;
- const s64 mem_threshold = std::min(device_local_memory, TARGET_THRESHOLD);
+ const s64 mem_threshold = (std::min)(device_local_memory, TARGET_THRESHOLD);
const s64 min_vacancy_expected = (6 * mem_threshold) / 10;
const s64 min_vacancy_critical = (2 * mem_threshold) / 10;
minimum_memory = static_cast<u64>(
- std::max(std::min(device_local_memory - min_vacancy_expected, min_spacing_expected),
+ (std::max)((std::min)(device_local_memory - min_vacancy_expected, min_spacing_expected),
DEFAULT_EXPECTED_MEMORY));
critical_memory = static_cast<u64>(
- std::max(std::min(device_local_memory - min_vacancy_critical, min_spacing_critical),
+ (std::max)((std::min)(device_local_memory - min_vacancy_critical, min_spacing_critical),
DEFAULT_CRITICAL_MEMORY));
}
@@ -553,8 +553,8 @@ void BufferCache<P>::CommitAsyncFlushesHigh() {
ForEachBufferInRange(device_addr, size, [&](BufferId buffer_id, Buffer& buffer) {
const DAddr buffer_start = buffer.CpuAddr();
const DAddr buffer_end = buffer_start + buffer.SizeBytes();
- const DAddr new_start = std::max(buffer_start, device_addr);
- const DAddr new_end = std::min(buffer_end, device_addr + size);
+ const DAddr new_start = (std::max)(buffer_start, device_addr);
+ const DAddr new_end = (std::min)(buffer_end, device_addr + size);
memory_tracker.ForEachDownloadRange(
new_start, new_end - new_start, false,
[&](u64 device_addr_out, u64 range_size) {
@@ -574,7 +574,7 @@ void BufferCache<P>::CommitAsyncFlushesHigh() {
constexpr u64 align = 64ULL;
constexpr u64 mask = ~(align - 1ULL);
total_size_bytes += (new_size + align - 1) & mask;
- largest_copy = std::max(largest_copy, new_size);
+ largest_copy = (std::max)(largest_copy, new_size);
};
gpu_modified_ranges.ForEachInRange(device_addr_out, range_size,
@@ -729,8 +729,8 @@ void BufferCache<P>::BindHostVertexBuffers() {
}
flags[Dirty::VertexBuffer0 + index] = false;
- host_bindings.min_index = std::min(host_bindings.min_index, index);
- host_bindings.max_index = std::max(host_bindings.max_index, index);
+ host_bindings.min_index = (std::min)(host_bindings.min_index, index);
+ host_bindings.max_index = (std::max)(host_bindings.max_index, index);
any_valid = true;
}
@@ -789,7 +789,7 @@ void BufferCache<P>::BindHostGraphicsUniformBuffer(size_t stage, u32 index, u32
bool needs_bind) {
const Binding& binding = channel_state->uniform_buffers[stage][index];
const DAddr device_addr = binding.device_addr;
- const u32 size = std::min(binding.size, (*channel_state->uniform_buffer_sizes)[stage][index]);
+ const u32 size = (std::min)(binding.size, (*channel_state->uniform_buffer_sizes)[stage][index]);
Buffer& buffer = slot_buffers[binding.buffer_id];
TouchBuffer(buffer, binding.buffer_id);
const bool use_fast_buffer = binding.buffer_id != NULL_BUFFER_ID &&
@@ -956,7 +956,7 @@ void BufferCache<P>::BindHostComputeUniformBuffers() {
Buffer& buffer = slot_buffers[binding.buffer_id];
TouchBuffer(buffer, binding.buffer_id);
const u32 size =
- std::min(binding.size, (*channel_state->compute_uniform_buffer_sizes)[index]);
+ (std::min)(binding.size, (*channel_state->compute_uniform_buffer_sizes)[index]);
SynchronizeBuffer(buffer, binding.device_addr, size);
const u32 offset = buffer.Offset(binding.device_addr);
@@ -1090,7 +1090,7 @@ void BufferCache<P>::UpdateIndexBuffer() {
const u32 address_size = static_cast<u32>(gpu_addr_end - gpu_addr_begin);
const u32 draw_size =
(index_buffer_ref.count + index_buffer_ref.first) * index_buffer_ref.FormatSizeInBytes();
- const u32 size = std::min(address_size, draw_size);
+ const u32 size = (std::min)(address_size, draw_size);
if (size == 0 || !device_addr) {
channel_state->index_buffer = NULL_BINDING;
return;
@@ -1459,7 +1459,7 @@ bool BufferCache<P>::SynchronizeBuffer(Buffer& buffer, DAddr device_addr, u32 si
.size = range_size,
});
total_size_bytes += range_size;
- largest_copy = std::max(largest_copy, range_size);
+ largest_copy = (std::max)(largest_copy, range_size);
});
if (total_size_bytes == 0) {
return true;
@@ -1594,7 +1594,7 @@ void BufferCache<P>::DownloadBufferMemory(Buffer& buffer, DAddr device_addr, u64
constexpr u64 align = 64ULL;
constexpr u64 mask = ~(align - 1ULL);
total_size_bytes += (new_size + align - 1) & mask;
- largest_copy = std::max(largest_copy, new_size);
+ largest_copy = (std::max)(largest_copy, new_size);
};
gpu_modified_ranges.ForEachInRange(device_addr_out, range_size, add_download);
@@ -1715,7 +1715,7 @@ Binding BufferCache<P>::StorageBufferBinding(GPUVAddr ssbo_addr, u32 cbuf_index,
// cbufs, which do not store the sizes adjacent to the addresses, so use the fully
// mapped buffer size for now.
const u32 memory_layout_size = static_cast<u32>(gpu_memory->GetMemoryLayoutSize(gpu_addr));
- return std::min(memory_layout_size, static_cast<u32>(8_MiB));
+ return (std::min)(memory_layout_size, static_cast<u32>(8_MiB));
}();
// Alignment only applies to the offset of the buffer
const u32 alignment = runtime.GetStorageBufferAlignment();