[clang, opengl] fix opengl build on PGO build and clang-cl on windows (#3332)

- [backported] opengl: fix PGO build error
(pulled from 34332ab81326c3f2dfae2fd11ff5b18619fedb1e@pflyly/eden-nightly)

- [clang] chore: fix std::min on windows

Signed-off-by: lizzie lizzie@eden-emu.dev
Co-authored-by: DraVee <dravee@dravee.dev>
Co-authored-by: Escary <81011361+pflyly@users.noreply.github.com>
Co-authored-by: Caio Oliveira <caiooliveirafarias0@gmail.com>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3332
Reviewed-by: DraVee <dravee@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Co-authored-by: Lizzie <lizzie@eden-emu.dev>
Co-committed-by: Lizzie <lizzie@eden-emu.dev>
This commit is contained in:
Lizzie 2026-01-18 02:35:57 +01:00 committed by crueter
parent 833a38b443
commit 6ec6ca7c37
No known key found for this signature in database
GPG key ID: 425ACD2D4830EBC6
11 changed files with 23 additions and 17 deletions

View file

@ -1219,7 +1219,7 @@ GLuint ImageView::StorageView(Shader::TextureType texture_type, Shader::ImageFor
const bool is_signed = image_format == Shader::ImageFormat::R8_SINT
|| image_format == Shader::ImageFormat::R16_SINT;
if (!storage_views)
storage_views.emplace();
storage_views = {OpenGL::ImageView::StorageViews{}};
auto& type_views{is_signed ? storage_views->signeds : storage_views->unsigneds};
GLuint& view{type_views[size_t(texture_type)]};
if (view == 0)

View file

@ -184,7 +184,7 @@ private:
QuadIndexedPass quad_index_pass;
bool limit_dynamic_storage_buffers = false;
u32 max_dynamic_storage_buffers = std::numeric_limits<u32>::max();
u32 max_dynamic_storage_buffers = (std::numeric_limits<u32>::max)();
};
struct BufferCacheParams {

View file

@ -756,7 +756,7 @@ void BlockLinearUnswizzle3DPass::Unswizzle(
{
using namespace VideoCommon::Accelerated;
const u32 MAX_BATCH_SLICES = std::min(z_count, image.info.size.depth);
const u32 MAX_BATCH_SLICES = (std::min)(z_count, image.info.size.depth);
if (!image.has_compute_unswizzle_buffer) {
// Allocate exactly what this batch needs
@ -772,7 +772,7 @@ void BlockLinearUnswizzle3DPass::Unswizzle(
scheduler.RequestOutsideRenderPassOperationContext();
for (u32 z_offset = 0; z_offset < z_count; z_offset += MAX_BATCH_SLICES) {
const u32 current_chunk_slices = std::min(MAX_BATCH_SLICES, z_count - z_offset);
const u32 current_chunk_slices = (std::min)(MAX_BATCH_SLICES, z_count - z_offset);
const u32 current_z_start = z_start + z_offset;
UnswizzleChunk(image, swizzled, sw, params, blocks_x, blocks_y,

View file

@ -1632,7 +1632,7 @@ void Image::AllocateComputeUnswizzleBuffer(u32 max_slices) {
// BCn is 4x4x1 blocks
const u32 blocks_x = (info.size.width + block_width - 1) / block_width;
const u32 blocks_y = (info.size.height + block_height - 1) / block_height;
const u32 blocks_z = std::min(max_slices, info.size.depth);
const u32 blocks_z = (std::min)(max_slices, info.size.depth);
const u64 block_count =
static_cast<u64>(blocks_x) *

View file

@ -1468,7 +1468,7 @@ void TextureCache<P>::TickAsyncUnswizzle() {
if (task.current_offset < task.total_size) {
const size_t remaining = task.total_size - task.current_offset;
size_t copy_amount = std::min(swizzle_chunk_size, remaining);
size_t copy_amount = (std::min)(swizzle_chunk_size, remaining);
if (remaining > swizzle_chunk_size) {
copy_amount = (copy_amount / task.bytes_per_slice) * task.bytes_per_slice;
@ -1487,8 +1487,8 @@ void TextureCache<P>::TickAsyncUnswizzle() {
if (complete_slices >= swizzle_slices_per_batch || (is_final_batch && complete_slices > 0)) {
const u32 z_start = static_cast<u32>(task.last_submitted_offset / task.bytes_per_slice);
const u32 slices_to_process = std::min(complete_slices, swizzle_slices_per_batch);
const u32 z_count = std::min(slices_to_process, image.info.size.depth - z_start);
const u32 slices_to_process = (std::min)(complete_slices, swizzle_slices_per_batch);
const u32 z_count = (std::min)(slices_to_process, image.info.size.depth - z_start);
if (z_count > 0) {
const auto uploads = FullUploadSwizzles(task.info);