22.21.4.2 4/19/2021

--User changes
 -Allow users to set the Exp value when using the Exp temporal filter type.
 -Set the default temporal filter type to be Box, which does not alter the palette values at all during animation. This is done to avoid confusion when using Gaussian or Exp which can produce darkened images.

--Bug fixes
 -Sending a sequence to the final render dialog when the keyframes had non zero rotate and center Y values would produce off center animations when rendered.
 -Temporal filters were being unnecessarily recreated many times when rendering or generating sequences.
 -Exp filter was always treated like a Box filter.

--Code changes
 -Add a new member function SaveCurrentAsXml(QString filename = "") to the controllers which is only used for testing.
 -Modernize some C++ code.
This commit is contained in:
Person
2021-04-19 21:07:24 -06:00
parent 652ccc242c
commit 8086cfa731
97 changed files with 2156 additions and 2087 deletions

View File

@ -131,7 +131,7 @@ uint DEOpenCLKernelCreator::MaxDEFilterSize() { return 9; }//The true max would
/// <returns>The maximum filter radius allowed</returns>
double DEOpenCLKernelCreator::SolveMaxDERad(double desiredFilterSize, double ss)
{
uint finalFilterSize = uint((ceil(desiredFilterSize) * ss) + (ss - 1.0));
auto finalFilterSize = static_cast<uint>((ceil(desiredFilterSize) * ss) + (ss - 1.0));
//Return the desired size if the final size of it will fit.
if (finalFilterSize <= MaxDEFilterSize())
@ -149,7 +149,7 @@ double DEOpenCLKernelCreator::SolveMaxDERad(double desiredFilterSize, double ss)
/// <returns>The maximum filter box size allowed</returns>
uint DEOpenCLKernelCreator::SolveMaxBoxSize(uint localMem)
{
return uint(std::floor(std::sqrt(Floor(localMem / 16.0))));//Divide by 16 because each element is float4.
return static_cast<uint>(std::floor(std::sqrt(Floor(localMem / 16.0))));//Divide by 16 because each element is float4.
}
/// <summary>

View File

@ -813,7 +813,7 @@ string IterOpenCLKernelCreator<T>::GlobalFunctionsString(const Ember<T>& ember)
ostringstream os;
static string zeps = "Zeps";
while (auto xform = ember.GetTotalXform(i++))
while (const auto xform = ember.GetTotalXform(i++))
{
size_t varCount = xform->TotalVariationCount();
@ -823,9 +823,9 @@ string IterOpenCLKernelCreator<T>::GlobalFunctionsString(const Ember<T>& ember)
for (j = 0; j < varCount; j++)
{
if (auto var = xform->GetVariation(j))
if (const auto var = xform->GetVariation(j))
{
auto names = var->OpenCLGlobalFuncNames();
const auto names = var->OpenCLGlobalFuncNames();
if (var->NeedPrecalcAngles())
if (!Contains(funcNames, zeps))
@ -843,7 +843,7 @@ string IterOpenCLKernelCreator<T>::GlobalFunctionsString(const Ember<T>& ember)
funcNames.push_back(zeps);
for (auto& funcName : funcNames)
if (auto text = m_FunctionMapper.GetGlobalFunc(funcName))
if (const auto text = m_FunctionMapper.GetGlobalFunc(funcName))
os << *text << "\n";
return os.str();
@ -897,11 +897,11 @@ void IterOpenCLKernelCreator<T>::ParVarIndexDefines(const Ember<T>& ember, pair<
if (doVals)
params.second.clear();
while (auto xform = ember.GetTotalXform(i))
while (const auto xform = ember.GetTotalXform(i))
{
size_t j = 0;
while (auto var = xform->GetVariation(j))
while (const auto var = xform->GetVariation(j))
{
if (doString)
os << "#define WEIGHT_" << i << "_" << j << " " << size++ << "\n";//Uniquely identify the weight of this variation in this xform.
@ -909,7 +909,7 @@ void IterOpenCLKernelCreator<T>::ParVarIndexDefines(const Ember<T>& ember, pair<
if (doVals)
params.second.push_back(var->m_Weight);
if (auto parVar = dynamic_cast<ParametricVariation<T>*>(var))
if (const auto parVar = dynamic_cast<ParametricVariation<T>*>(var))
{
for (size_t k = 0; k < parVar->ParamCount(); k++)
{
@ -918,7 +918,7 @@ void IterOpenCLKernelCreator<T>::ParVarIndexDefines(const Ember<T>& ember, pair<
if (doString)
os << "#define " << ToUpper(parVar->Params()[k].Name()) << "_" << i << " " << size << "\n";//Uniquely identify this param in this variation in this xform.
auto elements = parVar->Params()[k].Size() / sizeof(T);
const auto elements = parVar->Params()[k].Size() / sizeof(T);
if (doVals)
{
@ -959,20 +959,20 @@ void IterOpenCLKernelCreator<T>::SharedDataIndexDefines(const Ember<T>& ember, p
string s;
vector<string> dataNames;//Can't use a set here because they sort and we must preserve the insertion order due to nested function calls.
ostringstream os;
auto varFuncs = VarFuncs<T>::Instance();
const auto varFuncs = VarFuncs<T>::Instance();
if (doVals)
params.second.clear();
while (auto xform = ember.GetTotalXform(i++))
while (const auto xform = ember.GetTotalXform(i++))
{
size_t varCount = xform->TotalVariationCount();
for (j = 0; j < varCount; j++)
{
if (auto var = xform->GetVariation(j))
if (const auto var = xform->GetVariation(j))
{
auto names = var->OpenCLGlobalDataNames();
const auto names = var->OpenCLGlobalDataNames();
for (auto& name : names)
{
@ -980,7 +980,7 @@ void IterOpenCLKernelCreator<T>::SharedDataIndexDefines(const Ember<T>& ember, p
{
s = ToUpper(name);
if (auto dataInfo = varFuncs->GetSharedData(s))///Will contain a name, pointer to data, and size of the data in units of sizeof(T).
if (const auto dataInfo = varFuncs->GetSharedData(s))///Will contain a name, pointer to data, and size of the data in units of sizeof(T).
{
if (doString)
os << "#define " << ToUpper(name) << " " << offset << '\n';
@ -1017,9 +1017,9 @@ string IterOpenCLKernelCreator<T>::VariationStateString(const Ember<T>& ember)
ostringstream os;
os << "typedef struct __attribute__ " ALIGN_CL " _VariationState\n{";
while (auto xform = ember.GetTotalXform(i++))
while (const auto xform = ember.GetTotalXform(i++))
for (size_t j = 0; j < xform->TotalVariationCount(); j++)
if (auto var = xform->GetVariation(j))
if (const auto var = xform->GetVariation(j))
os << var->StateOpenCLString();
os << "\n} VariationState;\n\n";
@ -1039,9 +1039,9 @@ string IterOpenCLKernelCreator<T>::VariationStateInitString(const Ember<T>& embe
size_t i = 0;
ostringstream os;
while (auto xform = ember.GetTotalXform(i++))
while (const auto xform = ember.GetTotalXform(i++))
for (size_t j = 0; j < xform->TotalVariationCount(); j++)
if (auto var = xform->GetVariation(j))
if (const auto var = xform->GetVariation(j))
os << var->StateInitOpenCLString();
return os.str();
@ -1057,7 +1057,7 @@ bool IterOpenCLKernelCreator<T>::AnyZeroOpacity(const Ember<T>& ember)
{
size_t i = 0;
while (auto xform = ember.GetXform(i++))
while (const auto xform = ember.GetXform(i++))
if (xform->m_Opacity == 0)
return true;
@ -1118,9 +1118,9 @@ bool IterOpenCLKernelCreator<T>::IsBuildRequired(const Ember<T>& ember1, const E
for (i = 0; i < xformCount; i++)
{
auto xform1 = ember1.GetTotalXform(i);
auto xform2 = ember2.GetTotalXform(i);
auto varCount = xform1->TotalVariationCount();
const auto xform1 = ember1.GetTotalXform(i);
const auto xform2 = ember2.GetTotalXform(i);
const auto varCount = xform1->TotalVariationCount();
if (optAffine && (xform1->m_Affine.IsID() != xform2->m_Affine.IsID()))
return true;

View File

@ -265,7 +265,7 @@ bool OpenCLWrapper::WriteBuffer(size_t bufferIndex, void* data, size_t size)
if (m_Init && (bufferIndex < m_Buffers.size()) && (GetBufferSize(bufferIndex) == size))
{
cl::Event e;
cl_int err = m_Queue.enqueueWriteBuffer(m_Buffers[bufferIndex].m_Buffer, CL_TRUE, 0, size, data, nullptr, &e);
const auto err = m_Queue.enqueueWriteBuffer(m_Buffers[bufferIndex].m_Buffer, CL_TRUE, 0, size, data, nullptr, &e);
e.wait();
m_Queue.finish();
@ -301,7 +301,7 @@ bool OpenCLWrapper::ReadBuffer(size_t bufferIndex, void* data, size_t size)
if (m_Init && (bufferIndex < m_Buffers.size()) && (GetBufferSize(bufferIndex) == size))
{
cl::Event e;
cl_int err = m_Queue.enqueueReadBuffer(m_Buffers[bufferIndex].m_Buffer, CL_TRUE, 0, size, data, nullptr, &e);
const auto err = m_Queue.enqueueReadBuffer(m_Buffers[bufferIndex].m_Buffer, CL_TRUE, 0, size, data, nullptr, &e);
e.wait();
m_Queue.finish();
@ -752,7 +752,7 @@ bool OpenCLWrapper::EnqueueAcquireGLObjects(cl::ImageGL& image)
{
vector<cl::Memory> images;
images.push_back(image);
cl_int err = m_Queue.enqueueAcquireGLObjects(&images);
const auto err = m_Queue.enqueueAcquireGLObjects(&images);
m_Queue.finish();
return m_Info->CheckCL(err, "cl::CommandQueue::enqueueAcquireGLObjects()");
}
@ -786,7 +786,7 @@ bool OpenCLWrapper::EnqueueReleaseGLObjects(cl::ImageGL& image)
{
vector<cl::Memory> images;
images.push_back(image);
cl_int err = m_Queue.enqueueReleaseGLObjects(&images);
const auto err = m_Queue.enqueueReleaseGLObjects(&images);
m_Queue.finish();
return m_Info->CheckCL(err, "cl::CommandQueue::enqueueReleaseGLObjects()");
}
@ -803,7 +803,7 @@ bool OpenCLWrapper::EnqueueAcquireGLObjects(const VECTOR_CLASS<cl::Memory>* memO
{
if (m_Init && m_Shared)
{
cl_int err = m_Queue.enqueueAcquireGLObjects(memObjects);
const auto err = m_Queue.enqueueAcquireGLObjects(memObjects);
m_Queue.finish();
return m_Info->CheckCL(err, "cl::CommandQueue::enqueueAcquireGLObjects()");
}
@ -820,7 +820,7 @@ bool OpenCLWrapper::EnqueueReleaseGLObjects(const VECTOR_CLASS<cl::Memory>* memO
{
if (m_Init && m_Shared)
{
cl_int err = m_Queue.enqueueReleaseGLObjects(memObjects);
const auto err = m_Queue.enqueueReleaseGLObjects(memObjects);
m_Queue.finish();
return m_Info->CheckCL(err, "cl::CommandQueue::enqueueReleaseGLObjects()");
}
@ -958,12 +958,12 @@ bool OpenCLWrapper::RunKernel(size_t kernelIndex, size_t totalGridWidth, size_t
if (m_Init && kernelIndex < m_Programs.size())
{
cl::Event e;
cl_int err = m_Queue.enqueueNDRangeKernel(m_Programs[kernelIndex].m_Kernel,
cl::NullRange,
cl::NDRange(totalGridWidth, totalGridHeight, totalGridDepth),
cl::NDRange(blockWidth, blockHeight, blockDepth),
nullptr,
&e);
const auto err = m_Queue.enqueueNDRangeKernel(m_Programs[kernelIndex].m_Kernel,
cl::NullRange,
cl::NDRange(totalGridWidth, totalGridHeight, totalGridDepth),
cl::NDRange(blockWidth, blockHeight, blockDepth),
nullptr,
&e);
e.wait();
m_Queue.finish();
return m_Info->CheckCL(err, "cl::CommandQueue::enqueueNDRangeKernel()");

View File

@ -339,15 +339,15 @@ void RendererCL<T, bucketT>::InitStateVec()
{
size_t count = 0, i = 0, j = 0, k = 0;
while (auto xform = m_Ember.GetTotalXform(i++))
while (const auto xform = m_Ember.GetTotalXform(i++))
for (j = 0; j < xform->TotalVariationCount(); j++)
if (auto var = xform->GetVariation(j))
if (const auto var = xform->GetVariation(j))
count += var->StateParamCount() * sizeof(T);
//Round to 16 and resize the buffer to be copied to OpenCL buffer here.
auto igkc = IterGridKernelCount();
const auto igkc = IterGridKernelCount();
size_t index = 0, count16 = ((count / 16) * 16) + (count % 16 > 0 ? 16 : 0);
auto elcount = count16 / sizeof(T);
const auto elcount = count16 / sizeof(T);
m_VarStates.resize(igkc * elcount);
if (count16)
@ -357,9 +357,9 @@ void RendererCL<T, bucketT>::InitStateVec()
i = 0;
index = k * elcount;
while (auto xform = m_Ember.GetTotalXform(i++))
while (const auto xform = m_Ember.GetTotalXform(i++))
for (j = 0; j < xform->TotalVariationCount(); j++)
if (auto var = xform->GetVariation(j))
if (const auto var = xform->GetVariation(j))
var->InitStateVars(m_VarStates.data(), index);
}
}
@ -447,7 +447,7 @@ bool RendererCL<T, bucketT>::ClearFinal()
if (!m_Devices.empty())
{
auto& wrapper = m_Devices[0]->m_Wrapper;
uint index = wrapper.FindImageIndex(m_FinalImageName, wrapper.Shared());
const auto index = wrapper.FindImageIndex(m_FinalImageName, wrapper.Shared());
if (this->PrepFinalAccumVector(v))
{
@ -626,7 +626,7 @@ vector<string> RendererCL<T, bucketT>::ErrorReport()
for (auto& device : m_Devices)
{
auto s = device->ErrorReport();
const auto s = device->ErrorReport();
ours.insert(ours.end(), s.begin(), s.end());
}
@ -1148,25 +1148,25 @@ bool RendererCL<T, bucketT>::RunIter(size_t iterCount, size_t temporalSample, si
if (m_Callback && !dev)//Will only do callback on the first device, however it will report the progress of all devices.
{
double percent = 100.0 *
double
(
double
const auto percent = 100.0 *
static_cast<double>
(
double
static_cast<double>
(
double(m_LastIter + atomItersRan.load()) / double(ItersPerTemporalSample())
) + temporalSample
) / double(TemporalSamples())
);
double percentDiff = percent - m_LastIterPercent;
double toc = m_ProgressTimer.Toc();
static_cast<double>
(
static_cast<double>(m_LastIter + atomItersRan.load()) / static_cast<double>(ItersPerTemporalSample())
) + temporalSample
) / static_cast<double>(TemporalSamples())
);
const auto percentDiff = percent - m_LastIterPercent;
const auto toc = m_ProgressTimer.Toc();
if (percentDiff >= 10 || (toc > 1000 && percentDiff >= 1))//Call callback function if either 10% has passed, or one second (and 1%).
{
auto startingpercent = 100.0 * (m_LastIter / double(ItersPerTemporalSample()));//This is done to support incremental renders, starting from the percentage it left off on.
auto currentpercent = percent - startingpercent;//Current percent in terms of starting percentage. So starting at 50% and progressing 5% will give a value of 5%, not 55%.
auto etaMs = currentpercent == 0 ? 0 : (((100.0 - startingpercent) - currentpercent) / currentpercent) * m_RenderTimer.Toc();//Subtract startingpercent from 100% so that it's properly scaled, meaning rendering from 50% - 100% will be treated as 0% - 100%.
const auto startingpercent = 100.0 * (m_LastIter / static_cast<double>(ItersPerTemporalSample()));//This is done to support incremental renders, starting from the percentage it left off on.
const auto currentpercent = percent - startingpercent;//Current percent in terms of starting percentage. So starting at 50% and progressing 5% will give a value of 5%, not 55%.
const auto etaMs = currentpercent == 0 ? 0 : (((100.0 - startingpercent) - currentpercent) / currentpercent) * m_RenderTimer.Toc();//Subtract startingpercent from 100% so that it's properly scaled, meaning rendering from 50% - 100% will be treated as 0% - 100%.
if (!m_Callback->ProgressFunc(m_Ember, m_ProgressParameter, percent, 0, etaMs))
Abort();
@ -1229,7 +1229,7 @@ eRenderStatus RendererCL<T, bucketT>::RunLogScaleFilter()
if (b)
{
auto& wrapper = m_Devices[0]->m_Wrapper;
int kernelIndex = wrapper.FindKernelIndex(m_DEOpenCLKernelCreator.LogScaleAssignDEEntryPoint());
const auto kernelIndex = wrapper.FindKernelIndex(m_DEOpenCLKernelCreator.LogScaleAssignDEEntryPoint());
if (kernelIndex != -1)
{
@ -1305,10 +1305,10 @@ eRenderStatus RendererCL<T, bucketT>::RunDensityFilter()
//that are far enough apart such that their filters do not overlap.
//Do the latter.
//Gap is in terms of blocks and specifies how many blocks must separate two blocks running at the same time.
uint gapW = uint(ceil(fw2 / blockSizeW));
uint chunkSizeW = gapW + 1;//Chunk size is also in terms of blocks and is one block (the one running) plus the gap to the right of it.
uint gapH = uint(ceil(fw2 / blockSizeH));
uint chunkSizeH = gapH + 1;//Chunk size is also in terms of blocks and is one block (the one running) plus the gap below it.
const auto gapW = static_cast<uint>(ceil(fw2 / blockSizeW));
const auto chunkSizeW = gapW + 1;//Chunk size is also in terms of blocks and is one block (the one running) plus the gap to the right of it.
const auto gapH = static_cast<uint>(ceil(fw2 / blockSizeH));
const auto chunkSizeH = gapH + 1;//Chunk size is also in terms of blocks and is one block (the one running) plus the gap below it.
double totalChunks = chunkSizeW * chunkSizeH;
if (b && !(b = wrapper.AddAndWriteBuffer(m_DEFilterParamsBufferName, reinterpret_cast<void*>(&m_DensityFilterCL), sizeof(m_DensityFilterCL)))) { ErrorStr(loc, "Writing DE filter parameters buffer failed", m_Devices[0].get()); }
@ -1364,8 +1364,8 @@ eRenderStatus RendererCL<T, bucketT>::RunDensityFilter()
if (b && m_Callback)
{
double percent = (double((rowChunkPass * chunkSizeW) + (colChunkPass + 1)) / totalChunks) * 100.0;
double etaMs = ((100.0 - percent) / percent) * t.Toc();
const auto percent = (static_cast<double>((rowChunkPass * chunkSizeW) + (colChunkPass + 1)) / totalChunks) * 100.0;
const auto etaMs = ((100.0 - percent) / percent) * t.Toc();
if (!m_Callback->ProgressFunc(m_Ember, m_ProgressParameter, percent, 1, etaMs))
Abort();
@ -1502,7 +1502,7 @@ bool RendererCL<T, bucketT>::ClearBuffer(size_t device, const string& bufferName
if (device < m_Devices.size())
{
auto& wrapper = m_Devices[device]->m_Wrapper;
int kernelIndex = wrapper.FindKernelIndex(m_IterOpenCLKernelCreator.ZeroizeEntryPoint());
const auto kernelIndex = wrapper.FindKernelIndex(m_IterOpenCLKernelCreator.ZeroizeEntryPoint());
cl_uint argIndex = 0;
static std::string loc = __FUNCTION__;
@ -1604,7 +1604,7 @@ int RendererCL<T, bucketT>::MakeAndGetDensityFilterProgram(size_t ss, uint filte
if (!m_Devices.empty())
{
auto& wrapper = m_Devices[0]->m_Wrapper;
auto& deEntryPoint = m_DEOpenCLKernelCreator.GaussianDEEntryPoint(ss, filterWidth);
const auto& deEntryPoint = m_DEOpenCLKernelCreator.GaussianDEEntryPoint(ss, filterWidth);
const char* loc = __FUNCTION__;
if ((kernelIndex = wrapper.FindKernelIndex(deEntryPoint)) == -1)//Has not been built yet.
@ -1633,7 +1633,7 @@ int RendererCL<T, bucketT>::MakeAndGetFinalAccumProgram()
if (!m_Devices.empty())
{
auto& wrapper = m_Devices[0]->m_Wrapper;
auto& finalAccumEntryPoint = m_FinalAccumOpenCLKernelCreator.FinalAccumEntryPoint(EarlyClip());
const auto& finalAccumEntryPoint = m_FinalAccumOpenCLKernelCreator.FinalAccumEntryPoint(EarlyClip());
const char* loc = __FUNCTION__;
if ((kernelIndex = wrapper.FindKernelIndex(finalAccumEntryPoint)) == -1)//Has not been built yet.
@ -1660,13 +1660,13 @@ int RendererCL<T, bucketT>::MakeAndGetGammaCorrectionProgram()
if (!m_Devices.empty())
{
auto& wrapper = m_Devices[0]->m_Wrapper;
auto& gammaEntryPoint = m_FinalAccumOpenCLKernelCreator.GammaCorrectionEntryPoint();
int kernelIndex = wrapper.FindKernelIndex(gammaEntryPoint);
const auto& gammaEntryPoint = m_FinalAccumOpenCLKernelCreator.GammaCorrectionEntryPoint();
auto kernelIndex = wrapper.FindKernelIndex(gammaEntryPoint);
static std::string loc = __FUNCTION__;
if (kernelIndex == -1)//Has not been built yet.
{
auto& kernel = m_FinalAccumOpenCLKernelCreator.GammaCorrectionKernel();
const auto& kernel = m_FinalAccumOpenCLKernelCreator.GammaCorrectionKernel();
bool b = wrapper.AddProgram(gammaEntryPoint, kernel, gammaEntryPoint, m_DoublePrecision);
if (b)
@ -1689,8 +1689,8 @@ int RendererCL<T, bucketT>::MakeAndGetGammaCorrectionProgram()
template <typename T, typename bucketT>
bool RendererCL<T, bucketT>::CreateHostBuffer()
{
bool b = true;
size_t size = SuperSize() * sizeof(v4bT);//Size of histogram and density filter buffer.
auto b = true;
const auto size = SuperSize() * sizeof(v4bT);//Size of histogram and density filter buffer.
static std::string loc = __FUNCTION__;
if (b = Renderer<T, bucketT>::Alloc(true))//Allocate the histogram memory to point this HOST_PTR buffer to, other buffers not needed.
@ -1717,15 +1717,15 @@ bool RendererCL<T, bucketT>::SumDeviceHist()
if (m_Devices.size() > 1)
{
//Timing t;
bool b = true;
auto b = true;
auto& wrapper = m_Devices[0]->m_Wrapper;
static std::string loc = __FUNCTION__;
size_t blockW = m_Devices[0]->Nvidia() ? 32 : 16;//Max work group size is 256 on AMD, which means 16x16.
size_t blockH = m_Devices[0]->Nvidia() ? 32 : 16;
const size_t blockW = m_Devices[0]->Nvidia() ? 32 : 16;//Max work group size is 256 on AMD, which means 16x16.
const size_t blockH = m_Devices[0]->Nvidia() ? 32 : 16;
size_t gridW = SuperRasW();
size_t gridH = SuperRasH();
OpenCLWrapper::MakeEvenGridDims(blockW, blockH, gridW, gridH);
int kernelIndex = wrapper.FindKernelIndex(m_IterOpenCLKernelCreator.SumHistEntryPoint());
const auto kernelIndex = wrapper.FindKernelIndex(m_IterOpenCLKernelCreator.SumHistEntryPoint());
if ((b = (kernelIndex != -1)))
{
@ -1915,9 +1915,9 @@ void RendererCL<T, bucketT>::FillSeeds()
{
if (!m_Devices.empty())
{
double start, delta = std::floor(double(std::numeric_limits<uint>::max()) / (IterGridKernelCount() * 2 * m_Devices.size()));
const auto delta = std::floor(double(std::numeric_limits<uint>::max()) / (IterGridKernelCount() * 2 * m_Devices.size()));
auto start = delta;
m_Seeds.resize(m_Devices.size());
start = delta;
for (size_t device = 0; device < m_Devices.size(); device++)
{
@ -1944,11 +1944,11 @@ void RendererCL<T, bucketT>::FillSeeds()
template <typename T, typename bucketT>
std::string RendererCL<T, bucketT>::ErrorStr(const std::string& loc, const std::string& error, RendererClDevice* dev)
{
std::string str = loc + "()"s + (dev ?
"\n"s +
dev->m_Wrapper.DeviceName() + "\nPlatform: " +
std::to_string(dev->PlatformIndex()) + ", device: " + std::to_string(dev->DeviceIndex()) : "") + ", error:\n" +
error + "\n";
const std::string str = loc + "()"s + (dev ?
"\n"s +
dev->m_Wrapper.DeviceName() + "\nPlatform: " +
std::to_string(dev->PlatformIndex()) + ", device: " + std::to_string(dev->DeviceIndex()) : "") + ", error:\n" +
error + "\n";
AddToReport(str);
return str;
}

View File

@ -156,30 +156,30 @@ public:
virtual bool ClearFinal();
//Public virtual functions overridden from Renderer or RendererBase.
virtual size_t MemoryAvailable() override;
virtual bool Ok() const override;
virtual size_t SubBatchSize() const override;
virtual size_t ThreadCount() const override;
virtual bool CreateDEFilter(bool& newAlloc) override;
virtual bool CreateSpatialFilter(bool& newAlloc) override;
virtual eRendererType RendererType() const override;
virtual bool Shared() const override;
virtual void ClearErrorReport() override;
virtual string ErrorReportString() override;
virtual vector<string> ErrorReport() override;
virtual bool RandVec(vector<QTIsaac<ISAAC_SIZE, ISAAC_INT>>& randVec) override;
virtual bool AnyNvidia() const override;
size_t MemoryAvailable() override;
bool Ok() const override;
size_t SubBatchSize() const override;
size_t ThreadCount() const override;
bool CreateDEFilter(bool& newAlloc) override;
bool CreateSpatialFilter(bool& newAlloc) override;
eRendererType RendererType() const override;
bool Shared() const override;
void ClearErrorReport() override;
string ErrorReportString() override;
vector<string> ErrorReport() override;
bool RandVec(vector<QTIsaac<ISAAC_SIZE, ISAAC_INT>>& randVec) override;
bool AnyNvidia() const override;
#ifndef TEST_CL
protected:
#endif
//Protected virtual functions overridden from Renderer.
virtual bool Alloc(bool histOnly = false) override;
virtual bool ResetBuckets(bool resetHist = true, bool resetAccum = true) override;
virtual eRenderStatus LogScaleDensityFilter(bool forceOutput = false) override;
virtual eRenderStatus GaussianDensityFilter() override;
virtual eRenderStatus AccumulatorToFinalImage(vector<v4F>& pixels, size_t finalOffset) override;
virtual EmberStats Iterate(size_t iterCount, size_t temporalSample) override;
bool Alloc(bool histOnly = false) override;
bool ResetBuckets(bool resetHist = true, bool resetAccum = true) override;
eRenderStatus LogScaleDensityFilter(bool forceOutput = false) override;
eRenderStatus GaussianDensityFilter() override;
eRenderStatus AccumulatorToFinalImage(vector<v4F>& pixels, size_t finalOffset) override;
EmberStats Iterate(size_t iterCount, size_t temporalSample) override;
#ifndef TEST_CL
private:

View File

@ -74,7 +74,7 @@ void RendererClDevice::ClearErrorReport()
/// <returns>The concatenated error report string</returns>
string RendererClDevice::ErrorReportString()
{
auto s = EmberReport::ErrorReportString();
const auto s = EmberReport::ErrorReportString();
return s + m_Wrapper.ErrorReportString();
}
@ -86,7 +86,7 @@ string RendererClDevice::ErrorReportString()
vector<string> RendererClDevice::ErrorReport()
{
auto ours = EmberReport::ErrorReport();
auto s = m_Wrapper.ErrorReport();
const auto s = m_Wrapper.ErrorReport();
ours.insert(ours.end(), s.begin(), s.end());
return ours;
}

View File

@ -28,9 +28,9 @@ public:
size_t DeviceIndex() const;
//Public virtual functions overridden from base classes.
virtual void ClearErrorReport() override;
virtual string ErrorReportString() override;
virtual vector<string> ErrorReport() override;
void ClearErrorReport() override;
string ErrorReportString() override;
vector<string> ErrorReport() override;
size_t m_Calls;
OpenCLWrapper m_Wrapper;