mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-07-01 22:06:10 -04:00
--User changes
-Add new variations: crackle, dc_perlin. -Make default palette interp mode be linear instead of step. -Make summary tab the selected one in the Info tab. -Allow for highlight power of up to 10. It was previously limited to 2. --Bug fixes -Direct color calculations were wrong. -Flattening was not applied to final xform. -Fix "pure virtual function call" error on shutdown. --Code changes -Allow for array precalc params in variations by adding a size member to the ParamWithName class. -In IterOpenCLKernelCreator, memcpy precalc params instead of a direct assign since they can now be of variable length. -Add new file VarFuncs to consolidate some functions that are common to multiple variations. This also contains texture data for crackle and dc_perlin. -Place OpenCL versions of these functions in the FunctionMapper class in the EmberCL project. -Add new Singleton class that uses CRTP, is thread safe, and deletes after the last reference goes away. This fixes the usual "delete after main()" problem with singletons that use the static local function variable pattern. -Began saving files with AStyle autoformatter turned on. This will eventually touch all files as they are worked on. -Add missing backslash to CUDA include and library paths for builds on Nvidia systems. -Add missing gl.h include for Windows. -Remove glew include paths from Fractorium, it's not used. -Remove any Nvidia specific #defines and build targets, they are no longer needed with OpenCL 1.2. -Fix bad paths on linux build. -General cleanup.
This commit is contained in:
@ -166,7 +166,6 @@ static uint CalcStrips(double memRequired, double memAvailable, double useMem)
|
||||
return 1;
|
||||
|
||||
strips = uint(ceil(memRequired / memAvailable));
|
||||
|
||||
return strips;
|
||||
}
|
||||
|
||||
@ -210,7 +209,6 @@ static T NextLowestEvenDiv(T numerator, T denominator)
|
||||
{
|
||||
T result = 1;
|
||||
T numDiv2 = numerator / 2;
|
||||
|
||||
denominator--;
|
||||
|
||||
if (denominator > numDiv2)
|
||||
@ -239,9 +237,8 @@ static T NextLowestEvenDiv(T numerator, T denominator)
|
||||
static vector<pair<size_t, size_t>> Devices(const vector<size_t>& selectedDevices)
|
||||
{
|
||||
vector<pair<size_t, size_t>> vec;
|
||||
OpenCLInfo& info = OpenCLInfo::Instance();
|
||||
auto& devices = info.DeviceIndices();
|
||||
|
||||
auto info = OpenCLInfo::Instance();
|
||||
auto& devices = info->DeviceIndices();
|
||||
vec.reserve(selectedDevices.size());
|
||||
|
||||
for (size_t i = 0; i < selectedDevices.size(); i++)
|
||||
@ -400,10 +397,10 @@ static vector<unique_ptr<Renderer<T, float>>> CreateRenderers(eRendererType rend
|
||||
/// <returns>True if all rendering was successful, else false.</returns>
|
||||
template <typename T>
|
||||
static bool StripsRender(RendererBase* renderer, Ember<T>& ember, vector<byte>& finalImage, double time, size_t strips, bool yAxisUp,
|
||||
std::function<void(size_t strip)> perStripStart,
|
||||
std::function<void(size_t strip)> perStripFinish,
|
||||
std::function<void(size_t strip)> perStripError,
|
||||
std::function<void(Ember<T>& finalEmber)> allStripsFinished)
|
||||
std::function<void(size_t strip)> perStripStart,
|
||||
std::function<void(size_t strip)> perStripFinish,
|
||||
std::function<void(size_t strip)> perStripError,
|
||||
std::function<void(Ember<T>& finalEmber)> allStripsFinished)
|
||||
{
|
||||
bool success = false;
|
||||
size_t origHeight, realHeight = ember.m_FinalRasH;
|
||||
@ -412,7 +409,6 @@ static bool StripsRender(RendererBase* renderer, Ember<T>& ember, vector<byte>&
|
||||
T zoomScale = pow(T(2), ember.m_Zoom);
|
||||
T centerBase = centerY - ((strips - 1) * floatStripH) / (2 * ember.m_PixelsPerUnit * zoomScale);
|
||||
vector<QTIsaac<ISAAC_SIZE, ISAAC_INT>> randVec;
|
||||
|
||||
ember.m_Quality *= strips;
|
||||
ember.m_FinalRasH = size_t(ceil(floatStripH));
|
||||
|
||||
@ -469,7 +465,6 @@ static bool StripsRender(RendererBase* renderer, Ember<T>& ember, vector<byte>&
|
||||
allStripsFinished(ember);
|
||||
|
||||
Memset(finalImage);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@ -485,9 +480,9 @@ static bool StripsRender(RendererBase* renderer, Ember<T>& ember, vector<byte>&
|
||||
/// <param name="stripError3">Called if for any reason the number of strips used will differ from the value passed in</param>
|
||||
/// <returns>The actual number of strips that will be used</returns>
|
||||
static size_t VerifyStrips(size_t height, size_t strips,
|
||||
std::function<void(const string& s)> stripError1,
|
||||
std::function<void(const string& s)> stripError2,
|
||||
std::function<void(const string& s)> stripError3)
|
||||
std::function<void(const string& s)> stripError1,
|
||||
std::function<void(const string& s)> stripError2,
|
||||
std::function<void(const string& s)> stripError3)
|
||||
{
|
||||
ostringstream os;
|
||||
|
||||
@ -502,7 +497,6 @@ static size_t VerifyStrips(size_t height, size_t strips,
|
||||
{
|
||||
os << "A strips value of " << strips << " does not divide evenly into a height of " << height << ".";
|
||||
stripError2(os.str()); os.str("");
|
||||
|
||||
strips = NextHighestEvenDiv(height, strips);
|
||||
|
||||
if (strips == 1)//No higher divisor, check for a lower one.
|
||||
|
Reference in New Issue
Block a user