[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

@ -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) *