mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-07-01 05:46:06 -04:00
Merge branch 'osx-opencl' of https://github.com/gh2k/fractorium
This commit is contained in:
@ -385,7 +385,7 @@ string FinalAccumOpenCLKernelCreator<T>::CreateGammaCorrectionFunctionString(boo
|
||||
|
||||
os <<
|
||||
"\n"
|
||||
" correctedChannels[rgbi] = (" << dataType << ")clamp(a, 0.0, 255.0);\n"
|
||||
" correctedChannels[rgbi] = (" << dataType << ")clamp(a, (real_t)0.0, (real_t)255.0);\n"
|
||||
" }\n"
|
||||
"\n";
|
||||
|
||||
|
@ -1130,6 +1130,7 @@ uint OpenCLWrapper::DeviceIndex() const { return m_DeviceIndex; }
|
||||
size_t OpenCLWrapper::GlobalMemSize() const { return GetInfo<cl_ulong>(PlatformIndex(), DeviceIndex(), CL_DEVICE_GLOBAL_MEM_SIZE); }
|
||||
uint OpenCLWrapper::LocalMemSize() const { return m_LocalMemSize; }
|
||||
size_t OpenCLWrapper::MaxAllocSize() const { return GetInfo<cl_ulong>(PlatformIndex(), DeviceIndex(), CL_DEVICE_MAX_MEM_ALLOC_SIZE); }
|
||||
std::vector<std::string> OpenCLWrapper::ProgramBuildErrors() const { return m_programBuildErrors; }
|
||||
|
||||
/// <summary>
|
||||
/// Makes the even grid dims.
|
||||
@ -1242,6 +1243,9 @@ bool OpenCLWrapper::CreateSPK(const string& name, const string& program, const s
|
||||
|
||||
if (CheckCL(err, "cl::Kernel()"))
|
||||
return true;//Everything is ok.
|
||||
} else {
|
||||
for (std::vector<cl::Device>::iterator i = m_DeviceVec.begin(); i != m_DeviceVec.end(); ++ i )
|
||||
m_programBuildErrors.push_back(spk.m_Program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(*i));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -192,6 +192,7 @@ public:
|
||||
uint LocalMemSize() const;
|
||||
size_t GlobalMemSize() const;
|
||||
size_t MaxAllocSize() const;
|
||||
std::vector<std::string> ProgramBuildErrors() const;
|
||||
|
||||
static void MakeEvenGridDims(uint blockW, uint blockH, uint& gridW, uint& gridH);
|
||||
|
||||
@ -217,5 +218,6 @@ private:
|
||||
std::vector<NamedBuffer> m_Buffers;
|
||||
std::vector<NamedImage2D> m_Images;
|
||||
std::vector<NamedImage2DGL> m_GLImages;
|
||||
std::vector<std::string> m_programBuildErrors;
|
||||
};
|
||||
}
|
||||
|
@ -759,7 +759,12 @@ bool RendererCL<T>::BuildIterProgramForEmber(bool doAccum)
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ErrorReport.push_back(string(loc) + "():\nBuilding the following program failed: \n" + m_IterKernel + "\n");
|
||||
//m_ErrorReport.push_back(string(loc) + "():\nBuilding the following program failed: \n" + m_IterKernel + "\n");
|
||||
|
||||
std::vector<std::string> errors = m_Wrapper.ProgramBuildErrors();
|
||||
m_ErrorReport.insert(m_ErrorReport.end(), errors.begin(), errors.end());
|
||||
m_ErrorReport.push_back(loc);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1297,7 +1302,11 @@ int RendererCL<T>::MakeAndGetFinalAccumProgram(T& alphaBase, T& alphaScale)
|
||||
if (b)
|
||||
kernelIndex = m_Wrapper.FindKernelIndex(finalAccumEntryPoint);//Try to find it again, it will be present if successfully built.
|
||||
else
|
||||
{
|
||||
std::vector<std::string> errors = m_Wrapper.ProgramBuildErrors();
|
||||
m_ErrorReport.insert(m_ErrorReport.end(), errors.begin(), errors.end());
|
||||
m_ErrorReport.push_back(loc);
|
||||
}
|
||||
}
|
||||
|
||||
return kernelIndex;
|
||||
|
Reference in New Issue
Block a user