Bug fixes:

--Disallow the use of synth when randomly generating xforms if the user has an Nvidia device present on their system.

Code changes:
--Use some CPU defines in CL code.
--Change curves color scaling buffer to be 2^16 per channel instead of 2^17 which was probably overkill.
--Code in RendererClDevice::Init() to detect Nvidia was wrong even thought it technically worked.
This commit is contained in:
Person
2017-08-07 19:53:13 -07:00
parent a0ed758999
commit 6c9d9e57cc
6 changed files with 40 additions and 7 deletions

View File

@ -85,8 +85,8 @@ static string ConstantDefinesString(bool doublePrecision)
"#define SQRT5 2.2360679774997896964091736687313\n"
"#define M_PHI 1.61803398874989484820458683436563\n"
"#define DEG_2_RAD (MPI / 180)\n"
"#define CURVES_LENGTH_M1 131071.0f\n"
"#define ONE_OVER_CURVES_LENGTH_M1 7.62945273935e-6f\n"
"#define CURVES_LENGTH_M1 ((real_bucket_t)" << CURVES_LENGTH_M1 << ")\n" <<
"#define ONE_OVER_CURVES_LENGTH_M1 ((real_bucket_t)" << ONE_OVER_CURVES_LENGTH_M1 << ")\n" <<
"\n"
"//Index in each dimension of a thread within a block.\n"
"#define THREAD_ID_X (get_local_id(0))\n"

View File

@ -630,6 +630,20 @@ bool RendererCL<T, bucketT>::RandVec(vector<QTIsaac<ISAAC_SIZE, ISAAC_INT>>& ran
return b;
}
/// <summary>
/// Get whether any devices are from Nvidia.
/// </summary>
/// <returns>True if an devices are from Nvidia, else false.</returns>
template <typename T, typename bucketT>
bool RendererCL<T, bucketT>::AnyNvidia() const
{
for (auto& dev : m_Devices)
if (dev->Nvidia())
return true;
return false;
}
/// <summary>
/// Protected virtual functions overridden from Renderer.
/// </summary>

View File

@ -21,6 +21,7 @@ public:
virtual ~RendererCLBase() { }
virtual bool ReadFinal(v4F* pixels) = 0;
virtual bool ClearFinal() = 0;
virtual bool AnyNvidia() const = 0;
};
/// <summary>
@ -154,6 +155,7 @@ public:
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;
#ifndef TEST_CL
protected:

View File

@ -40,7 +40,7 @@ bool RendererClDevice::Init()
if (b && m_Wrapper.Ok() && !m_Init)
{
m_NVidia = ToLower(m_Info->PlatformName(m_PlatformIndex)).find_first_of("nvidia") != string::npos && m_Wrapper.LocalMemSize() > (32 * 1024);
m_NVidia = Find(ToLower(m_Info->PlatformName(m_PlatformIndex)), "nvidia") && m_Wrapper.LocalMemSize() > (32 * 1024);
m_WarpSize = m_NVidia ? 32 : 64;
m_Init = true;
}