Followon commit

This commit is contained in:
mfeemster 2014-12-09 02:03:54 -08:00
parent 3e70b8eec6
commit d42cdfafe4
4 changed files with 6 additions and 3 deletions

View File

@ -5,6 +5,7 @@
--Bug Fixes
Fix bad values left in an ember when a render with strips > 1 fails in the final render dialog.
Fix incorrect calculation in dc_cube variation when using OpenCL.
--Code Changes
Break RendererBase::MemoryRequired() into two functions, it and HistMemRequired() and return a tuple.

View File

@ -255,7 +255,7 @@ public:
<< "\t\treal_t x, y, z;\n"
<< "\t\treal_t p = 2 * MwcNext01(mwc) - 1;\n"
<< "\t\treal_t q = 2 * MwcNext01(mwc) - 1;\n"
<< "\t\tuint i = MwcNext(mwc) & 3;\n"
<< "\t\tuint i = MwcNext(mwc) % 3;\n"
<< "\t\tuint j = MwcNext(mwc) & 1;\n"
<< "\n"
<< "\t\tswitch (i)\n"

View File

@ -336,7 +336,7 @@ bool RendererCL<T>::ClearFinal()
template <typename T>
size_t RendererCL<T>::MemoryAvailable()
{
return Ok() ? m_Wrapper.GetInfo<cl_ulong>(PlatformIndex(), DeviceIndex(), CL_DEVICE_GLOBAL_MEM_SIZE) : 0ULL;
return Ok() ? m_Wrapper.GlobalMemSize() : 0ULL;
}
/// <summary>

View File

@ -34,6 +34,7 @@ bool EmberRender(EmberOptions& opt)
string filename;
string inputPath = GetPath(opt.Input());
ostringstream os;
pair<size_t, size_t> p;
vector<Ember<T>> embers;
vector<byte> finalImage, vecRgb;
EmberStats stats;
@ -201,7 +202,8 @@ bool EmberRender(EmberOptions& opt)
}
else
{
strips = CalcStrips(double(renderer->MemoryRequired(1, true)), double(renderer->MemoryAvailable()), opt.UseMem());
p = renderer->MemoryRequired(1, true);
strips = CalcStrips(double(p.second), double(renderer->MemoryAvailable()), opt.UseMem());
if (strips > 1)
VerbosePrint("Setting strips to " << strips << " with specified memory usage of " << opt.UseMem());