mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-10-06 14:09:58 +00:00
Quick tests on payloads
This commit is contained in:
@@ -33,7 +33,8 @@ using TextureInstVector = boost::container::small_vector<TextureInst, 24>;
|
||||
|
||||
constexpr u32 DESCRIPTOR_SIZE = 8;
|
||||
constexpr u32 DESCRIPTOR_SIZE_SHIFT = u32(std::countr_zero(DESCRIPTOR_SIZE));
|
||||
constexpr u32 DESCRIPTOR_MAX_COUNT = 1024;
|
||||
constexpr u32 DESCRIPTOR_MAX_COUNT = 512;
|
||||
constexpr u32 DESCRIPTOR_CBUF_BYTES = 16 * 1024;
|
||||
|
||||
u32 DynamicDescriptorSizeShift(const IR::U32& dynamic_offset) {
|
||||
const IR::Inst* const inst = dynamic_offset.InstRecursive();
|
||||
@@ -48,11 +49,10 @@ u32 DynamicDescriptorSizeShift(const IR::U32& dynamic_offset) {
|
||||
|
||||
u32 DynamicDescriptorCount(u32 base_offset, u32 size_shift, u32 max_descriptors) {
|
||||
auto const descriptor_limit = (std::max)(1U, max_descriptors);
|
||||
auto const max_cbuf_bytes = 16 * descriptor_limit;
|
||||
if (size_shift >= 31 || base_offset >= max_cbuf_bytes)
|
||||
if (size_shift >= 31 || base_offset >= DESCRIPTOR_CBUF_BYTES)
|
||||
return 1;
|
||||
auto const stride = 1U << size_shift;
|
||||
auto const available = max_cbuf_bytes - base_offset;
|
||||
auto const available = DESCRIPTOR_CBUF_BYTES - base_offset;
|
||||
if (available < DESCRIPTOR_SIZE)
|
||||
return 1;
|
||||
auto const available_count = 1U + (available - DESCRIPTOR_SIZE) / stride;
|
||||
|
||||
@@ -152,6 +152,10 @@ struct GPU::Impl {
|
||||
|
||||
/// Tick pending requests within the GPU.
|
||||
void TickWork() {
|
||||
if (last_sync_fence.load(std::memory_order_relaxed) ==
|
||||
current_sync_fence.load(std::memory_order_relaxed)) {
|
||||
return;
|
||||
}
|
||||
std::unique_lock lck{sync_request_mutex};
|
||||
while (!sync_requests.empty()) {
|
||||
auto request = std::move(sync_requests.front());
|
||||
@@ -328,7 +332,7 @@ struct GPU::Impl {
|
||||
|
||||
std::list<std::function<void()>> sync_requests;
|
||||
std::atomic<u64> current_sync_fence{};
|
||||
u64 last_sync_fence{};
|
||||
std::atomic<u64> last_sync_fence{};
|
||||
std::mutex sync_request_mutex;
|
||||
std::condition_variable sync_request_cv;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user