Added libarchive support to Dawn.

This commit is contained in:
2023-10-09 13:16:52 -05:00
parent 4f33f208ea
commit 52c473b029
34 changed files with 488 additions and 140 deletions

View File

@ -143,12 +143,21 @@ void RenderPipeline::renderSceneCamera(Scene *scene, Camera *camera) {
}
#endif
// Inject index into each item
itPassItem = shaderPassItems.begin();
while(itPassItem != shaderPassItems.end()) {
itPassItem->index = itPassItem;
++itPassItem;
}
// Now we've queued everything, let's sort the rendering queue by the priority
std::sort(
shaderPassItems.begin(),
shaderPassItems.end(),
[](struct ShaderPassItem &a, struct ShaderPassItem &b) {
if(a.priority == b.priority) {
// Compare indexes if w is same.
if(a.w == b.w) return a.index < b.index;
return a.w < b.w;
}
return a.priority < b.priority;

View File

@ -8,9 +8,12 @@
#include "display/mesh/Mesh.hpp"
namespace Dawn {
struct ShaderPassItem;
struct ShaderPassItem {
Shader *shader = nullptr;
int32_t priority = 0;
std::vector<struct ShaderPassItem>::iterator index;
Mesh *mesh;
int32_t start = 0;