mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-01-21 21:20:07 -05:00
9e94170a70
--User Changes Size is no longer fixed to the window size. Size scaling is done differently in the final render dialog. This fixes several bugs. Remove Xml saving size from settings and options dialog, it no longer applies. Final render can be broken into strips. Set default save path to the desktop if none is found in the settings file. Set default output size to 1920x1080 if none is found in the settings file. --Bug Fixes Better memory size reporting in final render dialog. --Code Changes Migrate to C++11, Qt 5.3.1, and Visual Studio 2013. Change most instances of unsigned int to size_t, and int to intmax_t. Add m_OrigPixPerUnit and m_ScaleType to Ember for scaling purposes. Replace some sprintf_s() calls in XmlToEmber with ostringstream. Move more non-templated members into RendererBase. Add CopyVec() overload that takes a per element function pointer. Add vector Memset(). Replace '&' with '+' instead of "&" in XmlToEmber for much faster parsing. Break strips rendering out into EmberCommon and call from EmberRender and Fractorium. Make AddAndWriteBuffer() just call WriteBuffer(). Make AddAndWriteImage() delete the existing image first before replacing it. Add SetOutputTexture() to RendererCL to support making new textures in response to resize events. Remove multiple return statements in RendererCL, and replace with a bool that tracks results. Add ToDouble(), MakeEnd(), ToString() and Exists() wrappers in Fractorium. Add Size() wrapper in EmberFile. Make QString function arguments const QString&, and string with const string&. Make ShowCritical() wrapper for invoking a message box from another thread. Add combo box to TwoButtonWidget and rename.
90 lines
2.6 KiB
C++
90 lines
2.6 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.
|
|
/// Template argument expected to be float or double.
|
|
/// </summary>
|
|
template <typename T>
|
|
class EMBERCL_API DEOpenCLKernelCreator
|
|
{
|
|
public:
|
|
DEOpenCLKernelCreator();
|
|
DEOpenCLKernelCreator(bool nVidia);
|
|
|
|
//Accessors.
|
|
string LogScaleSumDEKernel();
|
|
string LogScaleSumDEEntryPoint();
|
|
string LogScaleAssignDEKernel();
|
|
string LogScaleAssignDEEntryPoint();
|
|
string GaussianDEKernel(size_t ss, unsigned int filterWidth);
|
|
string GaussianDEEntryPoint(size_t ss, unsigned int filterWidth);
|
|
|
|
//Miscellaneous static functions.
|
|
static unsigned int MaxDEFilterSize();
|
|
static T SolveMaxDERad(unsigned int maxBoxSize, T desiredFilterSize, T ss);
|
|
static unsigned int SolveMaxBoxSize(unsigned int localMem);
|
|
|
|
private:
|
|
//Kernel creators.
|
|
string CreateLogScaleSumDEKernelString();
|
|
string CreateLogScaleAssignDEKernelString();
|
|
string CreateGaussianDEKernel(size_t ss);
|
|
string CreateGaussianDEKernelNoLocalCache(size_t ss);
|
|
|
|
string m_LogScaleSumDEKernel;
|
|
string m_LogScaleSumDEEntryPoint;
|
|
|
|
string m_LogScaleAssignDEKernel;
|
|
string m_LogScaleAssignDEEntryPoint;
|
|
|
|
string m_GaussianDEWithoutSsKernel;
|
|
string m_GaussianDEWithoutSsEntryPoint;
|
|
|
|
string m_GaussianDESsWithScfKernel;
|
|
string m_GaussianDESsWithScfEntryPoint;
|
|
|
|
string m_GaussianDESsWithoutScfKernel;
|
|
string m_GaussianDESsWithoutScfEntryPoint;
|
|
|
|
string m_GaussianDEWithoutSsNoCacheKernel;
|
|
string m_GaussianDEWithoutSsNoCacheEntryPoint;
|
|
|
|
string m_GaussianDESsWithScfNoCacheKernel;
|
|
string m_GaussianDESsWithScfNoCacheEntryPoint;
|
|
|
|
string m_GaussianDESsWithoutScfNoCacheKernel;
|
|
string m_GaussianDESsWithoutScfNoCacheEntryPoint;
|
|
|
|
bool m_NVidia;
|
|
};
|
|
|
|
template EMBERCL_API class DEOpenCLKernelCreator<float>;
|
|
|
|
#ifdef DO_DOUBLE
|
|
template EMBERCL_API class DEOpenCLKernelCreator<double>;
|
|
#endif
|
|
}
|