Report memory required in final render dialog.

Fix broken state of ember during failed render with strips.
This commit is contained in:
mfeemster
2014-12-09 00:24:28 -08:00
parent 9263906cb5
commit 3e70b8eec6
10 changed files with 112 additions and 42 deletions

View File

@ -554,13 +554,13 @@ int OpenCLWrapper::FindImageIndex(const string& name, bool shared)
{
for (size_t i = 0; i < m_GLImages.size(); i++)
if (m_GLImages[i].m_Name == name)
return i;
return int(i);
}
else
{
for (size_t i = 0; i < m_Images.size(); i++)
if (m_Images[i].m_Name == name)
return i;
return int(i);
}
return -1;
@ -966,7 +966,7 @@ bool OpenCLWrapper::RunKernel(uint kernelIndex, uint totalGridWidth, uint totalG
/// <param name="name">The device field/feature to query</param>
/// <returns>The value of the field</returns>
template<typename T>
T OpenCLWrapper::GetInfo(size_t platform, size_t device, cl_device_info name)
T OpenCLWrapper::GetInfo(size_t platform, size_t device, cl_device_info name) const
{
T val;
@ -1094,6 +1094,7 @@ string OpenCLWrapper::DumpInfo()
os << "CL_DEVICE_MAX_READ_IMAGE_ARGS: " << GetInfo<cl_uint> (platform, device, CL_DEVICE_MAX_READ_IMAGE_ARGS) << endl;
os << "CL_DEVICE_MAX_WRITE_IMAGE_ARGS: " << GetInfo<cl_uint> (platform, device, CL_DEVICE_MAX_WRITE_IMAGE_ARGS) << endl;
os << "CL_DEVICE_MAX_MEM_ALLOC_SIZE: " << GetInfo<cl_ulong>(platform, device, CL_DEVICE_MAX_MEM_ALLOC_SIZE) << endl;
os << "CL_DEVICE_ADDRESS_BITS: " << GetInfo<cl_uint> (platform, device, CL_DEVICE_ADDRESS_BITS) << endl;
os << "CL_DEVICE_GLOBAL_MEM_CACHE_TYPE: " << GetInfo<cl_uint> (platform, device, CL_DEVICE_GLOBAL_MEM_CACHE_TYPE) << endl;
os << "CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE: " << GetInfo<cl_uint> (platform, device, CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE) << endl;
@ -1126,7 +1127,9 @@ bool OpenCLWrapper::Shared() const { return m_Shared; }
cl::Context OpenCLWrapper::Context() const { return m_Context; }
uint OpenCLWrapper::PlatformIndex() const { return m_PlatformIndex; }
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); }
/// <summary>
/// Makes the even grid dims.

View File

@ -175,7 +175,7 @@ public:
//Info.
template<typename T>
T GetInfo(size_t platform, size_t device, cl_device_info name);
T GetInfo(size_t platform, size_t device, cl_device_info name) const;
string PlatformName(size_t platform);
vector<string> PlatformNames();
string DeviceName(size_t platform, size_t device);
@ -190,6 +190,8 @@ public:
uint PlatformIndex() const;
uint DeviceIndex() const;
uint LocalMemSize() const;
size_t GlobalMemSize() const;
size_t MaxAllocSize() const;
static void MakeEvenGridDims(uint blockW, uint blockH, uint& gridW, uint& gridH);