--User changes

-Edits will not save back to the file in memory on render completion when preview renderer is running.

--Bug fixes
 -dc_perlin was crashing on Nvidia when using SP.
 -Duplicate images were randomly getting added to the file in memory.
 -Crash when opening an Xml with less than 2 flames in it.

--Code changes
 -Use raw array of floats in OpenCL for perlin noise, rather than float3/double3.
 -Add some default cases to dc_perlin.
 -Redo singleton pattern yet again. Deriving from a templated Singleton<T> class was creating a separate instance per module. Now only one instance of each type will ever be created and it will be wrapped in a shared_ptr which guarantees its deletion as main() exits.
This commit is contained in:
mfeemster
2016-04-13 20:59:57 -07:00
parent 7715910362
commit 0fbea60026
29 changed files with 264 additions and 220 deletions

View File

@ -455,7 +455,7 @@ bool FractoriumEmberController<T>::Render()
gl->update();
if (ProcessState() == eProcessState::ACCUM_DONE)
SaveCurrentToOpenedFile();
SaveCurrentToOpenedFile();//Will not save if the previews are still rendering.
//Uncomment for debugging kernel build and execution errors.
//m_Fractorium->ui.InfoRenderingTextEdit->setText(QString::fromStdString(m_Fractorium->m_Wrapper.DumpInfo()));
@ -671,6 +671,7 @@ bool Fractorium::CreateControllerFromOptions()
auto blur = m_PaletteBlurSpin->value();
auto freq = m_PaletteFrequencySpin->value();
double scale;
uint current = 0;
#ifdef DO_DOUBLE
Ember<double> ed;
EmberFile<double> efd;
@ -686,6 +687,7 @@ bool Fractorium::CreateControllerFromOptions()
if (m_Controller.get())
{
scale = m_Controller->LockedScale();
current = m_Controller->SaveCurrentToOpenedFile();
m_Controller->StopPreviewRender();//Must stop any previews first, else changing controllers will crash the program.
m_Controller->CopyTempPalette(tempPalette);//Convert float to double or save double verbatim;
//Replace below with this once LLVM fixes a crash in their compiler with default lambda parameters.//TODO
@ -713,8 +715,8 @@ bool Fractorium::CreateControllerFromOptions()
if (m_Controller.get())
{
ed.m_Palette = tempPalette;//Restore base temp palette. Adjustments will be then be applied and stored back in in m_Ember.m_Palette below.
m_Controller->SetEmber(ed);//Convert float to double or set double verbatim. This will assign m_Ember.m_Palette (which was just tempPalette) to m_TempPalette.
m_Controller->SetEmberFile(efd);
m_Controller->SetEmber(current, true);
m_Controller->LockedScale(scale);
//Setting these and updating the GUI overwrites the work of clearing them done in SetEmber() above.
//It's a corner case, but doesn't seem to matter.