fix: display formal particle trails
This commit is contained in:
@@ -154,6 +154,8 @@ public:
|
||||
bool contextDestroyed = false;
|
||||
bool lifecycleModeKnown = false;
|
||||
bool lifecycleActive = false;
|
||||
bool formalDisplay = false;
|
||||
bool displayModeLogged = false;
|
||||
bool staticFreezeLogged = false;
|
||||
bool cameraDrawLogged = false;
|
||||
bool worldWrapLogged = false;
|
||||
@@ -271,7 +273,10 @@ public:
|
||||
const shaders::ParticleGpuValidationUBO ubo = {
|
||||
.pass = {static_cast<float>(pass), frame, maskMode == 0 ? 0.0f : 1.0f, static_cast<float>(maskMode)},
|
||||
.marker = {markerX, markerY, 0.035f, 0.965f},
|
||||
.mask = {static_cast<float>(resources->maskGeneration), static_cast<float>(worldWrap), 0.0f, 0.0f},
|
||||
.mask = {static_cast<float>(resources->maskGeneration),
|
||||
static_cast<float>(worldWrap),
|
||||
resources->formalDisplay ? 1.0f : 0.0f,
|
||||
0.0f},
|
||||
.matrix = util::cast<float>(parameters.matrixForTile({worldWrap, {0, 0, 0}})),
|
||||
};
|
||||
drawable.mutableUniformBuffers().createOrUpdate(shaders::idParticleGpuValidationUBO, &ubo, parameters.context);
|
||||
@@ -279,6 +284,14 @@ public:
|
||||
if (pass == ValidationPass::Composite || pass == ValidationPass::FrozenComposite) {
|
||||
const auto center = parameters.state.getLatLng(LatLng::Unwrapped);
|
||||
const bool primaryWorldCopy = worldWrap == wrapForLongitude(center.longitude());
|
||||
if (primaryWorldCopy && !resources->displayModeLogged) {
|
||||
Log::Info(Event::Render,
|
||||
"ParticleRender: displayMode=" +
|
||||
std::string(resources->formalDisplay ? "FORMAL_PARTICLE" : "VALIDATION") +
|
||||
" generation=" + std::to_string(resources->generation) +
|
||||
" compositeTrailRead=" + slotName(readSlot));
|
||||
resources->displayModeLogged = true;
|
||||
}
|
||||
if (primaryWorldCopy && !resources->cameraDrawLogged) {
|
||||
std::ostringstream message;
|
||||
message << "ParticleValidation30_03: first camera-locked draw maskGeneration="
|
||||
@@ -574,6 +587,7 @@ void RenderRasterParticleLayer::update(gfx::ShaderRegistry& shaders,
|
||||
if (!resources) {
|
||||
auto owned = std::make_shared<ParticleGpuResources>();
|
||||
owned->generation = ++nextGpuGeneration;
|
||||
owned->formalDisplay = formalSource;
|
||||
owned->shader = context.getGenericShader(shaders, ShaderName);
|
||||
owned->vertices = std::make_shared<gfx::VertexVector<HeatmapTextureLayoutVertex>>(
|
||||
RenderStaticData::heatmapTextureVertices());
|
||||
@@ -943,10 +957,13 @@ void RenderRasterParticleLayer::update(gfx::ShaderRegistry& shaders,
|
||||
|
||||
if (resources->committedFrame < 3 || (resources->committedFrame + 1) % 60 == 0) {
|
||||
Log::Info(Event::Render,
|
||||
"ParticleValidation30_02: schedule generation=" + std::to_string(resources->generation) + " frame=" +
|
||||
std::to_string(resources->committedFrame + 1) + " state=" + slotName(resources->stateRead) +
|
||||
"->" + slotName(stateWrite) + " trail=" + slotName(resources->trailRead) + "->" +
|
||||
slotName(trailWrite) + " targetsDistinct=true cpuStateCopy=false");
|
||||
"ParticleValidation30_02: schedule generation=" + std::to_string(resources->generation) +
|
||||
" frame=" + std::to_string(resources->committedFrame + 1) +
|
||||
" state=" + slotName(resources->stateRead) + "->" + slotName(stateWrite) +
|
||||
" trail=" + slotName(resources->trailRead) + "->" + slotName(trailWrite) +
|
||||
" trailStateSource=" + slotName(stateWrite) + " compositeTrailSource=" + slotName(trailWrite) +
|
||||
" displayMode=" + (resources->formalDisplay ? "FORMAL_PARTICLE" : "VALIDATION") +
|
||||
" targetsDistinct=true cpuStateCopy=false");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user