Added libarchive support to Dawn.
This commit is contained in:
@ -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;
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user