Skip to content

Commit b9121e9

Browse files
committedSep 3, 2024·
Update parallel-rdp to latest
1 parent 7d8c29d commit b9121e9

22 files changed

+49457
-54243
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
43bc31642cc70d04adb828a285e68cdbde7110a9
1+
fe5becd13638873db90d46e7ba7d48255971f82a

‎src/contrib/parallel-rdp/parallel-rdp-standalone/parallel-rdp/rdp_renderer.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ static int normalize_dzpix(int dz)
716716
else if (dz == 0)
717717
return 1;
718718

719-
unsigned bit = 31 - leading_zeroes(dz);
719+
unsigned bit = 31 - Util::leading_zeroes(dz);
720720
return 1 << (bit + 1);
721721
}
722722

@@ -1680,7 +1680,7 @@ void Renderer::submit_span_setup_jobs(Vulkan::CommandBuffer &cmd, bool upscale)
16801680
cmd.set_buffer_view(1, 0, *instance.gpu.span_info_jobs_view);
16811681
cmd.set_specialization_constant_mask(3);
16821682
cmd.set_specialization_constant(0, (upscale ? caps.upscaling : 1) * ImplementationConstants::DefaultWorkgroupSize);
1683-
cmd.set_specialization_constant(1, upscale ? trailing_zeroes(caps.upscaling) : 0u);
1683+
cmd.set_specialization_constant(1, upscale ? Util::trailing_zeroes(caps.upscaling) : 0u);
16841684

16851685
Vulkan::QueryPoolHandle begin_ts, end_ts;
16861686
if (caps.timestamp >= 2)
@@ -1780,7 +1780,7 @@ void Renderer::submit_rasterization(Vulkan::CommandBuffer &cmd, Vulkan::Buffer &
17801780
if (caps.timestamp >= 2)
17811781
start_ts = cmd.write_timestamp(VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT);
17821782

1783-
uint32_t scale_log2_bit = (upscaling ? trailing_zeroes(caps.upscaling) : 0u) << RASTERIZATION_UPSCALING_LOG2_BIT_OFFSET;
1783+
uint32_t scale_log2_bit = (upscaling ? Util::trailing_zeroes(caps.upscaling) : 0u) << RASTERIZATION_UPSCALING_LOG2_BIT_OFFSET;
17841784

17851785
for (size_t i = 0; i < stream.static_raster_state_cache.size(); i++)
17861786
{
@@ -1891,7 +1891,7 @@ void Renderer::submit_tile_binning_combined(Vulkan::CommandBuffer &cmd, bool ups
18911891
if (supports_subgroup_size_control(32, subgroup_size))
18921892
{
18931893
cmd.enable_subgroup_size_control(true);
1894-
cmd.set_subgroup_size_log2(true, 5, trailing_zeroes(subgroup_size));
1894+
cmd.set_subgroup_size_log2(true, 5, Util::trailing_zeroes(subgroup_size));
18951895
}
18961896
}
18971897
else
@@ -2092,7 +2092,7 @@ void Renderer::submit_depth_blend(Vulkan::CommandBuffer &cmd, Vulkan::Buffer &tm
20922092
cmd.set_specialization_constant(5, Limits::MaxPrimitives);
20932093
cmd.set_specialization_constant(6, upscaled ? caps.max_width : Limits::MaxWidth);
20942094
cmd.set_specialization_constant(7, uint32_t(force_write_mask || (!is_host_coherent && !upscaled)) |
2095-
((upscaled ? trailing_zeroes(caps.upscaling) : 0u) << 1u));
2095+
((upscaled ? Util::trailing_zeroes(caps.upscaling) : 0u) << 1u));
20962096

20972097
if (upscaled)
20982098
cmd.set_storage_buffer(0, 0, *upscaling_multisampled_rdram);

‎src/contrib/parallel-rdp/parallel-rdp-standalone/parallel-rdp/shaders/slangmosh.hpp

+48,826-53,871
Large diffs are not rendered by default.

‎src/contrib/parallel-rdp/parallel-rdp-standalone/parallel-rdp/video_interface.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ Vulkan::ImageHandle VideoInterface::vram_fetch_stage(const Registers &regs, unsi
484484
async_cmd->set_specialization_constant_mask(7);
485485
async_cmd->set_specialization_constant(0, uint32_t(rdram_size));
486486
async_cmd->set_specialization_constant(1, regs.status & (VI_CONTROL_TYPE_MASK | VI_CONTROL_META_AA_BIT));
487-
async_cmd->set_specialization_constant(2, trailing_zeroes(scaling_factor));
487+
async_cmd->set_specialization_constant(2, Util::trailing_zeroes(scaling_factor));
488488

489489
async_cmd->push_constants(&push, 0, sizeof(push));
490490
async_cmd->dispatch((extract_width + 15) / 16,

‎src/contrib/parallel-rdp/parallel-rdp-standalone/util/aligned_alloc.hpp

+4
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,18 @@ struct AlignedAllocation
4040
static void *operator new(size_t size)
4141
{
4242
void *ret = ::Util::memalign_alloc(alignof(T), size);
43+
#ifdef __EXCEPTIONS
4344
if (!ret) throw std::bad_alloc();
45+
#endif
4446
return ret;
4547
}
4648

4749
static void *operator new[](size_t size)
4850
{
4951
void *ret = ::Util::memalign_alloc(alignof(T), size);
52+
#ifdef __EXCEPTIONS
5053
if (!ret) throw std::bad_alloc();
54+
#endif
5155
return ret;
5256
}
5357

‎src/contrib/parallel-rdp/parallel-rdp-standalone/util/bitops.hpp

+23-14
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,22 @@
2929
namespace Util
3030
{
3131
#ifdef __GNUC__
32-
#define leading_zeroes(x) ((x) == 0 ? 32 : __builtin_clz(x))
33-
#define trailing_zeroes(x) ((x) == 0 ? 32 : __builtin_ctz(x))
34-
#define trailing_ones(x) __builtin_ctz(~uint32_t(x))
35-
#define leading_zeroes64(x) ((x) == 0 ? 64 : __builtin_clzll(x))
36-
#define trailing_zeroes64(x) ((x) == 0 ? 64 : __builtin_ctzll(x))
37-
#define trailing_ones64(x) __builtin_ctzll(~uint64_t(x))
38-
#define popcount32(x) __builtin_popcount(x)
32+
#define leading_zeroes_(x) ((x) == 0 ? 32 : __builtin_clz(x))
33+
#define trailing_zeroes_(x) ((x) == 0 ? 32 : __builtin_ctz(x))
34+
#define trailing_ones_(x) __builtin_ctz(~uint32_t(x))
35+
#define leading_zeroes64_(x) ((x) == 0 ? 64 : __builtin_clzll(x))
36+
#define trailing_zeroes64_(x) ((x) == 0 ? 64 : __builtin_ctzll(x))
37+
#define trailing_ones64_(x) __builtin_ctzll(~uint64_t(x))
38+
#define popcount32_(x) __builtin_popcount(x)
39+
40+
static inline uint32_t leading_zeroes(uint32_t x) { return leading_zeroes_(x); }
41+
static inline uint32_t trailing_zeroes(uint32_t x) { return trailing_zeroes_(x); }
42+
static inline uint32_t trailing_ones(uint32_t x) { return trailing_ones_(x); }
43+
static inline uint32_t leading_zeroes64(uint64_t x) { return leading_zeroes64_(x); }
44+
static inline uint32_t trailing_zeroes64(uint64_t x) { return trailing_zeroes64_(x); }
45+
static inline uint32_t trailing_ones64(uint64_t x) { return trailing_ones64_(x); }
46+
static inline uint32_t popcount32(uint32_t x) { return popcount32_(x); }
47+
3948
#elif defined(_MSC_VER)
4049
namespace Internal
4150
{
@@ -81,13 +90,13 @@ static inline uint32_t ctz64(uint64_t x)
8190
}
8291
}
8392

84-
#define popcount32(x) ::Util::Internal::popcount32(x)
85-
#define leading_zeroes(x) ::Util::Internal::clz(x)
86-
#define trailing_zeroes(x) ::Util::Internal::ctz(x)
87-
#define trailing_ones(x) ::Util::Internal::ctz(~uint32_t(x))
88-
#define leading_zeroes64(x) ::Util::Internal::clz64(x)
89-
#define trailing_zeroes64(x) ::Util::Internal::ctz64(x)
90-
#define trailing_ones64(x) ::Util::Internal::ctz64(~uint64_t(x))
93+
static inline uint32_t leading_zeroes(uint32_t x) { return Internal::clz(x); }
94+
static inline uint32_t trailing_zeroes(uint32_t x) { return Internal::ctz(x); }
95+
static inline uint32_t trailing_ones(uint32_t x) { return Internal::ctz(~x); }
96+
static inline uint32_t leading_zeroes64(uint64_t x) { return Internal::clz64(x); }
97+
static inline uint32_t trailing_zeroes64(uint64_t x) { return Internal::ctz64(x); }
98+
static inline uint32_t trailing_ones64(uint64_t x) { return Internal::ctz64(~x); }
99+
static inline uint32_t popcount32(uint32_t x) { return Internal::popcount32(x); }
91100
#else
92101
#error "Implement me."
93102
#endif

‎src/contrib/parallel-rdp/parallel-rdp-standalone/util/timer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ int64_t get_current_time_nsecs()
107107
return int64_t(double(li.QuadPart) * static_qpc_freq.inv_freq);
108108
#else
109109
struct timespec ts = {};
110-
#ifdef ANDROID
110+
#if defined(ANDROID) || defined(__FreeBSD__)
111111
constexpr auto timebase = CLOCK_MONOTONIC;
112112
#else
113113
constexpr auto timebase = CLOCK_MONOTONIC_RAW;
@@ -128,4 +128,4 @@ double Timer::end()
128128
auto nt = get_current_time_nsecs();
129129
return double(nt - t) * 1e-9;
130130
}
131-
}
131+
}

0 commit comments

Comments
 (0)
Please sign in to comment.