P4 to Git Change 1128279 by gandryey@gera-w8 on 2015/03/06 12:37:59

ECR #304775 - Mip levels implementation
	- Initial change. Update the runtime interfaces to allow a mipmap allocation.

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_memobj.cpp#74 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#240 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpublit.cpp#113 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#499 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.hpp#138 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpumemory.cpp#119 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpumemory.hpp#47 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.cpp#210 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.hpp#79 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpusettings.cpp#305 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp#110 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.cpp#118 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.hpp#89 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#225 edit


[ROCm/clr commit: ae9e6d1a92]
This commit is contained in:
foreman
2015-03-06 13:13:39 -05:00
parent 7677ab980e
commit 515b919097
12 changed files with 112 additions and 89 deletions
@@ -77,6 +77,7 @@ Resource::Resource(
cal_.width_ = width;
cal_.height_ = 1;
cal_.depth_ = 1;
cal_.mipLevels_ = 1;
cal_.format_ = format;
cal_.flags_ = 0;
cal_.pitch_ = 0;
@@ -99,7 +100,8 @@ Resource::Resource(
size_t depth,
cmSurfFmt format,
gslChannelOrder chOrder,
cl_mem_object_type imageType)
cl_mem_object_type imageType,
uint mipLevels)
: elementSize_(0)
, gpuDevice_(gpuDev)
, mapCount_(0)
@@ -121,6 +123,7 @@ Resource::Resource(
cal_.width_ = width;
cal_.height_ = height;
cal_.depth_ = depth;
cal_.mipLevels_ = mipLevels;
cal_.format_ = format;
cal_.flags_ = 0;
cal_.pitch_ = 0;
@@ -435,7 +438,7 @@ Resource::create(MemoryType memType, CreateParams* params, bool heap)
desc.format = cal()->format_;
desc.channelOrder = cal()->channelOrder_;
desc.flags = cal()->flags_;
desc.mipLevels = 0;
desc.mipLevels = cal()->mipLevels_;
desc.systemMemory = NULL;
do {
@@ -2023,7 +2026,6 @@ GslResourceReference*
ResourceCache::findCalResource(Resource::CalResourceDesc* desc)
{
amd::ScopedLock l(&lockCacheOps_);
bool found = false;
GslResourceReference* ref = NULL;
size_t size = getResourceSize(desc);
@@ -2034,10 +2036,8 @@ ResourceCache::findCalResource(Resource::CalResourceDesc* desc)
}
// Serach the right resource through the cache list
std::list<std::pair<Resource::CalResourceDesc*,
GslResourceReference*> >::const_iterator it;
for (it = resCache_.begin(); it != resCache_.end(); ++it) {
Resource::CalResourceDesc* entry = it->first;
for (const auto& it: resCache_) {
Resource::CalResourceDesc* entry = it.first;
// Find if we can reuse this entry
if ((entry->dimension_ == desc->dimension_) &&
(entry->type_ == desc->type_) &&
@@ -2047,19 +2047,15 @@ ResourceCache::findCalResource(Resource::CalResourceDesc* desc)
(entry->channelOrder_ == desc->channelOrder_) &&
(entry->format_ == desc->format_) &&
(entry->flags_ == desc->flags_)) {
ref = it->second;
delete it->first;
found = true;
ref = it.second;
delete it.first;
// Remove the found etry from the cache
resCache_.remove(it);
cacheSize_ -= size;
break;
}
}
if (found) {
// Remove the found etry from the cache
resCache_.remove(*it);
cacheSize_ -= size;
}
return ref;
}