Skip to content

Commit

Permalink
wip: async csv; bundlehistory
Browse files Browse the repository at this point in the history
  • Loading branch information
ichinii committed Aug 6, 2024
1 parent de1ce91 commit 9b07001
Show file tree
Hide file tree
Showing 13 changed files with 205 additions and 276 deletions.
65 changes: 65 additions & 0 deletions Intern/rayx-core/src/EventList.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#pragma once

#include <vector>
#include <span>

#include "Shader/Ray.h"

namespace RAYX {

struct RAYX_API EventList {
std::vector<Ray> events;
std::vector<std::span<Ray>> rays;

static EventList concat(std::vector<EventList>&& lists) {
const auto numEvents = std::accumulate(lists.begin(), lists.end(), 0, [] (int sum, const auto& events) { return sum + events.size(); });

auto allEvents = std::vector<Ray>();
auto allRays = std::vector<std::span<Ray>>();
allEvents.reserve(numEvents);
allRays.reserve(numEvents);

for (auto& list : lists) {
allEvents.insert(allEvents.end(), list.events.begin(), list.events.end());

auto rays = std::view::transform(
list.rays,
[&] (const auto span) {
const auto offset = span.data() - list.events.data();
const auto size = span.size();
return std::span<Ray>(
allEvents.data() + offset,
size
);
}
);
allRays.insert(allRays.end(), rays.begin(), rays.end());
}

return EventList {
.events = std::move(events),
.rays = std::move(rays),
};
}
};

class RAYX_API EventList {
public:

const std::vector<Ray>& events() const { return m_events; }

void push_back(const std::vector<Ray>& ray) {
m_offsets.push_back(m_events.size());
m_counts.push_back(ray.size());
m_events.insert(m_events.end(), ray.begin(), ray.end());
}

iterator insert(const_iterator pos, const std::vector<Ray>& ray)

private:
std::vector<Ray> m_events;
std::vector<int> m_offsets;
std::vector<int> m_counts;
};

} // namespace RAYX
6 changes: 0 additions & 6 deletions Intern/rayx-core/src/RAY-Core.h

This file was deleted.

152 changes: 0 additions & 152 deletions Intern/rayx-core/src/Tracer/Scheduler.cpp

This file was deleted.

40 changes: 0 additions & 40 deletions Intern/rayx-core/src/Tracer/Scheduler.h

This file was deleted.

Loading

0 comments on commit 9b07001

Please sign in to comment.