fractorium/Source/EmberCL/DEOpenCLKernelCreator.h
mfeemster b690bf8071 --User changes
-Remove the option --intpalette to format the palette in the xml as ints. If they are not hex formatted, then they should always be float. This option was pointless.
 -Cleanup some options text for the command line programs.
 -Allow for dragging around flames in the library tab. This is useful for setting up the order of an animation.
 -Make the opening of large files in Fractorium much more efficient when not-appending.
 -Make the opening of large files in all EmberRender and EmberAnimate more efficient.
 -Better error reporting when opening files.

--Bug fixes
 -Get rid of leftover artifacts that would appear on preview thumbnails when either switching SP/DP or re-rendering previews.
 -Filename extension was not being appended on Linux when saving as Xml, thus making it impossible to drag that file back in becase drop is filtered on extension.

--Code changes
 -Move GCC compiler spec to C++14. Building with 5.3 now on linux.
 -Use inline member data initializers.
 -Make a #define for static for use in Utils.h to make things a little cleaner.
 -Make various functions able to take arbitrary collections as their parameters rather than just vectors.
 -Make library collection a list rather than vector. This alleviates the need to re-sync pointers whenever the collection changes.
 -Subclass QTreeWidget for the library tree. Two new files added for this.
 -Remove all usage of #ifdef ROW_ONLY_DE in DEOpenCLKernelCreator, it was never used.
 -Add move constructor and assignment operator to EmberFile.
 -Add the ability to use a pointer to outside memory in the renderer for the vector of Ember<T>.
 -Make a lot more functions const where they should be.
2016-04-03 18:55:12 -07:00

76 lines
2.5 KiB
C++

#pragma once
#include "EmberCLPch.h"
#include "EmberCLStructs.h"
#include "EmberCLFunctions.h"
/// <summary>
/// DEOpenCLKernelCreator class.
/// </summary>
namespace EmberCLns
{
/// <summary>
/// Kernel creator for density filtering.
/// This implements both basic log scale filtering
/// as well as the full flam3 density estimation filtering
/// in OpenCL.
/// Several conditionals are present in the CPU version. They
/// are stripped out of the kernels and instead a separate kernel
/// is created for every possible case.
/// If the filter width is 9 or less, then the entire process can be
/// done in shared memory which is very fast.
/// However, if the filter width is greater than 9, shared memory is not
/// used and all filtering is done directly with main global VRAM. This
/// ends up being not much faster than doing it on the CPU.
/// String members are kept for the program source and entry points
/// for each version of the program.
/// </summary>
class EMBERCL_API DEOpenCLKernelCreator
{
public:
DEOpenCLKernelCreator(bool doublePrecision, bool nVidia);
//Accessors.
const string& LogScaleAssignDEKernel() const;
const string& LogScaleAssignDEEntryPoint() const;
const string& GaussianDEKernel(size_t ss, uint filterWidth) const;
const string& GaussianDEEntryPoint(size_t ss, uint filterWidth) const;
//Miscellaneous static functions.
static uint MaxDEFilterSize();
static double SolveMaxDERad(double desiredFilterSize, double ss);
static uint SolveMaxBoxSize(uint localMem);
private:
//Kernel creators.
string CreateLogScaleAssignDEKernelString();
string CreateGaussianDEKernel(size_t ss);
string CreateGaussianDEKernelNoLocalCache(size_t ss);
string m_LogScaleAssignDEKernel;
string m_LogScaleAssignDEEntryPoint = "LogScaleAssignDensityFilterKernel";
string m_GaussianDEWithoutSsKernel;
string m_GaussianDEWithoutSsEntryPoint = "GaussianDEWithoutSsKernel";
string m_GaussianDESsWithScfKernel;
string m_GaussianDESsWithScfEntryPoint = "GaussianDESsWithScfKernel";
string m_GaussianDESsWithoutScfKernel;
string m_GaussianDESsWithoutScfEntryPoint = "GaussianDESsWithoutScfKernel";
string m_GaussianDEWithoutSsNoCacheKernel;
string m_GaussianDEWithoutSsNoCacheEntryPoint = "GaussianDEWithoutSsNoCacheKernel";
string m_GaussianDESsWithScfNoCacheKernel;
string m_GaussianDESsWithScfNoCacheEntryPoint = "GaussianDESsWithScfNoCacheKernel";
string m_GaussianDESsWithoutScfNoCacheKernel;
string m_GaussianDESsWithoutScfNoCacheEntryPoint = "GaussianDESsWithoutScfNoCacheKernel";
bool m_DoublePrecision;
bool m_NVidia;
};
}