Compare commits
1 Commits
docs-updat
...
pf/cmd-buf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2ae43e0e1 |
@@ -901,6 +901,10 @@ void RenderPass::Executor::execute(FEngine const& engine, DriverApi& driver,
|
||||
size_t const capacity = engine.getMinCommandBufferSize();
|
||||
CircularBuffer const& circularBuffer = driver.getCircularBuffer();
|
||||
|
||||
utils::slog.e <<"circularBuffer: " << circularBuffer.size() << " used: " <<
|
||||
circularBuffer.getUsed() <<
|
||||
" commandCount: " << last - first << utils::io::endl;
|
||||
|
||||
// b/479079631: Log the number of commands in this render pass.
|
||||
size_t const commandCount = last - first;
|
||||
if (Platform* platform = engine.getPlatform(); platform->hasDebugUpdateStatFunc()) {
|
||||
|
||||
@@ -264,8 +264,9 @@ FEngine::FEngine(Builder const& builder) :
|
||||
mLightManager(*this),
|
||||
mCameraManager(*this),
|
||||
mCommandBufferQueue(
|
||||
builder->mConfig.minCommandBufferSizeMB * MiB,
|
||||
builder->mConfig.minCommandBufferSizeMB * MiB,
|
||||
builder->mConfig.commandBufferSizeMB * MiB,
|
||||
// builder->mConfig.commandBufferSizeMB * MiB,
|
||||
builder->mPaused),
|
||||
mPerRenderPassArena(
|
||||
"FEngine::mPerRenderPassAllocator",
|
||||
@@ -277,6 +278,7 @@ FEngine::FEngine(Builder const& builder) :
|
||||
mMainThreadId(ThreadUtils::getThreadId()),
|
||||
mConfig(builder->mConfig)
|
||||
{
|
||||
|
||||
// update all the features flags specified in the builder
|
||||
for (auto const& [feature, value] : builder->mFeatureFlags) {
|
||||
auto* const p = getFeatureFlagPtr(feature.c_str_safe(), true);
|
||||
@@ -348,7 +350,6 @@ void FEngine::init() {
|
||||
LOG(INFO) << "Backend feature level: " << int(driverApi.getFeatureLevel());
|
||||
LOG(INFO) << "FEngine feature level: " << int(mActiveFeatureLevel);
|
||||
|
||||
|
||||
mResourceAllocatorDisposer = std::make_shared<TextureCacheDisposer>(driverApi);
|
||||
|
||||
mFullScreenTriangleVb = downcast(VertexBuffer::Builder()
|
||||
@@ -744,12 +745,13 @@ void FEngine::prepare(DriverApi& driver) {
|
||||
if (item->getMaterial()->getMaterialDomain() == MaterialDomain::SURFACE) {
|
||||
// If the remaining space is less than half the capacity, we flush right
|
||||
// away to allow some headroom for commands that might come later.
|
||||
if (UTILS_UNLIKELY(driver.getCircularBuffer().getUsed() > capacity / 2)) {
|
||||
if (UTILS_UNLIKELY(driver.getCircularBuffer().getUsed() > capacity / 2) && false) {
|
||||
flush();
|
||||
}
|
||||
item->commit(driver, uboManager);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
if (useUboBatching) {
|
||||
|
||||
@@ -36,13 +36,20 @@
|
||||
#include <iostream>
|
||||
#include <string>// for printing usage/help
|
||||
|
||||
#include "filament/MaterialInstance.h"
|
||||
#include "generated/resources/resources.h"
|
||||
#include "generated/resources/monkey.h"
|
||||
|
||||
#include <utils/Log.h>
|
||||
|
||||
using namespace filament;
|
||||
using namespace filamesh;
|
||||
using namespace filament::math;
|
||||
|
||||
namespace {
|
||||
std::vector<MaterialInstance*> instances;
|
||||
}
|
||||
|
||||
using Backend = Engine::Backend;
|
||||
|
||||
struct App {
|
||||
@@ -152,6 +159,19 @@ int main(int argc, char** argv) {
|
||||
auto& tcm = engine->getTransformManager();
|
||||
auto ti = tcm.getInstance(app.mesh.renderable);
|
||||
tcm.setTransform(ti, app.transform * mat4f::rotation(now, float3{ 0, 1, 0 }));
|
||||
|
||||
static int count = 0;
|
||||
constexpr int allSize = 12000;
|
||||
if (count++ == 5) {
|
||||
for (size_t i = 0; i < allSize; ++i) {
|
||||
auto mi = app.materialInstance = app.material->createInstance();
|
||||
mi->setParameter("baseColor", RgbType::LINEAR, float3{0.8});
|
||||
mi->setParameter("metallic", 1.0f);
|
||||
mi->setParameter("roughness", 0.4f);
|
||||
mi->setParameter("reflectance", 0.5f);
|
||||
instances.push_back(mi);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
FilamentApp::get().run(app.config, setup, cleanup);
|
||||
|
||||
Reference in New Issue
Block a user