mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-02-01 18:40:12 -05:00
--Bug fixes:
-Omit duplicate entries in error reports. -Properly report missing palette file in command line programs.
This commit is contained in:
parent
49e2104fd2
commit
aece4afc60
@ -37,10 +37,10 @@ public:
|
|||||||
/// <returns>Whether anything was read</returns>
|
/// <returns>Whether anything was read</returns>
|
||||||
bool Add(const string& filename, bool force = false)
|
bool Add(const string& filename, bool force = false)
|
||||||
{
|
{
|
||||||
bool added = false;
|
bool added = true;
|
||||||
auto& palettes = m_Palettes[filename];
|
auto palettes = m_Palettes.insert(make_pair(filename, vector<Palette<T>>()));
|
||||||
|
|
||||||
if (palettes.empty() || force)
|
if (force || palettes.second)
|
||||||
{
|
{
|
||||||
string buf;
|
string buf;
|
||||||
const char* loc = __FUNCTION__;
|
const char* loc = __FUNCTION__;
|
||||||
@ -54,20 +54,23 @@ public:
|
|||||||
auto rootNode = xmlDocGetRootElement(doc);
|
auto rootNode = xmlDocGetRootElement(doc);
|
||||||
auto pfilename = shared_ptr<string>(new string(filename));
|
auto pfilename = shared_ptr<string>(new string(filename));
|
||||||
|
|
||||||
palettes.clear();
|
palettes.first->second.clear();
|
||||||
palettes.reserve(buf.size() / 2048);//Roughly what it takes per palette.
|
palettes.first->second.reserve(buf.size() / 2048);//Roughly what it takes per palette.
|
||||||
ParsePalettes(rootNode, pfilename, palettes);
|
ParsePalettes(rootNode, pfilename, palettes.first->second);
|
||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
added = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Couldn't load xml doc");
|
added = false;
|
||||||
|
m_Palettes.erase(filename);
|
||||||
|
AddToReport(string(loc) + " : Couldn't load xml doc");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Couldn't read palette file " + filename);
|
added = false;
|
||||||
|
m_Palettes.erase(filename);
|
||||||
|
AddToReport(string(loc) + " : Couldn't read palette file " + filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -258,7 +261,7 @@ private:
|
|||||||
|
|
||||||
if (ret != 3)
|
if (ret != 3)
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Problem reading hexadecimal color data " + string(&val[colorIndex]));
|
AddToReport(string(loc) + " : Problem reading hexadecimal color data " + string(&val[colorIndex]));
|
||||||
hexError = true;
|
hexError = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -414,14 +414,14 @@ eRenderStatus Renderer<T, bucketT>::Run(vector<byte>& finalImage, double time, s
|
|||||||
|
|
||||||
if (m_SpatialFilter.get() == nullptr || m_TemporalFilter.get() == nullptr)
|
if (m_SpatialFilter.get() == nullptr || m_TemporalFilter.get() == nullptr)
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back("Spatial and temporal filter allocations failed, aborting.\n");
|
AddToReport("Spatial and temporal filter allocations failed, aborting.\n");
|
||||||
success = RENDER_ERROR;
|
success = RENDER_ERROR;
|
||||||
goto Finish;
|
goto Finish;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!resume && !Alloc())
|
if (!resume && !Alloc())
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back("Histogram, accumulator and samples buffer allocations failed, aborting.\n");
|
AddToReport("Histogram, accumulator and samples buffer allocations failed, aborting.\n");
|
||||||
success = RENDER_ERROR;
|
success = RENDER_ERROR;
|
||||||
goto Finish;
|
goto Finish;
|
||||||
}
|
}
|
||||||
@ -444,7 +444,7 @@ eRenderStatus Renderer<T, bucketT>::Run(vector<byte>& finalImage, double time, s
|
|||||||
|
|
||||||
if (!CreateDEFilter(newFilterAlloc))
|
if (!CreateDEFilter(newFilterAlloc))
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back("Density filter creation failed, aborting.\n");
|
AddToReport("Density filter creation failed, aborting.\n");
|
||||||
success = RENDER_ERROR;
|
success = RENDER_ERROR;
|
||||||
goto Finish;
|
goto Finish;
|
||||||
}
|
}
|
||||||
@ -465,7 +465,7 @@ eRenderStatus Renderer<T, bucketT>::Run(vector<byte>& finalImage, double time, s
|
|||||||
|
|
||||||
if (!resume && !AssignIterator())
|
if (!resume && !AssignIterator())
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back("Iterator assignment failed, aborting.\n");
|
AddToReport("Iterator assignment failed, aborting.\n");
|
||||||
success = RENDER_ERROR;
|
success = RENDER_ERROR;
|
||||||
goto Finish;
|
goto Finish;
|
||||||
}
|
}
|
||||||
@ -495,7 +495,7 @@ eRenderStatus Renderer<T, bucketT>::Run(vector<byte>& finalImage, double time, s
|
|||||||
//If no iters were executed, something went catastrophically wrong.
|
//If no iters were executed, something went catastrophically wrong.
|
||||||
if (stats.m_Iters == 0)
|
if (stats.m_Iters == 0)
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back("Zero iterations ran, rendering failed, aborting.\n");
|
AddToReport("Zero iterations ran, rendering failed, aborting.\n");
|
||||||
success = RENDER_ERROR;
|
success = RENDER_ERROR;
|
||||||
Abort();
|
Abort();
|
||||||
goto Finish;
|
goto Finish;
|
||||||
|
@ -146,13 +146,13 @@ public:
|
|||||||
/// Add string to report.
|
/// Add string to report.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="s">The string to add</param>
|
/// <param name="s">The string to add</param>
|
||||||
virtual void AddToReport(const string& s) { m_ErrorReport.push_back(s); }
|
virtual void AddToReport(const string& s) { if (!Contains(m_ErrorReport, s)) m_ErrorReport.push_back(s); }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add a vector of strings to report.
|
/// Add a vector of strings to report.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="vec">The vector of strings to add</param>
|
/// <param name="vec">The vector of strings to add</param>
|
||||||
virtual void AddToReport(const vector<string>& vec) { m_ErrorReport.insert(m_ErrorReport.end(), vec.begin(), vec.end()); }
|
virtual void AddToReport(const vector<string>& vec) { for (auto& v : vec) AddToReport(v); }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Static function to dump a vector of strings passed in.
|
/// Static function to dump a vector of strings passed in.
|
||||||
@ -174,7 +174,7 @@ public:
|
|||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
vector<string> m_ErrorReport;
|
vector<string> m_ErrorReport;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -285,7 +285,7 @@ public:
|
|||||||
xmlNodePtr rootnode;
|
xmlNodePtr rootnode;
|
||||||
Locale locale;//Sets and restores on exit.
|
Locale locale;//Sets and restores on exit.
|
||||||
//Timing t;
|
//Timing t;
|
||||||
m_ErrorReport.clear();
|
ClearErrorReport();
|
||||||
|
|
||||||
//Parse XML string into internal document.
|
//Parse XML string into internal document.
|
||||||
xmlPtr = CX(&buf[0]);
|
xmlPtr = CX(&buf[0]);
|
||||||
@ -296,7 +296,7 @@ public:
|
|||||||
|
|
||||||
if (doc == nullptr)
|
if (doc == nullptr)
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Error parsing xml file " + string(filename));
|
AddToReport(string(loc) + " : Error parsing xml file " + string(filename));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -367,7 +367,7 @@ public:
|
|||||||
//Ensure palette list is setup first.
|
//Ensure palette list is setup first.
|
||||||
if (!m_PaletteList.Size())
|
if (!m_PaletteList.Size())
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Palette list must be initialized before parsing embers.");
|
AddToReport(string(loc) + " : Palette list must be initialized before parsing embers.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -398,7 +398,7 @@ public:
|
|||||||
|
|
||||||
if (istr.bad() || istr.fail())
|
if (istr.bad() || istr.fail())
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Error converting " + string(str));
|
AddToReport(string(loc) + " : Error converting " + string(str));
|
||||||
b = false;
|
b = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -479,7 +479,7 @@ private:
|
|||||||
if (!parseEmberSuccess)
|
if (!parseEmberSuccess)
|
||||||
{
|
{
|
||||||
//Original leaked memory here, ours doesn't.
|
//Original leaked memory here, ours doesn't.
|
||||||
m_ErrorReport.push_back(string(loc) + " : Error parsing ember element");
|
AddToReport(string(loc) + " : Error parsing ember element");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -488,11 +488,11 @@ private:
|
|||||||
if (auto pal = m_PaletteList.GetPalette(PaletteList<T>::m_DefaultFilename, currentEmber.PaletteIndex()))
|
if (auto pal = m_PaletteList.GetPalette(PaletteList<T>::m_DefaultFilename, currentEmber.PaletteIndex()))
|
||||||
currentEmber.m_Palette = *pal;
|
currentEmber.m_Palette = *pal;
|
||||||
else
|
else
|
||||||
m_ErrorReport.push_back(string(loc) + " : Error assigning palette with index " + Itos(currentEmber.PaletteIndex()));
|
AddToReport(string(loc) + " : Error assigning palette with index " + Itos(currentEmber.PaletteIndex()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (!Interpolater<T>::InterpMissingColors(currentEmber.m_Palette.m_Entries))
|
//if (!Interpolater<T>::InterpMissingColors(currentEmber.m_Palette.m_Entries))
|
||||||
// m_ErrorReport.push_back(string(loc) + " : Error interpolating missing palette colors");
|
// AddToReport(string(loc) + " : Error interpolating missing palette colors");
|
||||||
|
|
||||||
currentEmber.CacheXforms();
|
currentEmber.CacheXforms();
|
||||||
currentEmber.m_Index = embers.size();
|
currentEmber.m_Index = embers.size();
|
||||||
@ -531,7 +531,7 @@ private:
|
|||||||
|
|
||||||
if (att == nullptr)
|
if (att == nullptr)
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : <flame> element has no attributes");
|
AddToReport(string(loc) + " : <flame> element has no attributes");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -581,7 +581,7 @@ private:
|
|||||||
else if (!_stricmp("smooth", attStr))
|
else if (!_stricmp("smooth", attStr))
|
||||||
currentEmber.m_Interp = EMBER_INTERP_SMOOTH;
|
currentEmber.m_Interp = EMBER_INTERP_SMOOTH;
|
||||||
else
|
else
|
||||||
m_ErrorReport.push_back(string(loc) + " : Unrecognized interpolation type " + string(attStr));
|
AddToReport(string(loc) + " : Unrecognized interpolation type " + string(attStr));
|
||||||
}
|
}
|
||||||
else if (!Compare(curAtt->name, "palette_interpolation"))
|
else if (!Compare(curAtt->name, "palette_interpolation"))
|
||||||
{
|
{
|
||||||
@ -590,7 +590,7 @@ private:
|
|||||||
else if (!_stricmp("sweep", attStr))
|
else if (!_stricmp("sweep", attStr))
|
||||||
currentEmber.m_PaletteInterp = INTERP_SWEEP;
|
currentEmber.m_PaletteInterp = INTERP_SWEEP;
|
||||||
else
|
else
|
||||||
m_ErrorReport.push_back(string(loc) + " : Unrecognized palette interpolation type " + string(attStr));
|
AddToReport(string(loc) + " : Unrecognized palette interpolation type " + string(attStr));
|
||||||
}
|
}
|
||||||
else if (!Compare(curAtt->name, "interpolation_space") || !Compare(curAtt->name, "interpolation_type"))
|
else if (!Compare(curAtt->name, "interpolation_space") || !Compare(curAtt->name, "interpolation_type"))
|
||||||
{
|
{
|
||||||
@ -603,7 +603,7 @@ private:
|
|||||||
else if (!_stricmp("older", attStr))
|
else if (!_stricmp("older", attStr))
|
||||||
currentEmber.m_AffineInterp = AFFINE_INTERP_OLDER;
|
currentEmber.m_AffineInterp = AFFINE_INTERP_OLDER;
|
||||||
else
|
else
|
||||||
m_ErrorReport.push_back(string(loc) + " : Unrecognized interpolation type " + string(attStr));
|
AddToReport(string(loc) + " : Unrecognized interpolation type " + string(attStr));
|
||||||
}
|
}
|
||||||
else if (!Compare(curAtt->name, "name"))
|
else if (!Compare(curAtt->name, "name"))
|
||||||
{
|
{
|
||||||
@ -619,7 +619,7 @@ private:
|
|||||||
{
|
{
|
||||||
if (sscanf_s(attStr, "%lu %lu", ¤tEmber.m_FinalRasW, ¤tEmber.m_FinalRasH) != 2)
|
if (sscanf_s(attStr, "%lu %lu", ¤tEmber.m_FinalRasW, ¤tEmber.m_FinalRasH) != 2)
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Invalid size attribute " + string(attStr));
|
AddToReport(string(loc) + " : Invalid size attribute " + string(attStr));
|
||||||
xmlFree(attStr);
|
xmlFree(attStr);
|
||||||
|
|
||||||
//These return statements are bad. One because they are inconsistent with others that just assign defaults.
|
//These return statements are bad. One because they are inconsistent with others that just assign defaults.
|
||||||
@ -634,7 +634,7 @@ private:
|
|||||||
{
|
{
|
||||||
if (sscanf_s(attStr, "%lf %lf", &vals[0], &vals[1]) != 2)
|
if (sscanf_s(attStr, "%lf %lf", &vals[0], &vals[1]) != 2)
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Invalid center attribute " + string(attStr));
|
AddToReport(string(loc) + " : Invalid center attribute " + string(attStr));
|
||||||
xmlFree(attStr);
|
xmlFree(attStr);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -659,14 +659,14 @@ private:
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
currentEmber.m_PaletteMode = PALETTE_STEP;
|
currentEmber.m_PaletteMode = PALETTE_STEP;
|
||||||
m_ErrorReport.push_back(string(loc) + " : Unrecognized palette mode " + string(attStr) + ", using step");
|
AddToReport(string(loc) + " : Unrecognized palette mode " + string(attStr) + ", using step");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!Compare(curAtt->name, "background"))
|
else if (!Compare(curAtt->name, "background"))
|
||||||
{
|
{
|
||||||
if (sscanf_s(attStr, "%lf %lf %lf", &vals[0], &vals[1], &vals[2]) != 3)
|
if (sscanf_s(attStr, "%lf %lf %lf", &vals[0], &vals[1], &vals[2]) != 3)
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Invalid background attribute " + string(attStr));
|
AddToReport(string(loc) + " : Invalid background attribute " + string(attStr));
|
||||||
xmlFree(attStr);
|
xmlFree(attStr);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -706,7 +706,7 @@ private:
|
|||||||
|
|
||||||
if (att == nullptr)
|
if (att == nullptr)
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : No attributes for color element");
|
AddToReport(string(loc) + " : No attributes for color element");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -727,21 +727,21 @@ private:
|
|||||||
else if(!Compare(curAtt->name, "rgb"))
|
else if(!Compare(curAtt->name, "rgb"))
|
||||||
{
|
{
|
||||||
if (sscanf_s(attStr, "%lf %lf %lf", &r, &g, &b) != 3)
|
if (sscanf_s(attStr, "%lf %lf %lf", &r, &g, &b) != 3)
|
||||||
m_ErrorReport.push_back(string(loc) + " : Invalid rgb attribute " + string(attStr));
|
AddToReport(string(loc) + " : Invalid rgb attribute " + string(attStr));
|
||||||
}
|
}
|
||||||
else if(!Compare(curAtt->name, "rgba"))
|
else if(!Compare(curAtt->name, "rgba"))
|
||||||
{
|
{
|
||||||
if (sscanf_s(attStr, "%lf %lf %lf %lf", &r, &g, &b, &a) != 4)
|
if (sscanf_s(attStr, "%lf %lf %lf %lf", &r, &g, &b, &a) != 4)
|
||||||
m_ErrorReport.push_back(string(loc) + " : Invalid rgba attribute " + string(attStr));
|
AddToReport(string(loc) + " : Invalid rgba attribute " + string(attStr));
|
||||||
}
|
}
|
||||||
else if(!Compare(curAtt->name, "a"))
|
else if(!Compare(curAtt->name, "a"))
|
||||||
{
|
{
|
||||||
if (sscanf_s(attStr, "%lf", &a) != 1)
|
if (sscanf_s(attStr, "%lf", &a) != 1)
|
||||||
m_ErrorReport.push_back(string(loc) + " : Invalid a attribute " + string(attStr));
|
AddToReport(string(loc) + " : Invalid a attribute " + string(attStr));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Unknown color attribute " + string(CCX(curAtt->name)));
|
AddToReport(string(loc) + " : Unknown color attribute " + string(CCX(curAtt->name)));
|
||||||
}
|
}
|
||||||
|
|
||||||
xmlFree(attStr);
|
xmlFree(attStr);
|
||||||
@ -762,7 +762,7 @@ private:
|
|||||||
{
|
{
|
||||||
stringstream ss;
|
stringstream ss;
|
||||||
ss << "ParseEmberElement() : Color element with bad/missing index attribute " << index;
|
ss << "ParseEmberElement() : Color element with bad/missing index attribute " << index;
|
||||||
m_ErrorReport.push_back(ss.str());
|
AddToReport(ss.str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!Compare(childNode->name, "colors"))
|
else if (!Compare(childNode->name, "colors"))
|
||||||
@ -772,7 +772,7 @@ private:
|
|||||||
|
|
||||||
if (att == nullptr)
|
if (att == nullptr)
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : No attributes for colors element");
|
AddToReport(string(loc) + " : No attributes for colors element");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -788,12 +788,12 @@ private:
|
|||||||
{
|
{
|
||||||
if (!ParseHexColors(attStr, currentEmber, count, -4))
|
if (!ParseHexColors(attStr, currentEmber, count, -4))
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Error parsing hexformatted colors, some may be set to zero");
|
AddToReport(string(loc) + " : Error parsing hexformatted colors, some may be set to zero");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Unknown color attribute " + string(CCX(curAtt->name)));
|
AddToReport(string(loc) + " : Unknown color attribute " + string(CCX(curAtt->name)));
|
||||||
}
|
}
|
||||||
|
|
||||||
xmlFree(attStr);
|
xmlFree(attStr);
|
||||||
@ -811,7 +811,7 @@ private:
|
|||||||
|
|
||||||
if (att == nullptr)
|
if (att == nullptr)
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : No attributes for palette element");
|
AddToReport(string(loc) + " : No attributes for palette element");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -831,13 +831,13 @@ private:
|
|||||||
numBytes = 4;
|
numBytes = 4;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Unrecognized palette format string " + string(attStr) + ", defaulting to RGB");
|
AddToReport(string(loc) + " : Unrecognized palette format string " + string(attStr) + ", defaulting to RGB");
|
||||||
numBytes = 3;
|
numBytes = 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Unknown palette attribute " + string(CCX(curAtt->name)));
|
AddToReport(string(loc) + " : Unknown palette attribute " + string(CCX(curAtt->name)));
|
||||||
}
|
}
|
||||||
|
|
||||||
xmlFree(attStr);
|
xmlFree(attStr);
|
||||||
@ -849,7 +849,7 @@ private:
|
|||||||
|
|
||||||
if (!ParseHexColors(palStr, currentEmber, numColors, numBytes))
|
if (!ParseHexColors(palStr, currentEmber, numColors, numBytes))
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Problem reading hexadecimal color data in palette");
|
AddToReport(string(loc) + " : Problem reading hexadecimal color data in palette");
|
||||||
}
|
}
|
||||||
|
|
||||||
xmlFree(palStr);
|
xmlFree(palStr);
|
||||||
@ -863,7 +863,7 @@ private:
|
|||||||
|
|
||||||
if (att == nullptr)
|
if (att == nullptr)
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : No attributes for palette element");
|
AddToReport(string(loc) + " : No attributes for palette element");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -877,7 +877,7 @@ private:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Unknown symmetry attribute " + string(attStr));
|
AddToReport(string(loc) + " : Unknown symmetry attribute " + string(attStr));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -899,14 +899,14 @@ private:
|
|||||||
|
|
||||||
if (!ParseXform(childNode, finalXform, false, fromEmber))
|
if (!ParseXform(childNode, finalXform, false, fromEmber))
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Error parsing final xform");
|
AddToReport(string(loc) + " : Error parsing final xform");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (finalXform.m_Weight != 0)
|
if (finalXform.m_Weight != 0)
|
||||||
{
|
{
|
||||||
finalXform.m_Weight = 0;
|
finalXform.m_Weight = 0;
|
||||||
m_ErrorReport.push_back(string(loc) + " : Final xforms should not have weight specified, setting to zero");
|
AddToReport(string(loc) + " : Final xforms should not have weight specified, setting to zero");
|
||||||
}
|
}
|
||||||
|
|
||||||
currentEmber.SetFinalXform(finalXform);
|
currentEmber.SetFinalXform(finalXform);
|
||||||
@ -919,7 +919,7 @@ private:
|
|||||||
|
|
||||||
if (!ParseXform(childNode, xform, false, fromEmber))
|
if (!ParseXform(childNode, xform, false, fromEmber))
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Error parsing xform");
|
AddToReport(string(loc) + " : Error parsing xform");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -933,7 +933,7 @@ private:
|
|||||||
//Check for non-zero motion params.
|
//Check for non-zero motion params.
|
||||||
if (fabs(theXform->m_MotionFreq) > 0.0)//Original checked for motion func being non-zero, but it was set to MOTION_SIN (1) in Xform::Init(), so don't check for 0 here.
|
if (fabs(theXform->m_MotionFreq) > 0.0)//Original checked for motion func being non-zero, but it was set to MOTION_SIN (1) in Xform::Init(), so don't check for 0 here.
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Motion parameters should not be specified in regular, non-motion xforms");
|
AddToReport(string(loc) + " : Motion parameters should not be specified in regular, non-motion xforms");
|
||||||
}
|
}
|
||||||
|
|
||||||
//Motion Language: Check the xform element for children - should be named 'motion'.
|
//Motion Language: Check the xform element for children - should be named 'motion'.
|
||||||
@ -944,7 +944,7 @@ private:
|
|||||||
Xform<T> xform(false);//Will only have valid values in fields parsed for motion, all others will be EMPTYFIELD.
|
Xform<T> xform(false);//Will only have valid values in fields parsed for motion, all others will be EMPTYFIELD.
|
||||||
|
|
||||||
if (!ParseXform(motionNode, xform, true, fromEmber))
|
if (!ParseXform(motionNode, xform, true, fromEmber))
|
||||||
m_ErrorReport.push_back(string(loc) + " : Error parsing motion xform");
|
AddToReport(string(loc) + " : Error parsing motion xform");
|
||||||
else
|
else
|
||||||
theXform->m_Motion.push_back(xform);
|
theXform->m_Motion.push_back(xform);
|
||||||
}
|
}
|
||||||
@ -966,7 +966,7 @@ private:
|
|||||||
|
|
||||||
if (att == nullptr)
|
if (att == nullptr)
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : <flame_motion> element has no attributes");
|
AddToReport(string(loc) + " : <flame_motion> element has no attributes");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -990,7 +990,7 @@ private:
|
|||||||
motion.m_MotionFunc = MOTION_SAW;
|
motion.m_MotionFunc = MOTION_SAW;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : invalid flame motion function " + func);
|
AddToReport(string(loc) + " : invalid flame motion function " + func);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1024,7 +1024,7 @@ private:
|
|||||||
|
|
||||||
if (sscanf_s(attStr, "%lf %lf %lf", &r, &g, &b) != 3)
|
if (sscanf_s(attStr, "%lf %lf %lf", &r, &g, &b) != 3)
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Invalid flame motion background attribute " + string(attStr));
|
AddToReport(string(loc) + " : Invalid flame motion background attribute " + string(attStr));
|
||||||
xmlFree(attStr);
|
xmlFree(attStr);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1044,7 +1044,7 @@ private:
|
|||||||
|
|
||||||
if (sscanf_s(attStr, "%lf %lf", &cx, &cy) != 2)
|
if (sscanf_s(attStr, "%lf %lf", &cx, &cy) != 2)
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Invalid flame motion center attribute " + string(attStr));
|
AddToReport(string(loc) + " : Invalid flame motion center attribute " + string(attStr));
|
||||||
xmlFree(attStr);
|
xmlFree(attStr);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1057,7 +1057,7 @@ private:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Unknown flame motion attribute " + string(CCX(curAtt->name)));
|
AddToReport(string(loc) + " : Unknown flame motion attribute " + string(CCX(curAtt->name)));
|
||||||
xmlFree(attStr);
|
xmlFree(attStr);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1076,7 +1076,7 @@ private:
|
|||||||
if (soloXform >= 0 && i != soloXform)
|
if (soloXform >= 0 && i != soloXform)
|
||||||
currentEmber.GetXform(i)->m_Opacity = 0;//Will calc the cached adjusted viz value later.
|
currentEmber.GetXform(i)->m_Opacity = 0;//Will calc the cached adjusted viz value later.
|
||||||
|
|
||||||
return m_ErrorReport.empty();
|
return ErrorReport().empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -1100,7 +1100,7 @@ private:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Failed to parse float value for flame motion attribute \"" + string(CCX(att->name)) + "\" : " + string(attStr));
|
AddToReport(string(loc) + " : Failed to parse float value for flame motion attribute \"" + string(CCX(att->name)) + "\" : " + string(attStr));
|
||||||
}
|
}
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
@ -1129,7 +1129,7 @@ private:
|
|||||||
|
|
||||||
if (attPtr == nullptr)
|
if (attPtr == nullptr)
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Error: No attributes for element");
|
AddToReport(string(loc) + " : Error: No attributes for element");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1173,7 +1173,7 @@ private:
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
xform.m_MotionFunc = MOTION_SIN;
|
xform.m_MotionFunc = MOTION_SIN;
|
||||||
m_ErrorReport.push_back(string(loc) + " : Unknown motion function " + string(attStr) + ", using sin");
|
AddToReport(string(loc) + " : Unknown motion function " + string(attStr) + ", using sin");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!Compare(curAtt->name, "color"))
|
else if (!Compare(curAtt->name, "color"))
|
||||||
@ -1193,7 +1193,7 @@ private:
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
xform.m_ColorX = xform.m_ColorY = T(0.5);
|
xform.m_ColorX = xform.m_ColorY = T(0.5);
|
||||||
m_ErrorReport.push_back(string(loc) + " : Malformed xform color attribute " + string(attStr) + ", using 0.5, 0.5");
|
AddToReport(string(loc) + " : Malformed xform color attribute " + string(attStr) + ", using 0.5, 0.5");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!Compare(curAtt->name, "chaos"))
|
else if (!Compare(curAtt->name, "chaos"))
|
||||||
@ -1211,7 +1211,7 @@ private:
|
|||||||
{
|
{
|
||||||
if (motion == 1)
|
if (motion == 1)
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Motion element cannot have a plotmode attribute");
|
AddToReport(string(loc) + " : Motion element cannot have a plotmode attribute");
|
||||||
}
|
}
|
||||||
else if (!_stricmp("off", attStr))
|
else if (!_stricmp("off", attStr))
|
||||||
xform.m_Opacity = 0;
|
xform.m_Opacity = 0;
|
||||||
@ -1221,7 +1221,7 @@ private:
|
|||||||
if (sscanf_s(attStr, "%lf %lf %lf %lf %lf %lf", &a, &d, &b, &e, &c, &f) != 6)//Original did a complicated parsing scheme. This is easier.//ORIG
|
if (sscanf_s(attStr, "%lf %lf %lf %lf %lf %lf", &a, &d, &b, &e, &c, &f) != 6)//Original did a complicated parsing scheme. This is easier.//ORIG
|
||||||
{
|
{
|
||||||
a = d = b = e = c = f = 0;
|
a = d = b = e = c = f = 0;
|
||||||
m_ErrorReport.push_back(string(loc) + " : Bad coeffs attribute " + string(attStr));
|
AddToReport(string(loc) + " : Bad coeffs attribute " + string(attStr));
|
||||||
}
|
}
|
||||||
|
|
||||||
xform.m_Affine.A(T(a));
|
xform.m_Affine.A(T(a));
|
||||||
@ -1236,7 +1236,7 @@ private:
|
|||||||
if (sscanf_s(attStr, "%lf %lf %lf %lf %lf %lf", &a, &d, &b, &e, &c, &f) != 6)//Original did a complicated parsing scheme. This is easier.//ORIG
|
if (sscanf_s(attStr, "%lf %lf %lf %lf %lf %lf", &a, &d, &b, &e, &c, &f) != 6)//Original did a complicated parsing scheme. This is easier.//ORIG
|
||||||
{
|
{
|
||||||
a = d = b = e = c = f = 0;
|
a = d = b = e = c = f = 0;
|
||||||
m_ErrorReport.push_back(string(loc) + " : Bad post coeffs attribute " + string(attStr));
|
AddToReport(string(loc) + " : Bad post coeffs attribute " + string(attStr));
|
||||||
}
|
}
|
||||||
|
|
||||||
xform.m_Post.A(T(a));
|
xform.m_Post.A(T(a));
|
||||||
@ -1260,7 +1260,7 @@ private:
|
|||||||
}
|
}
|
||||||
//else
|
//else
|
||||||
//{
|
//{
|
||||||
// m_ErrorReport.push_back("Unsupported variation: " + string((const char*)curAtt->name));
|
// AddToReport("Unsupported variation: " + string((const char*)curAtt->name));
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1291,7 +1291,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!var1)
|
if (!var1)
|
||||||
m_ErrorReport.push_back(string(loc) + " : Bad value for var1 " + string(attStr));
|
AddToReport(string(loc) + " : Bad value for var1 " + string(attStr));
|
||||||
|
|
||||||
xmlFree(attStr);
|
xmlFree(attStr);
|
||||||
break;
|
break;
|
||||||
@ -1316,7 +1316,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!var)
|
if (!var)
|
||||||
m_ErrorReport.push_back(string(loc) + " : Bad value for var " + string(attStr));
|
AddToReport(string(loc) + " : Bad value for var " + string(attStr));
|
||||||
|
|
||||||
xmlFree(attStr);
|
xmlFree(attStr);
|
||||||
break;
|
break;
|
||||||
@ -1345,7 +1345,7 @@ private:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Failed to parse parametric variation parameter " + s + " - " + string(attStr));
|
AddToReport(string(loc) + " : Failed to parse parametric variation parameter " + s + " - " + string(attStr));
|
||||||
}
|
}
|
||||||
|
|
||||||
xmlFree(attStr);
|
xmlFree(attStr);
|
||||||
@ -1466,7 +1466,7 @@ private:
|
|||||||
{
|
{
|
||||||
ok = false;
|
ok = false;
|
||||||
r = g = b = 0;
|
r = g = b = 0;
|
||||||
m_ErrorReport.push_back(string(loc) + " : Problem reading hexadecimal color data, assigning to 0");
|
AddToReport(string(loc) + " : Problem reading hexadecimal color data, assigning to 0");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1490,7 +1490,7 @@ private:
|
|||||||
if (sscanf_s(&(colstr[colorIndex]),"%1s", tmps) > 0)
|
if (sscanf_s(&(colstr[colorIndex]),"%1s", tmps) > 0)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Extra data at end of hex color data " + string(&(colstr[colorIndex])));
|
AddToReport(string(loc) + " : Extra data at end of hex color data " + string(&(colstr[colorIndex])));
|
||||||
ok = false;
|
ok = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -330,7 +330,7 @@ bool OpenCLInfo::CheckCL(cl_int err, const char* name)
|
|||||||
{
|
{
|
||||||
ostringstream ss;
|
ostringstream ss;
|
||||||
ss << "ERROR: " << ErrorToStringCL(err) << " in " << name << "." << endl;
|
ss << "ERROR: " << ErrorToStringCL(err) << " in " << name << "." << endl;
|
||||||
m_ErrorReport.push_back(ss.str());
|
AddToReport(ss.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
return err == CL_SUCCESS;
|
return err == CL_SUCCESS;
|
||||||
|
@ -39,8 +39,8 @@ bool OpenCLWrapper::Init(size_t platformIndex, size_t deviceIndex, bool shared)
|
|||||||
auto& devices = m_Info.Devices();
|
auto& devices = m_Info.Devices();
|
||||||
|
|
||||||
m_Init = false;
|
m_Init = false;
|
||||||
m_ErrorReport.clear();
|
ClearErrorReport();
|
||||||
|
|
||||||
if (m_Info.Ok())
|
if (m_Info.Ok())
|
||||||
{
|
{
|
||||||
if (platformIndex < platforms.size() && platformIndex < devices.size())
|
if (platformIndex < platforms.size() && platformIndex < devices.size())
|
||||||
@ -1022,7 +1022,7 @@ bool OpenCLWrapper::CreateSPK(const string& name, const string& program, const s
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (auto& i : m_DeviceVec)
|
for (auto& i : m_DeviceVec)
|
||||||
m_ErrorReport.push_back(spk.m_Program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(i, nullptr));
|
AddToReport(spk.m_Program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(i, nullptr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,8 +125,8 @@ bool RendererCL<T, bucketT>::Init(const vector<pair<size_t, size_t>>& devices, b
|
|||||||
|
|
||||||
if ((b = cld->Init()))//Build a simple program to ensure OpenCL is working right.
|
if ((b = cld->Init()))//Build a simple program to ensure OpenCL is working right.
|
||||||
{
|
{
|
||||||
if (b && !(b = cld->m_Wrapper.AddProgram(m_IterOpenCLKernelCreator.ZeroizeEntryPoint(), zeroizeProgram, m_IterOpenCLKernelCreator.ZeroizeEntryPoint(), m_DoublePrecision))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = cld->m_Wrapper.AddProgram(m_IterOpenCLKernelCreator.ZeroizeEntryPoint(), zeroizeProgram, m_IterOpenCLKernelCreator.ZeroizeEntryPoint(), m_DoublePrecision))) { AddToReport(loc); }
|
||||||
if (b && !(b = cld->m_Wrapper.AddAndWriteImage("Palette", CL_MEM_READ_ONLY, m_PaletteFormat, 256, 1, 0, nullptr))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = cld->m_Wrapper.AddAndWriteImage("Palette", CL_MEM_READ_ONLY, m_PaletteFormat, 256, 1, 0, nullptr))) { AddToReport(loc); }
|
||||||
|
|
||||||
if (b)
|
if (b)
|
||||||
{
|
{
|
||||||
@ -135,7 +135,7 @@ bool RendererCL<T, bucketT>::Init(const vector<pair<size_t, size_t>>& devices, b
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
os << loc << ": failed to init platform " << devices[i].first << ", device " << devices[i].second;
|
os << loc << ": failed to init platform " << devices[i].first << ", device " << devices[i].second;
|
||||||
this->m_ErrorReport.push_back(loc);
|
AddToReport(loc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -143,12 +143,12 @@ bool RendererCL<T, bucketT>::Init(const vector<pair<size_t, size_t>>& devices, b
|
|||||||
catch (const std::exception& e)
|
catch (const std::exception& e)
|
||||||
{
|
{
|
||||||
os << loc << ": failed to init platform " << devices[i].first << ", device " << devices[i].second << ": " << e.what();
|
os << loc << ": failed to init platform " << devices[i].first << ", device " << devices[i].second << ": " << e.what();
|
||||||
this->m_ErrorReport.push_back(os.str());
|
AddToReport(os.str());
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
os << loc << ": failed to init platform " << devices[i].first << ", device " << devices[i].second;
|
os << loc << ": failed to init platform " << devices[i].first << ", device " << devices[i].second;
|
||||||
this->m_ErrorReport.push_back(os.str());
|
AddToReport(os.str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,8 +158,8 @@ bool RendererCL<T, bucketT>::Init(const vector<pair<size_t, size_t>>& devices, b
|
|||||||
m_DEOpenCLKernelCreator = DEOpenCLKernelCreator(m_DoublePrecision, m_Devices[0]->Nvidia());
|
m_DEOpenCLKernelCreator = DEOpenCLKernelCreator(m_DoublePrecision, m_Devices[0]->Nvidia());
|
||||||
|
|
||||||
//Build a simple program to ensure OpenCL is working right.
|
//Build a simple program to ensure OpenCL is working right.
|
||||||
if (b && !(b = firstWrapper.AddProgram(m_DEOpenCLKernelCreator.LogScaleAssignDEEntryPoint(), m_DEOpenCLKernelCreator.LogScaleAssignDEKernel(), m_DEOpenCLKernelCreator.LogScaleAssignDEEntryPoint(), m_DoublePrecision))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = firstWrapper.AddProgram(m_DEOpenCLKernelCreator.LogScaleAssignDEEntryPoint(), m_DEOpenCLKernelCreator.LogScaleAssignDEKernel(), m_DEOpenCLKernelCreator.LogScaleAssignDEEntryPoint(), m_DoublePrecision))) { AddToReport(loc); }
|
||||||
if (b && !(b = firstWrapper.AddProgram(m_IterOpenCLKernelCreator.SumHistEntryPoint(), sumHistProgram, m_IterOpenCLKernelCreator.SumHistEntryPoint(), m_DoublePrecision))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = firstWrapper.AddProgram(m_IterOpenCLKernelCreator.SumHistEntryPoint(), sumHistProgram, m_IterOpenCLKernelCreator.SumHistEntryPoint(), m_DoublePrecision))) { AddToReport(loc); }
|
||||||
|
|
||||||
if (b)
|
if (b)
|
||||||
{
|
{
|
||||||
@ -174,7 +174,7 @@ bool RendererCL<T, bucketT>::Init(const vector<pair<size_t, size_t>>& devices, b
|
|||||||
FillSeeds();
|
FillSeeds();
|
||||||
|
|
||||||
for (size_t device = 0; device < m_Devices.size(); device++)
|
for (size_t device = 0; device < m_Devices.size(); device++)
|
||||||
if (b && !(b = m_Devices[device]->m_Wrapper.AddAndWriteBuffer(m_SeedsBufferName, reinterpret_cast<void*>(m_Seeds[device].data()), SizeOf(m_Seeds[device])))) { this->m_ErrorReport.push_back(loc); break; }
|
if (b && !(b = m_Devices[device]->m_Wrapper.AddAndWriteBuffer(m_SeedsBufferName, reinterpret_cast<void*>(m_Seeds[device].data()), SizeOf(m_Seeds[device])))) { AddToReport(loc); break; }
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Init = b;
|
m_Init = b;
|
||||||
@ -183,7 +183,7 @@ bool RendererCL<T, bucketT>::Init(const vector<pair<size_t, size_t>>& devices, b
|
|||||||
{
|
{
|
||||||
m_Devices.clear();
|
m_Devices.clear();
|
||||||
os << loc << ": failed to init all devices and platforms.";
|
os << loc << ": failed to init all devices and platforms.";
|
||||||
this->m_ErrorReport.push_back(os.str());
|
AddToReport(os.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_Init;
|
return m_Init;
|
||||||
@ -208,7 +208,7 @@ bool RendererCL<T, bucketT>::SetOutputTexture(GLuint outputTexID)
|
|||||||
|
|
||||||
if (!firstWrapper.AddAndWriteImage(m_FinalImageName, CL_MEM_WRITE_ONLY, m_FinalFormat, FinalRasW(), FinalRasH(), 0, nullptr, firstWrapper.Shared(), m_OutputTexID))
|
if (!firstWrapper.AddAndWriteImage(m_FinalImageName, CL_MEM_WRITE_ONLY, m_FinalFormat, FinalRasW(), FinalRasH(), 0, nullptr, firstWrapper.Shared(), m_OutputTexID))
|
||||||
{
|
{
|
||||||
this->m_ErrorReport.push_back(loc);
|
AddToReport(loc);
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,7 +302,7 @@ bool RendererCL<T, bucketT>::ClearHist()
|
|||||||
const char* loc = __FUNCTION__;
|
const char* loc = __FUNCTION__;
|
||||||
|
|
||||||
for (size_t i = 0; i < m_Devices.size(); i++)
|
for (size_t i = 0; i < m_Devices.size(); i++)
|
||||||
if (b && !(b = ClearBuffer(i, m_HistBufferName, uint(SuperRasW()), uint(SuperRasH()), sizeof(v4bT)))) { this->m_ErrorReport.push_back(loc); break; }
|
if (b && !(b = ClearBuffer(i, m_HistBufferName, uint(SuperRasW()), uint(SuperRasH()), sizeof(v4bT)))) { AddToReport(loc); break; }
|
||||||
|
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
@ -318,7 +318,7 @@ bool RendererCL<T, bucketT>::ClearHist(size_t device)
|
|||||||
bool b = device < m_Devices.size();
|
bool b = device < m_Devices.size();
|
||||||
const char* loc = __FUNCTION__;
|
const char* loc = __FUNCTION__;
|
||||||
|
|
||||||
if (b && !(b = ClearBuffer(device, m_HistBufferName, uint(SuperRasW()), uint(SuperRasH()), sizeof(v4bT)))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = ClearBuffer(device, m_HistBufferName, uint(SuperRasW()), uint(SuperRasH()), sizeof(v4bT)))) { AddToReport(loc); }
|
||||||
|
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
@ -347,7 +347,7 @@ bool RendererCL<T, bucketT>::WritePoints(size_t device, vector<PointCL<T>>& vec)
|
|||||||
const char* loc = __FUNCTION__;
|
const char* loc = __FUNCTION__;
|
||||||
|
|
||||||
if (device < m_Devices.size())
|
if (device < m_Devices.size())
|
||||||
if (!(b = m_Devices[device]->m_Wrapper.WriteBuffer(m_PointsBufferName, reinterpret_cast<void*>(vec.data()), SizeOf(vec)))) { this->m_ErrorReport.push_back(loc); }
|
if (!(b = m_Devices[device]->m_Wrapper.WriteBuffer(m_PointsBufferName, reinterpret_cast<void*>(vec.data()), SizeOf(vec)))) { AddToReport(loc); }
|
||||||
|
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
@ -432,7 +432,7 @@ bool RendererCL<T, bucketT>::ClearFinal()
|
|||||||
bool b = wrapper.WriteImage2D(index, wrapper.Shared(), FinalRasW(), FinalRasH(), 0, v.data());
|
bool b = wrapper.WriteImage2D(index, wrapper.Shared(), FinalRasW(), FinalRasH(), 0, v.data());
|
||||||
|
|
||||||
if (!b)
|
if (!b)
|
||||||
this->m_ErrorReport.push_back(__FUNCTION__);
|
AddToReport(__FUNCTION__);
|
||||||
|
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
@ -532,9 +532,9 @@ bool RendererCL<T, bucketT>::CreateDEFilter(bool& newAlloc)
|
|||||||
const char* loc = __FUNCTION__;
|
const char* loc = __FUNCTION__;
|
||||||
auto& wrapper = m_Devices[0]->m_Wrapper;
|
auto& wrapper = m_Devices[0]->m_Wrapper;
|
||||||
|
|
||||||
if (b && !(b = wrapper.AddAndWriteBuffer(m_DECoefsBufferName, reinterpret_cast<void*>(const_cast<bucketT*>(m_DensityFilter->Coefs())), m_DensityFilter->CoefsSizeBytes()))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = wrapper.AddAndWriteBuffer(m_DECoefsBufferName, reinterpret_cast<void*>(const_cast<bucketT*>(m_DensityFilter->Coefs())), m_DensityFilter->CoefsSizeBytes()))) { AddToReport(loc); }
|
||||||
if (b && !(b = wrapper.AddAndWriteBuffer(m_DEWidthsBufferName, reinterpret_cast<void*>(const_cast<bucketT*>(m_DensityFilter->Widths())), m_DensityFilter->WidthsSizeBytes()))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = wrapper.AddAndWriteBuffer(m_DEWidthsBufferName, reinterpret_cast<void*>(const_cast<bucketT*>(m_DensityFilter->Widths())), m_DensityFilter->WidthsSizeBytes()))) { AddToReport(loc); }
|
||||||
if (b && !(b = wrapper.AddAndWriteBuffer(m_DECoefIndicesBufferName, reinterpret_cast<void*>(const_cast<uint*>(m_DensityFilter->CoefIndices())), m_DensityFilter->CoefsIndicesSizeBytes()))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = wrapper.AddAndWriteBuffer(m_DECoefIndicesBufferName, reinterpret_cast<void*>(const_cast<uint*>(m_DensityFilter->CoefIndices())), m_DensityFilter->CoefsIndicesSizeBytes()))) { AddToReport(loc); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -557,7 +557,7 @@ bool RendererCL<T, bucketT>::CreateSpatialFilter(bool& newAlloc)
|
|||||||
if (!m_Devices.empty() && Renderer<T, bucketT>::CreateSpatialFilter(newAlloc))
|
if (!m_Devices.empty() && Renderer<T, bucketT>::CreateSpatialFilter(newAlloc))
|
||||||
{
|
{
|
||||||
if (newAlloc)
|
if (newAlloc)
|
||||||
if (!(b = m_Devices[0]->m_Wrapper.AddAndWriteBuffer(m_SpatialFilterCoefsBufferName, reinterpret_cast<void*>(m_SpatialFilter->Filter()), m_SpatialFilter->BufferSizeBytes()))) { this->m_ErrorReport.push_back(__FUNCTION__); }
|
if (!(b = m_Devices[0]->m_Wrapper.AddAndWriteBuffer(m_SpatialFilterCoefsBufferName, reinterpret_cast<void*>(m_SpatialFilter->Filter()), m_SpatialFilter->BufferSizeBytes()))) { AddToReport(__FUNCTION__); }
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
b = false;
|
b = false;
|
||||||
@ -629,7 +629,7 @@ bool RendererCL<T, bucketT>::RandVec(vector<QTIsaac<ISAAC_SIZE, ISAAC_INT>>& ran
|
|||||||
FillSeeds();
|
FillSeeds();
|
||||||
|
|
||||||
for (size_t device = 0; device < m_Devices.size(); device++)
|
for (size_t device = 0; device < m_Devices.size(); device++)
|
||||||
if (b && !(b = m_Devices[device]->m_Wrapper.AddAndWriteBuffer(m_SeedsBufferName, reinterpret_cast<void*>(m_Seeds[device].data()), SizeOf(m_Seeds[device])))) { this->m_ErrorReport.push_back(loc); break; }
|
if (b && !(b = m_Devices[device]->m_Wrapper.AddAndWriteBuffer(m_SeedsBufferName, reinterpret_cast<void*>(m_Seeds[device].data()), SizeOf(m_Seeds[device])))) { AddToReport(loc); break; }
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
b = false;
|
b = false;
|
||||||
@ -663,25 +663,25 @@ bool RendererCL<T, bucketT>::Alloc(bool histOnly)
|
|||||||
|
|
||||||
auto& wrapper = m_Devices[0]->m_Wrapper;
|
auto& wrapper = m_Devices[0]->m_Wrapper;
|
||||||
|
|
||||||
if (b && !(b = wrapper.AddBuffer(m_DEFilterParamsBufferName, sizeof(m_DensityFilterCL)))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = wrapper.AddBuffer(m_DEFilterParamsBufferName, sizeof(m_DensityFilterCL)))) { AddToReport(loc); }
|
||||||
if (b && !(b = wrapper.AddBuffer(m_SpatialFilterParamsBufferName, sizeof(m_SpatialFilterCL)))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = wrapper.AddBuffer(m_SpatialFilterParamsBufferName, sizeof(m_SpatialFilterCL)))) { AddToReport(loc); }
|
||||||
if (b && !(b = wrapper.AddBuffer(m_CurvesCsaName, SizeOf(m_Csa.m_Entries)))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = wrapper.AddBuffer(m_CurvesCsaName, SizeOf(m_Csa.m_Entries)))) { AddToReport(loc); }
|
||||||
if (b && !(b = wrapper.AddBuffer(m_AccumBufferName, accumLength))) { this->m_ErrorReport.push_back(loc); }//Accum buffer.
|
if (b && !(b = wrapper.AddBuffer(m_AccumBufferName, accumLength))) { AddToReport(loc); }//Accum buffer.
|
||||||
|
|
||||||
for (auto& device : m_Devices)
|
for (auto& device : m_Devices)
|
||||||
{
|
{
|
||||||
if (b && !(b = device->m_Wrapper.AddBuffer(m_EmberBufferName, sizeof(m_EmberCL)))) { this->m_ErrorReport.push_back(loc); break; }
|
if (b && !(b = device->m_Wrapper.AddBuffer(m_EmberBufferName, sizeof(m_EmberCL)))) { AddToReport(loc); break; }
|
||||||
if (b && !(b = device->m_Wrapper.AddBuffer(m_XformsBufferName, SizeOf(m_XformsCL)))) { this->m_ErrorReport.push_back(loc); break; }
|
if (b && !(b = device->m_Wrapper.AddBuffer(m_XformsBufferName, SizeOf(m_XformsCL)))) { AddToReport(loc); break; }
|
||||||
if (b && !(b = device->m_Wrapper.AddBuffer(m_ParVarsBufferName, 128 * sizeof(T)))) { this->m_ErrorReport.push_back(loc); break; }
|
if (b && !(b = device->m_Wrapper.AddBuffer(m_ParVarsBufferName, 128 * sizeof(T)))) { AddToReport(loc); break; }
|
||||||
if (b && !(b = device->m_Wrapper.AddBuffer(m_DistBufferName, CHOOSE_XFORM_GRAIN))) { this->m_ErrorReport.push_back(loc); break; }//Will be resized for xaos.
|
if (b && !(b = device->m_Wrapper.AddBuffer(m_DistBufferName, CHOOSE_XFORM_GRAIN))) { AddToReport(loc); break; }//Will be resized for xaos.
|
||||||
if (b && !(b = device->m_Wrapper.AddBuffer(m_CarToRasBufferName, sizeof(m_CarToRasCL)))) { this->m_ErrorReport.push_back(loc); break; }
|
if (b && !(b = device->m_Wrapper.AddBuffer(m_CarToRasBufferName, sizeof(m_CarToRasCL)))) { AddToReport(loc); break; }
|
||||||
if (b && !(b = device->m_Wrapper.AddBuffer(m_HistBufferName, histLength))) { this->m_ErrorReport.push_back(loc); break; }//Histogram. Will memset to zero later.
|
if (b && !(b = device->m_Wrapper.AddBuffer(m_HistBufferName, histLength))) { AddToReport(loc); break; }//Histogram. Will memset to zero later.
|
||||||
if (b && !(b = device->m_Wrapper.AddBuffer(m_PointsBufferName, IterGridKernelCount() * sizeof(PointCL<T>)))) { this->m_ErrorReport.push_back(loc); break; }//Points between iter calls.
|
if (b && !(b = device->m_Wrapper.AddBuffer(m_PointsBufferName, IterGridKernelCount() * sizeof(PointCL<T>)))) { AddToReport(loc); break; }//Points between iter calls.
|
||||||
}
|
}
|
||||||
|
|
||||||
LeaveResize();
|
LeaveResize();
|
||||||
|
|
||||||
if (b && !(b = SetOutputTexture(m_OutputTexID))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = SetOutputTexture(m_OutputTexID))) { AddToReport(loc); }
|
||||||
|
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
@ -734,7 +734,7 @@ eRenderStatus RendererCL<T, bucketT>::GaussianDensityFilter()
|
|||||||
// Renderer<T, bucketT>::ResetBuckets(false, true);
|
// Renderer<T, bucketT>::ResetBuckets(false, true);
|
||||||
// Renderer<T, bucketT>::GaussianDensityFilter();
|
// Renderer<T, bucketT>::GaussianDensityFilter();
|
||||||
//
|
//
|
||||||
// if (!m_Wrapper.WriteBuffer(m_AccumBufferName, AccumulatorBuckets(), accumLength)) { this->m_ErrorReport.push_back(loc); return RENDER_ERROR; }
|
// if (!m_Wrapper.WriteBuffer(m_AccumBufferName, AccumulatorBuckets(), accumLength)) { AddToReport(loc); return RENDER_ERROR; }
|
||||||
// return RENDER_OK;
|
// return RENDER_OK;
|
||||||
//}
|
//}
|
||||||
//else
|
//else
|
||||||
@ -807,12 +807,12 @@ EmberStats RendererCL<T, bucketT>::Iterate(size_t iterCount, size_t temporalSamp
|
|||||||
{
|
{
|
||||||
auto& wrapper = device->m_Wrapper;
|
auto& wrapper = device->m_Wrapper;
|
||||||
|
|
||||||
if (b && !(b = wrapper.WriteBuffer (m_EmberBufferName, reinterpret_cast<void*>(&m_EmberCL), sizeof(m_EmberCL)))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = wrapper.WriteBuffer (m_EmberBufferName, reinterpret_cast<void*>(&m_EmberCL), sizeof(m_EmberCL)))) { AddToReport(loc); }
|
||||||
if (b && !(b = wrapper.WriteBuffer (m_XformsBufferName, reinterpret_cast<void*>(m_XformsCL.data()), sizeof(m_XformsCL[0]) * m_XformsCL.size()))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = wrapper.WriteBuffer (m_XformsBufferName, reinterpret_cast<void*>(m_XformsCL.data()), sizeof(m_XformsCL[0]) * m_XformsCL.size()))) { AddToReport(loc); }
|
||||||
if (b && !(b = wrapper.AddAndWriteBuffer(m_DistBufferName, reinterpret_cast<void*>(const_cast<byte*>(XformDistributions())), XformDistributionsSize()))) { this->m_ErrorReport.push_back(loc); }//Will be resized for xaos.
|
if (b && !(b = wrapper.AddAndWriteBuffer(m_DistBufferName, reinterpret_cast<void*>(const_cast<byte*>(XformDistributions())), XformDistributionsSize()))) { AddToReport(loc); }//Will be resized for xaos.
|
||||||
if (b && !(b = wrapper.WriteBuffer (m_CarToRasBufferName, reinterpret_cast<void*>(&m_CarToRasCL), sizeof(m_CarToRasCL)))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = wrapper.WriteBuffer (m_CarToRasBufferName, reinterpret_cast<void*>(&m_CarToRasCL), sizeof(m_CarToRasCL)))) { AddToReport(loc); }
|
||||||
|
|
||||||
if (b && !(b = wrapper.AddAndWriteImage("Palette", CL_MEM_READ_ONLY, m_PaletteFormat, m_Dmap.m_Entries.size(), 1, 0, m_Dmap.m_Entries.data()))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = wrapper.AddAndWriteImage("Palette", CL_MEM_READ_ONLY, m_PaletteFormat, m_Dmap.m_Entries.size(), 1, 0, m_Dmap.m_Entries.data()))) { AddToReport(loc); }
|
||||||
|
|
||||||
if (b)
|
if (b)
|
||||||
{
|
{
|
||||||
@ -825,7 +825,7 @@ EmberStats RendererCL<T, bucketT>::Iterate(size_t iterCount, size_t temporalSamp
|
|||||||
if (!wrapper.AddAndWriteBuffer(m_ParVarsBufferName, m_Params.second.data(), m_Params.second.size() * sizeof(m_Params.second[0])))
|
if (!wrapper.AddAndWriteBuffer(m_ParVarsBufferName, m_Params.second.data(), m_Params.second.size() * sizeof(m_Params.second[0])))
|
||||||
{
|
{
|
||||||
m_Abort = true;
|
m_Abort = true;
|
||||||
this->m_ErrorReport.push_back(loc);
|
AddToReport(loc);
|
||||||
return stats;
|
return stats;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -853,7 +853,7 @@ EmberStats RendererCL<T, bucketT>::Iterate(size_t iterCount, size_t temporalSamp
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_Abort = true;
|
m_Abort = true;
|
||||||
this->m_ErrorReport.push_back(loc);
|
AddToReport(loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
return stats;
|
return stats;
|
||||||
@ -885,7 +885,7 @@ bool RendererCL<T, bucketT>::BuildIterProgramForEmber(bool doAccum)
|
|||||||
{
|
{
|
||||||
m_ResizeCs.Enter();//Just use the resize CS for lack of a better one.
|
m_ResizeCs.Enter();//Just use the resize CS for lack of a better one.
|
||||||
b = false;
|
b = false;
|
||||||
this->m_ErrorReport.push_back(string(loc) + "()\n" + dev->m_Wrapper.DeviceName() + ":\nBuilding the following program failed: \n" + m_IterKernel + "\n");
|
AddToReport(string(loc) + "()\n" + dev->m_Wrapper.DeviceName() + ":\nBuilding the following program failed: \n" + m_IterKernel + "\n");
|
||||||
m_ResizeCs.Leave();
|
m_ResizeCs.Leave();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -979,18 +979,18 @@ bool RendererCL<T, bucketT>::RunIter(size_t iterCount, size_t temporalSample, si
|
|||||||
size_t iterCountThisLaunch = iterCountPerKernel * IterGridKernelWidth() * IterGridKernelHeight();
|
size_t iterCountThisLaunch = iterCountPerKernel * IterGridKernelWidth() * IterGridKernelHeight();
|
||||||
//cout << "itersRemaining " << itersRemaining << ", iterCountPerKernel " << iterCountPerKernel << ", iterCountThisLaunch " << iterCountThisLaunch << endl;
|
//cout << "itersRemaining " << itersRemaining << ", iterCountPerKernel " << iterCountPerKernel << ", iterCountThisLaunch " << iterCountThisLaunch << endl;
|
||||||
|
|
||||||
if (b && !(b = wrapper.SetArg (kernelIndex, argIndex++, iterCountPerKernel))) { this->m_ErrorReport.push_back(loc); }//Number of iters for each thread to run.
|
if (b && !(b = wrapper.SetArg (kernelIndex, argIndex++, iterCountPerKernel))) { AddToReport(loc); }//Number of iters for each thread to run.
|
||||||
if (b && !(b = wrapper.SetArg (kernelIndex, argIndex++, fuse))) { this->m_ErrorReport.push_back(loc); }//Number of iters to fuse.
|
if (b && !(b = wrapper.SetArg (kernelIndex, argIndex++, fuse))) { AddToReport(loc); }//Number of iters to fuse.
|
||||||
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, m_SeedsBufferName))) { this->m_ErrorReport.push_back(loc); }//Seeds.
|
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, m_SeedsBufferName))) { AddToReport(loc); }//Seeds.
|
||||||
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, m_EmberBufferName))) { this->m_ErrorReport.push_back(loc); }//Ember.
|
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, m_EmberBufferName))) { AddToReport(loc); }//Ember.
|
||||||
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, m_XformsBufferName))) { this->m_ErrorReport.push_back(loc); }//Xforms.
|
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, m_XformsBufferName))) { AddToReport(loc); }//Xforms.
|
||||||
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, m_ParVarsBufferName))) { this->m_ErrorReport.push_back(loc); }//Parametric variation parameters.
|
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, m_ParVarsBufferName))) { AddToReport(loc); }//Parametric variation parameters.
|
||||||
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, m_DistBufferName))) { this->m_ErrorReport.push_back(loc); }//Xform distributions.
|
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, m_DistBufferName))) { AddToReport(loc); }//Xform distributions.
|
||||||
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, m_CarToRasBufferName))) { this->m_ErrorReport.push_back(loc); }//Coordinate converter.
|
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, m_CarToRasBufferName))) { AddToReport(loc); }//Coordinate converter.
|
||||||
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, m_HistBufferName))) { this->m_ErrorReport.push_back(loc); }//Histogram.
|
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, m_HistBufferName))) { AddToReport(loc); }//Histogram.
|
||||||
if (b && !(b = wrapper.SetArg (kernelIndex, argIndex++, histSuperSize))) { this->m_ErrorReport.push_back(loc); }//Histogram size.
|
if (b && !(b = wrapper.SetArg (kernelIndex, argIndex++, histSuperSize))) { AddToReport(loc); }//Histogram size.
|
||||||
if (b && !(b = wrapper.SetImageArg (kernelIndex, argIndex++, false, "Palette"))) { this->m_ErrorReport.push_back(loc); }//Palette.
|
if (b && !(b = wrapper.SetImageArg (kernelIndex, argIndex++, false, "Palette"))) { AddToReport(loc); }//Palette.
|
||||||
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, m_PointsBufferName))) { this->m_ErrorReport.push_back(loc); }//Random start points.
|
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, m_PointsBufferName))) { AddToReport(loc); }//Random start points.
|
||||||
|
|
||||||
if (b && !(b = wrapper.RunKernel(kernelIndex,
|
if (b && !(b = wrapper.RunKernel(kernelIndex,
|
||||||
IterGridKernelWidth(),//Total grid dims.
|
IterGridKernelWidth(),//Total grid dims.
|
||||||
@ -1002,7 +1002,7 @@ bool RendererCL<T, bucketT>::RunIter(size_t iterCount, size_t temporalSample, si
|
|||||||
{
|
{
|
||||||
success = false;
|
success = false;
|
||||||
m_Abort = true;
|
m_Abort = true;
|
||||||
this->m_ErrorReport.push_back(loc);
|
AddToReport(loc);
|
||||||
atomLaunchesRan.fetch_sub(1);
|
atomLaunchesRan.fetch_sub(1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1073,7 +1073,7 @@ bool RendererCL<T, bucketT>::RunIter(size_t iterCount, size_t temporalSample, si
|
|||||||
{
|
{
|
||||||
if (((TemporalSamples() == 1) || (temporalSample == TemporalSamples() - 1)) &&//If there are no temporal samples (not animating), or the current one is the last...
|
if (((TemporalSamples() == 1) || (temporalSample == TemporalSamples() - 1)) &&//If there are no temporal samples (not animating), or the current one is the last...
|
||||||
((m_LastIter + itersRan) >= ItersPerTemporalSample()))//...and the required number of iters for that sample have completed...
|
((m_LastIter + itersRan) >= ItersPerTemporalSample()))//...and the required number of iters for that sample have completed...
|
||||||
if (success && !(success = SumDeviceHist())) { this->m_ErrorReport.push_back(loc); }//...read the histogram from the secondary devices and sum them to the primary.
|
if (success && !(success = SumDeviceHist())) { AddToReport(loc); }//...read the histogram from the secondary devices and sum them to the primary.
|
||||||
}
|
}
|
||||||
|
|
||||||
//t2.Toc(__FUNCTION__);
|
//t2.Toc(__FUNCTION__);
|
||||||
@ -1107,20 +1107,20 @@ eRenderStatus RendererCL<T, bucketT>::RunLogScaleFilter()
|
|||||||
|
|
||||||
OpenCLWrapper::MakeEvenGridDims(blockW, blockH, gridW, gridH);
|
OpenCLWrapper::MakeEvenGridDims(blockW, blockH, gridW, gridH);
|
||||||
|
|
||||||
if (b && !(b = wrapper.AddAndWriteBuffer(m_DEFilterParamsBufferName, reinterpret_cast<void*>(&m_DensityFilterCL), sizeof(m_DensityFilterCL)))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = wrapper.AddAndWriteBuffer(m_DEFilterParamsBufferName, reinterpret_cast<void*>(&m_DensityFilterCL), sizeof(m_DensityFilterCL)))) { AddToReport(loc); }
|
||||||
|
|
||||||
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, m_HistBufferName))) { this->m_ErrorReport.push_back(loc); }//Histogram.
|
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, m_HistBufferName))) { AddToReport(loc); }//Histogram.
|
||||||
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, m_AccumBufferName))) { this->m_ErrorReport.push_back(loc); }//Accumulator.
|
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, m_AccumBufferName))) { AddToReport(loc); }//Accumulator.
|
||||||
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, m_DEFilterParamsBufferName))) { this->m_ErrorReport.push_back(loc); }//DensityFilterCL.
|
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, m_DEFilterParamsBufferName))) { AddToReport(loc); }//DensityFilterCL.
|
||||||
|
|
||||||
//t.Tic();
|
//t.Tic();
|
||||||
if (b && !(b = wrapper.RunKernel(kernelIndex, gridW, gridH, 1, blockW, blockH, 1))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = wrapper.RunKernel(kernelIndex, gridW, gridH, 1, blockW, blockH, 1))) { AddToReport(loc); }
|
||||||
//t.Toc(loc);
|
//t.Toc(loc);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
b = false;
|
b = false;
|
||||||
this->m_ErrorReport.push_back(loc);
|
AddToReport(loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (b && m_Callback && m_LastIterPercent >= 99.0)//Only update progress if we've really reached the end, not via forced output.
|
if (b && m_Callback && m_LastIterPercent >= 99.0)//Only update progress if we've really reached the end, not via forced output.
|
||||||
@ -1178,7 +1178,7 @@ eRenderStatus RendererCL<T, bucketT>::RunDensityFilter()
|
|||||||
uint chunkSizeH = gapH + 1;
|
uint chunkSizeH = gapH + 1;
|
||||||
double totalChunks = chunkSizeW * chunkSizeH;
|
double totalChunks = chunkSizeW * chunkSizeH;
|
||||||
|
|
||||||
if (b && !(b = wrapper.AddAndWriteBuffer(m_DEFilterParamsBufferName, reinterpret_cast<void*>(&m_DensityFilterCL), sizeof(m_DensityFilterCL)))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = wrapper.AddAndWriteBuffer(m_DEFilterParamsBufferName, reinterpret_cast<void*>(&m_DensityFilterCL), sizeof(m_DensityFilterCL)))) { AddToReport(loc); }
|
||||||
|
|
||||||
#ifdef ROW_ONLY_DE
|
#ifdef ROW_ONLY_DE
|
||||||
blockSizeW = 64;//These *must* both be divisible by 16 or else pixels will go missing.
|
blockSizeW = 64;//These *must* both be divisible by 16 or else pixels will go missing.
|
||||||
@ -1198,7 +1198,7 @@ eRenderStatus RendererCL<T, bucketT>::RunDensityFilter()
|
|||||||
for (uint colChunk = 0; b && !m_Abort && colChunk < chunkSizeW; colChunk++)
|
for (uint colChunk = 0; b && !m_Abort && colChunk < chunkSizeW; colChunk++)
|
||||||
{
|
{
|
||||||
//t2.Tic();
|
//t2.Tic();
|
||||||
if (b && !(b = RunDensityFilterPrivate(kernelIndex, gridW, gridH, blockSizeW, blockSizeH, chunkSizeW, chunkSizeH, colChunk, rowChunk))) { m_Abort = true; this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = RunDensityFilterPrivate(kernelIndex, gridW, gridH, blockSizeW, blockSizeH, chunkSizeW, chunkSizeH, colChunk, rowChunk))) { m_Abort = true; AddToReport(loc); }
|
||||||
//t2.Toc(loc);
|
//t2.Toc(loc);
|
||||||
|
|
||||||
if (b && m_Callback)
|
if (b && m_Callback)
|
||||||
@ -1221,7 +1221,7 @@ eRenderStatus RendererCL<T, bucketT>::RunDensityFilter()
|
|||||||
for (uint colChunk = 0; b && !m_Abort && colChunk < chunkSizeW; colChunk++)
|
for (uint colChunk = 0; b && !m_Abort && colChunk < chunkSizeW; colChunk++)
|
||||||
{
|
{
|
||||||
//t2.Tic();
|
//t2.Tic();
|
||||||
if (b && !(b = RunDensityFilterPrivate(kernelIndex, gridW, gridH, blockSizeW, blockSizeH, chunkSizeW, chunkSizeH, colChunk, rowChunk))) { m_Abort = true; this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = RunDensityFilterPrivate(kernelIndex, gridW, gridH, blockSizeW, blockSizeH, chunkSizeW, chunkSizeH, colChunk, rowChunk))) { m_Abort = true; AddToReport(loc); }
|
||||||
//t2.Toc(loc);
|
//t2.Toc(loc);
|
||||||
|
|
||||||
if (b && m_Callback)
|
if (b && m_Callback)
|
||||||
@ -1244,7 +1244,7 @@ eRenderStatus RendererCL<T, bucketT>::RunDensityFilter()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
b = false;
|
b = false;
|
||||||
this->m_ErrorReport.push_back(loc);
|
AddToReport(loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_Abort ? RENDER_ABORT : (b ? RENDER_OK : RENDER_ERROR);
|
return m_Abort ? RENDER_ABORT : (b ? RENDER_OK : RENDER_ERROR);
|
||||||
@ -1277,8 +1277,8 @@ eRenderStatus RendererCL<T, bucketT>::RunFinalAccum()
|
|||||||
//This is needed with or without early clip.
|
//This is needed with or without early clip.
|
||||||
ConvertSpatialFilter();
|
ConvertSpatialFilter();
|
||||||
|
|
||||||
if (b && !(b = wrapper.AddAndWriteBuffer(m_SpatialFilterParamsBufferName, reinterpret_cast<void*>(&m_SpatialFilterCL), sizeof(m_SpatialFilterCL)))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = wrapper.AddAndWriteBuffer(m_SpatialFilterParamsBufferName, reinterpret_cast<void*>(&m_SpatialFilterCL), sizeof(m_SpatialFilterCL)))) { AddToReport(loc); }
|
||||||
if (b && !(b = wrapper.AddAndWriteBuffer(m_CurvesCsaName, m_Csa.m_Entries.data(), SizeOf(m_Csa.m_Entries)))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = wrapper.AddAndWriteBuffer(m_CurvesCsaName, m_Csa.m_Entries.data(), SizeOf(m_Csa.m_Entries)))) { AddToReport(loc); }
|
||||||
|
|
||||||
//Since early clip requires gamma correcting the entire accumulator first,
|
//Since early clip requires gamma correcting the entire accumulator first,
|
||||||
//it can't be done inside of the normal final accumulation kernel, so
|
//it can't be done inside of the normal final accumulation kernel, so
|
||||||
@ -1296,15 +1296,15 @@ eRenderStatus RendererCL<T, bucketT>::RunFinalAccum()
|
|||||||
gridH = m_SpatialFilterCL.m_SuperRasH;
|
gridH = m_SpatialFilterCL.m_SuperRasH;
|
||||||
OpenCLWrapper::MakeEvenGridDims(blockW, blockH, gridW, gridH);
|
OpenCLWrapper::MakeEvenGridDims(blockW, blockH, gridW, gridH);
|
||||||
|
|
||||||
if (b && !(b = wrapper.SetBufferArg(gammaCorrectKernelIndex, argIndex++, m_AccumBufferName))) { this->m_ErrorReport.push_back(loc); }//Accumulator.
|
if (b && !(b = wrapper.SetBufferArg(gammaCorrectKernelIndex, argIndex++, m_AccumBufferName))) { AddToReport(loc); }//Accumulator.
|
||||||
if (b && !(b = wrapper.SetBufferArg(gammaCorrectKernelIndex, argIndex++, m_SpatialFilterParamsBufferName))) { this->m_ErrorReport.push_back(loc); }//SpatialFilterCL.
|
if (b && !(b = wrapper.SetBufferArg(gammaCorrectKernelIndex, argIndex++, m_SpatialFilterParamsBufferName))) { AddToReport(loc); }//SpatialFilterCL.
|
||||||
|
|
||||||
if (b && !(b = wrapper.RunKernel(gammaCorrectKernelIndex, gridW, gridH, 1, blockW, blockH, 1))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = wrapper.RunKernel(gammaCorrectKernelIndex, gridW, gridH, 1, blockW, blockH, 1))) { AddToReport(loc); }
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
b = false;
|
b = false;
|
||||||
this->m_ErrorReport.push_back(loc);
|
AddToReport(loc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1315,30 +1315,30 @@ eRenderStatus RendererCL<T, bucketT>::RunFinalAccum()
|
|||||||
gridH = m_SpatialFilterCL.m_FinalRasH;
|
gridH = m_SpatialFilterCL.m_FinalRasH;
|
||||||
OpenCLWrapper::MakeEvenGridDims(blockW, blockH, gridW, gridH);
|
OpenCLWrapper::MakeEvenGridDims(blockW, blockH, gridW, gridH);
|
||||||
|
|
||||||
if (b && !(b = wrapper.SetBufferArg(accumKernelIndex, argIndex++, m_AccumBufferName))) { this->m_ErrorReport.push_back(loc); }//Accumulator.
|
if (b && !(b = wrapper.SetBufferArg(accumKernelIndex, argIndex++, m_AccumBufferName))) { AddToReport(loc); }//Accumulator.
|
||||||
if (b && !(b = wrapper.SetImageArg(accumKernelIndex, argIndex++, wrapper.Shared(), m_FinalImageName))) { this->m_ErrorReport.push_back(loc); }//Final image.
|
if (b && !(b = wrapper.SetImageArg(accumKernelIndex, argIndex++, wrapper.Shared(), m_FinalImageName))) { AddToReport(loc); }//Final image.
|
||||||
if (b && !(b = wrapper.SetBufferArg(accumKernelIndex, argIndex++, m_SpatialFilterParamsBufferName))) { this->m_ErrorReport.push_back(loc); }//SpatialFilterCL.
|
if (b && !(b = wrapper.SetBufferArg(accumKernelIndex, argIndex++, m_SpatialFilterParamsBufferName))) { AddToReport(loc); }//SpatialFilterCL.
|
||||||
if (b && !(b = wrapper.SetBufferArg(accumKernelIndex, argIndex++, m_SpatialFilterCoefsBufferName))) { this->m_ErrorReport.push_back(loc); }//Filter coefs.
|
if (b && !(b = wrapper.SetBufferArg(accumKernelIndex, argIndex++, m_SpatialFilterCoefsBufferName))) { AddToReport(loc); }//Filter coefs.
|
||||||
if (b && !(b = wrapper.SetBufferArg(accumKernelIndex, argIndex++, m_CurvesCsaName))) { this->m_ErrorReport.push_back(loc); }//Curve points.
|
if (b && !(b = wrapper.SetBufferArg(accumKernelIndex, argIndex++, m_CurvesCsaName))) { AddToReport(loc); }//Curve points.
|
||||||
|
|
||||||
if (b && !(b = wrapper.SetArg (accumKernelIndex, argIndex++, curvesSet))) { this->m_ErrorReport.push_back(loc); }//Do curves.
|
if (b && !(b = wrapper.SetArg (accumKernelIndex, argIndex++, curvesSet))) { AddToReport(loc); }//Do curves.
|
||||||
if (b && !(b = wrapper.SetArg (accumKernelIndex, argIndex++, bucketT(alphaBase)))) { this->m_ErrorReport.push_back(loc); }//Alpha base.
|
if (b && !(b = wrapper.SetArg (accumKernelIndex, argIndex++, bucketT(alphaBase)))) { AddToReport(loc); }//Alpha base.
|
||||||
if (b && !(b = wrapper.SetArg (accumKernelIndex, argIndex++, bucketT(alphaScale)))) { this->m_ErrorReport.push_back(loc); }//Alpha scale.
|
if (b && !(b = wrapper.SetArg (accumKernelIndex, argIndex++, bucketT(alphaScale)))) { AddToReport(loc); }//Alpha scale.
|
||||||
|
|
||||||
if (b && wrapper.Shared())
|
if (b && wrapper.Shared())
|
||||||
if (b && !(b = wrapper.EnqueueAcquireGLObjects(m_FinalImageName))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = wrapper.EnqueueAcquireGLObjects(m_FinalImageName))) { AddToReport(loc); }
|
||||||
|
|
||||||
if (b && !(b = wrapper.RunKernel(accumKernelIndex, gridW, gridH, 1, blockW, blockH, 1))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = wrapper.RunKernel(accumKernelIndex, gridW, gridH, 1, blockW, blockH, 1))) { AddToReport(loc); }
|
||||||
|
|
||||||
if (b && wrapper.Shared())
|
if (b && wrapper.Shared())
|
||||||
if (b && !(b = wrapper.EnqueueReleaseGLObjects(m_FinalImageName))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = wrapper.EnqueueReleaseGLObjects(m_FinalImageName))) { AddToReport(loc); }
|
||||||
|
|
||||||
//t.Toc((char*)loc);
|
//t.Toc((char*)loc);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
b = false;
|
b = false;
|
||||||
this->m_ErrorReport.push_back(loc);
|
AddToReport(loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
return b ? RENDER_OK : RENDER_ERROR;
|
return b ? RENDER_OK : RENDER_ERROR;
|
||||||
@ -1375,14 +1375,14 @@ bool RendererCL<T, bucketT>::ClearBuffer(size_t device, const string& bufferName
|
|||||||
b = true;
|
b = true;
|
||||||
OpenCLWrapper::MakeEvenGridDims(blockW, blockH, gridW, gridH);
|
OpenCLWrapper::MakeEvenGridDims(blockW, blockH, gridW, gridH);
|
||||||
|
|
||||||
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, bufferName))) { this->m_ErrorReport.push_back(loc); }//Buffer of byte.
|
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex++, bufferName))) { AddToReport(loc); }//Buffer of byte.
|
||||||
if (b && !(b = wrapper.SetArg(kernelIndex, argIndex++, width * elementSize))) { this->m_ErrorReport.push_back(loc); }//Width.
|
if (b && !(b = wrapper.SetArg(kernelIndex, argIndex++, width * elementSize))) { AddToReport(loc); }//Width.
|
||||||
if (b && !(b = wrapper.SetArg(kernelIndex, argIndex++, height))) { this->m_ErrorReport.push_back(loc); }//Height.
|
if (b && !(b = wrapper.SetArg(kernelIndex, argIndex++, height))) { AddToReport(loc); }//Height.
|
||||||
if (b && !(b = wrapper.RunKernel(kernelIndex, gridW, gridH, 1, blockW, blockH, 1))) { this->m_ErrorReport.push_back(loc); }
|
if (b && !(b = wrapper.RunKernel(kernelIndex, gridW, gridH, 1, blockW, blockH, 1))) { AddToReport(loc); }
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->m_ErrorReport.push_back(loc);
|
AddToReport(loc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1415,20 +1415,20 @@ bool RendererCL<T, bucketT>::RunDensityFilterPrivate(size_t kernelIndex, size_t
|
|||||||
{
|
{
|
||||||
auto& wrapper = m_Devices[0]->m_Wrapper;
|
auto& wrapper = m_Devices[0]->m_Wrapper;
|
||||||
|
|
||||||
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex, m_HistBufferName))) { this->m_ErrorReport.push_back(loc); } argIndex++;//Histogram.
|
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex, m_HistBufferName))) { AddToReport(loc); } argIndex++;//Histogram.
|
||||||
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex, m_AccumBufferName))) { this->m_ErrorReport.push_back(loc); } argIndex++;//Accumulator.
|
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex, m_AccumBufferName))) { AddToReport(loc); } argIndex++;//Accumulator.
|
||||||
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex, m_DEFilterParamsBufferName))) { this->m_ErrorReport.push_back(loc); } argIndex++;//FlameDensityFilterCL.
|
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex, m_DEFilterParamsBufferName))) { AddToReport(loc); } argIndex++;//FlameDensityFilterCL.
|
||||||
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex, m_DECoefsBufferName))) { this->m_ErrorReport.push_back(loc); } argIndex++;//Coefs.
|
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex, m_DECoefsBufferName))) { AddToReport(loc); } argIndex++;//Coefs.
|
||||||
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex, m_DEWidthsBufferName))) { this->m_ErrorReport.push_back(loc); } argIndex++;//Widths.
|
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex, m_DEWidthsBufferName))) { AddToReport(loc); } argIndex++;//Widths.
|
||||||
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex, m_DECoefIndicesBufferName))) { this->m_ErrorReport.push_back(loc); } argIndex++;//Coef indices.
|
if (b && !(b = wrapper.SetBufferArg(kernelIndex, argIndex, m_DECoefIndicesBufferName))) { AddToReport(loc); } argIndex++;//Coef indices.
|
||||||
if (b && !(b = wrapper.SetArg(kernelIndex, argIndex, chunkSizeW))) { this->m_ErrorReport.push_back(loc); } argIndex++;//Chunk size width (gapW + 1).
|
if (b && !(b = wrapper.SetArg(kernelIndex, argIndex, chunkSizeW))) { AddToReport(loc); } argIndex++;//Chunk size width (gapW + 1).
|
||||||
if (b && !(b = wrapper.SetArg(kernelIndex, argIndex, chunkSizeH))) { this->m_ErrorReport.push_back(loc); } argIndex++;//Chunk size height (gapH + 1).
|
if (b && !(b = wrapper.SetArg(kernelIndex, argIndex, chunkSizeH))) { AddToReport(loc); } argIndex++;//Chunk size height (gapH + 1).
|
||||||
if (b && !(b = wrapper.SetArg(kernelIndex, argIndex, chunkW))) { this->m_ErrorReport.push_back(loc); } argIndex++;//Column chunk.
|
if (b && !(b = wrapper.SetArg(kernelIndex, argIndex, chunkW))) { AddToReport(loc); } argIndex++;//Column chunk.
|
||||||
if (b && !(b = wrapper.SetArg(kernelIndex, argIndex, chunkH))) { this->m_ErrorReport.push_back(loc); } argIndex++;//Row chunk.
|
if (b && !(b = wrapper.SetArg(kernelIndex, argIndex, chunkH))) { AddToReport(loc); } argIndex++;//Row chunk.
|
||||||
//t.Toc(__FUNCTION__ " set args");
|
//t.Toc(__FUNCTION__ " set args");
|
||||||
|
|
||||||
//t.Tic();
|
//t.Tic();
|
||||||
if (b && !(b = wrapper.RunKernel(kernelIndex, gridW, gridH, 1, blockW, blockH, 1))) { this->m_ErrorReport.push_back(loc); }//Method 7, accumulating to temp box area.
|
if (b && !(b = wrapper.RunKernel(kernelIndex, gridW, gridH, 1, blockW, blockH, 1))) { AddToReport(loc); }//Method 7, accumulating to temp box area.
|
||||||
//t.Toc(__FUNCTION__ " RunKernel()");
|
//t.Toc(__FUNCTION__ " RunKernel()");
|
||||||
|
|
||||||
return b;
|
return b;
|
||||||
@ -1461,7 +1461,7 @@ int RendererCL<T, bucketT>::MakeAndGetDensityFilterProgram(size_t ss, uint filte
|
|||||||
if (wrapper.AddProgram(deEntryPoint, kernel, deEntryPoint, m_DoublePrecision))
|
if (wrapper.AddProgram(deEntryPoint, kernel, deEntryPoint, m_DoublePrecision))
|
||||||
kernelIndex = wrapper.FindKernelIndex(deEntryPoint);//Try to find it again, it will be present if successfully built.
|
kernelIndex = wrapper.FindKernelIndex(deEntryPoint);//Try to find it again, it will be present if successfully built.
|
||||||
else
|
else
|
||||||
this->m_ErrorReport.push_back(string(loc) + "():\nBuilding the following program failed: \n" + kernel + "\n");
|
AddToReport(string(loc) + "():\nBuilding the following program failed: \n" + kernel + "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1493,7 +1493,7 @@ int RendererCL<T, bucketT>::MakeAndGetFinalAccumProgram(double& alphaBase, doubl
|
|||||||
if (wrapper.AddProgram(finalAccumEntryPoint, kernel, finalAccumEntryPoint, m_DoublePrecision))
|
if (wrapper.AddProgram(finalAccumEntryPoint, kernel, finalAccumEntryPoint, m_DoublePrecision))
|
||||||
kernelIndex = wrapper.FindKernelIndex(finalAccumEntryPoint);//Try to find it again, it will be present if successfully built.
|
kernelIndex = wrapper.FindKernelIndex(finalAccumEntryPoint);//Try to find it again, it will be present if successfully built.
|
||||||
else
|
else
|
||||||
this->m_ErrorReport.push_back(loc);
|
AddToReport(loc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1522,7 +1522,7 @@ int RendererCL<T, bucketT>::MakeAndGetGammaCorrectionProgram()
|
|||||||
if (b)
|
if (b)
|
||||||
kernelIndex = wrapper.FindKernelIndex(gammaEntryPoint);//Try to find it again, it will be present if successfully built.
|
kernelIndex = wrapper.FindKernelIndex(gammaEntryPoint);//Try to find it again, it will be present if successfully built.
|
||||||
else
|
else
|
||||||
this->m_ErrorReport.push_back(loc);
|
AddToReport(loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
return kernelIndex;
|
return kernelIndex;
|
||||||
@ -1585,7 +1585,7 @@ bool RendererCL<T, bucketT>::SumDeviceHist()
|
|||||||
ostringstream os;
|
ostringstream os;
|
||||||
|
|
||||||
os << loc << ": failed to sum histograms from the secondary device(s) to the primary device.";
|
os << loc << ": failed to sum histograms from the secondary device(s) to the primary device.";
|
||||||
this->m_ErrorReport.push_back(os.str());
|
AddToReport(os.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
//t.Toc(loc);
|
//t.Toc(loc);
|
||||||
|
@ -69,7 +69,7 @@ using EmberNs::Renderer<T, bucketT>::RendererBase::m_Rand;
|
|||||||
using EmberNs::Renderer<T, bucketT>::RendererBase::m_RenderTimer;
|
using EmberNs::Renderer<T, bucketT>::RendererBase::m_RenderTimer;
|
||||||
using EmberNs::Renderer<T, bucketT>::RendererBase::m_IterTimer;
|
using EmberNs::Renderer<T, bucketT>::RendererBase::m_IterTimer;
|
||||||
using EmberNs::Renderer<T, bucketT>::RendererBase::m_ProgressTimer;
|
using EmberNs::Renderer<T, bucketT>::RendererBase::m_ProgressTimer;
|
||||||
using EmberNs::Renderer<T, bucketT>::RendererBase::EmberReport::m_ErrorReport;
|
using EmberNs::Renderer<T, bucketT>::RendererBase::EmberReport::AddToReport;
|
||||||
using EmberNs::Renderer<T, bucketT>::RendererBase::m_ResizeCs;
|
using EmberNs::Renderer<T, bucketT>::RendererBase::m_ResizeCs;
|
||||||
using EmberNs::Renderer<T, bucketT>::RendererBase::m_ProcessAction;
|
using EmberNs::Renderer<T, bucketT>::RendererBase::m_ProcessAction;
|
||||||
using EmberNs::Renderer<T, bucketT>::m_RotMat;
|
using EmberNs::Renderer<T, bucketT>::m_RotMat;
|
||||||
|
@ -112,10 +112,9 @@ template <typename T>
|
|||||||
static bool InitPaletteList(const string& filename)
|
static bool InitPaletteList(const string& filename)
|
||||||
{
|
{
|
||||||
PaletteList<T> paletteList;//Even though this is local, the members are static so they will remain.
|
PaletteList<T> paletteList;//Even though this is local, the members are static so they will remain.
|
||||||
|
bool added = paletteList.Add(filename);
|
||||||
|
|
||||||
paletteList.Add(filename);
|
if (!added || !paletteList.Size())
|
||||||
|
|
||||||
if (!paletteList.Size())
|
|
||||||
{
|
{
|
||||||
cout << "Error parsing palette file " << filename << ". Reason: " << endl;
|
cout << "Error parsing palette file " << filename << ". Reason: " << endl;
|
||||||
cout << paletteList.ErrorReportString() << endl << "Returning without executing." << endl;
|
cout << paletteList.ErrorReportString() << endl << "Returning without executing." << endl;
|
||||||
|
Loading…
Reference in New Issue
Block a user