mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-01-21 21:20:07 -05:00
b29bedec38
--User Changes Remove limit on the number of xforms allowable on the GPU. This was previously 21. Show actual strips count to be used in parens outside of user specified strips count on final render dialog. Allow for adjustment of iteration depth and fuse count per ember and save/read these values with the xml. Iteration optimizations on both CPU and GPU. Automatically adjust default quality spinner value when using CPU/GPU to 10/30, respectively. --Bug Fixes Fix severe randomization bug with OpenCL. Fix undo list off by one error when doing a new edit anywhere but the end of the undo list. Make integer variation parameters use 4 decimal places in the variations list like all the others. New build of the latest Qt to fix scroll bar drawing bug. Prevent grid from showing as much when pressing control to increase a spinner's increment speed. Still shows sometimes, but better than before. --Code Changes Pass count and fuse to iterator as a structure now to allow for passing more params in the future. Slightly different grid/block logic when running DE filtering on the GPU. Attempt a different way of doing DE, but #define out because it ended up not being faster. Restructure some things to allow for a variable length xforms buffer to be passed to the GPU. Add sub batch size and fuse count as ember members, and remove them from the renderer classes. Remove m_LastPass from Renderer. It should have been removed with passes. Pass seeds as a buffer to the OpenCL iteration kernel, rather than a single seed that gets modified. Slight optimization on CPU accum. Use case statement instead of if/else for xform chosing in OpenCL for a 2% speedup on params with large numbers of xforms. Add SizeOf() wrapper around sizeof(vec[0]) * vec.size(). Remove LogScaleSum() functions from the CPU and GPU because they're no longer used since passes were removed. Make some OpenCLWrapper getters const. Better ogranize RendererCL methods that return grid dimensions.
86 lines
2.5 KiB
C++
86 lines
2.5 KiB
C++
#pragma once
|
|
|
|
#include "EmberCLPch.h"
|
|
#include "EmberCLStructs.h"
|
|
#include "EmberCLFunctions.h"
|
|
|
|
/// <summary>
|
|
/// DEOpenCLKernelCreator class.
|
|
/// </summary>
|
|
|
|
//#define ROW_ONLY_DE 1
|
|
|
|
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 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 CreateLogScaleAssignDEKernelString();
|
|
string CreateGaussianDEKernel(size_t ss);
|
|
string CreateGaussianDEKernelNoLocalCache(size_t ss);
|
|
|
|
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
|
|
}
|