File tree Expand file tree Collapse file tree 3 files changed +4
-22
lines changed
Expand file tree Collapse file tree 3 files changed +4
-22
lines changed Original file line number Diff line number Diff line change @@ -228,15 +228,7 @@ VkResult Image::compile(Device* device)
228228
229229VkResult Image::compile (Context& context)
230230{
231- try
232- {
233- return compile (*context.deviceMemoryBufferPools );
234- }
235- catch (...)
236- {
237- vsg::info (" Image::compile(Context& context)" );
238- return VK_ERROR_OUT_OF_DEVICE_MEMORY;
239- }
231+ return compile (*context.deviceMemoryBufferPools );
240232}
241233
242234VkResult Image::compile (MemoryBufferPools& memoryBufferPools)
@@ -255,13 +247,10 @@ VkResult Image::compile(MemoryBufferPools& memoryBufferPools)
255247 if (deviceMemory)
256248 {
257249 vd.requiresDataCopy = data.valid ();
258- bind (deviceMemory, offset);
250+ return bind (deviceMemory, offset);
259251 }
260252 else
261253 {
262- // throw Exception{"Error: Image failed to reserve slot from deviceMemoryBufferPools.", VK_ERROR_OUT_OF_DEVICE_MEMORY};
263- result = VK_ERROR_OUT_OF_DEVICE_MEMORY;
254+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
264255 }
265-
266- return result;
267256}
Original file line number Diff line number Diff line change @@ -420,11 +420,6 @@ VkDeviceSize ImageInfo::computeDataSize() const
420420 if (imageView && imageView->image )
421421 {
422422 auto & image = imageView->image ;
423-
424- // VkExtent3D extent = {0, 0, 0};
425- // uint32_t mipLevels = 0;
426- // uint32_t arrayLayers = 0;
427-
428423 if (image->data ) return image->data ->computeValueCountIncludingMipmaps ();
429424 }
430425 return 0 ;
Original file line number Diff line number Diff line change @@ -233,14 +233,12 @@ VkDeviceSize Device::availableMemory(bool includeMemoryPools) const
233233 }
234234 }
235235
236- VkDeviceSize minimumMargin = 0 ; // 1024*1024*1024;
237-
238236 for (auto & heapIndex : compatibleHeaps)
239237 {
240238 VkDeviceSize heapAvailable = memoryBudget.heapBudget [heapIndex] - memoryBudget.heapUsage [heapIndex];
241239 if (heapAvailable > minimumMargin)
242240 {
243- available += ( heapAvailable - minimumMargin) ;
241+ available += heapAvailable;
244242 }
245243 }
246244
You can’t perform that action at this time.
0 commit comments