Skip to content

Commit c34a1e3

Browse files
committed
improved rendering
1 parent bc470e7 commit c34a1e3

File tree

5 files changed

+179
-317
lines changed

5 files changed

+179
-317
lines changed

src/backend/position/position.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ class Position::Iterator {
300300
}
301301
inline explicit operator bool() const noexcept { return notDone; }
302302
inline const Position operator*() const noexcept { return start + Vector(cur % width, cur / width); }
303-
inline const Position operator->() const noexcept { return *(*this); }
303+
// inline const Position operator->() const noexcept { return *(*this); }
304304

305305
private:
306306
inline void next() {
@@ -440,7 +440,7 @@ struct Size {
440440

441441
inline Iterator iter() const noexcept;
442442

443-
inline Vector getLargestVectorInArea() { return Vector(w - 1, h - 1); }
443+
inline Vector getLargestVectorInArea() const noexcept { return Vector(w - 1, h - 1); }
444444

445445
coordinate_t w, h;
446446
};

src/gpu/renderer/viewport/logic/chunking/chunkRenderer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void ChunkRenderer::cleanup() {
6868
wirePipeline.cleanup();
6969
}
7070

71-
void ChunkRenderer::render(Frame& frame, const glm::mat4& viewMatrix, Evaluator* evaluator, const Address& address, const std::vector<std::shared_ptr<VulkanChunkAllocation>>& chunks) {
71+
void ChunkRenderer::render(Frame& frame, const glm::mat4& viewMatrix, Evaluator* evaluator, const Address& address, const std::vector<std::shared_ptr<VulkanLogicAllocation>>& chunks) {
7272
#ifdef TRACY_PROFILER
7373
ZoneScoped;
7474
#endif
@@ -82,7 +82,7 @@ void ChunkRenderer::render(Frame& frame, const glm::mat4& viewMatrix, Evaluator*
8282
pushConstants.mvp = viewMatrix;
8383

8484
// fill state buffers
85-
for (std::shared_ptr<VulkanChunkAllocation> chunk : chunks) {
85+
for (std::shared_ptr<VulkanLogicAllocation> chunk : chunks) {
8686
if (chunk->getStateBuffer().has_value()) {
8787
chunk->getStateBuffer()->incrementBufferFrame();
8888

@@ -111,7 +111,7 @@ void ChunkRenderer::render(Frame& frame, const glm::mat4& viewMatrix, Evaluator*
111111
frame.lifetime.push(blockTexture);
112112
vkCmdBindDescriptorSets(frame.mainCommandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, blockPipeline.getLayout(), 1, 1, &blockTexture->descriptor, 0, nullptr);
113113

114-
for (std::shared_ptr<VulkanChunkAllocation> chunk : chunks) {
114+
for (std::shared_ptr<VulkanLogicAllocation> chunk : chunks) {
115115
if (chunk->getBlockBuffer().has_value()) {
116116

117117
// bind vertex buffers
@@ -147,7 +147,7 @@ void ChunkRenderer::render(Frame& frame, const glm::mat4& viewMatrix, Evaluator*
147147
// bind push constants
148148
wirePipeline.cmdPushConstants(frame.mainCommandBuffer, &pushConstants);
149149

150-
for (std::shared_ptr<VulkanChunkAllocation> chunk : chunks) {
150+
for (std::shared_ptr<VulkanLogicAllocation> chunk : chunks) {
151151
if (chunk->getWireBuffer().has_value()) {
152152

153153
// bind vertex buffers

src/gpu/renderer/viewport/logic/chunking/chunkRenderer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ChunkRenderer {
1515
void init(VulkanDevice* device, VkRenderPass& renderPass);
1616
void cleanup();
1717

18-
void render(Frame& frame, const glm::mat4& viewMatrix, Evaluator* evaluator, const Address& address, const std::vector<std::shared_ptr<VulkanChunkAllocation>>& chunks);
18+
void render(Frame& frame, const glm::mat4& viewMatrix, Evaluator* evaluator, const Address& address, const std::vector<std::shared_ptr<VulkanLogicAllocation>>& chunks);
1919

2020
private:
2121
Pipeline blockPipeline;

0 commit comments

Comments
 (0)