Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/gpgmm/d3d12/ErrorD3D12.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@

namespace gpgmm::d3d12 {

#define ReturnIfNullptr(expr) \
{ \
if (GPGMM_UNLIKELY(expr == nullptr)) { \
return E_POINTER; \
} \
} \
for (;;) \
#define ReturnIfNullptr(expr) \
{ \
if (GPGMM_UNLIKELY(expr == nullptr)) { \
gpgmm::ErrorLog() << #expr << ": " << GetErrorMessage(E_POINTER); \
return E_POINTER; \
} \
} \
for (;;) \
break

#define ReturnIfFailed(expr) \
Expand Down
5 changes: 1 addition & 4 deletions src/gpgmm/d3d12/HeapD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ namespace gpgmm::d3d12 {
ReturnIfFailed(createHeapFn(pCreateHeapContext, &pageable));

// Pageable-based type is required for residency-managed heaps.
if (pageable == nullptr) {
gpgmm::ErrorLog() << "Unable to create heap because memory does not exist.";
return E_POINTER;
}
ReturnIfNullptr(pageable);

GPGMM_TRACE_EVENT_OBJECT_CALL("Heap.CreateHeap",
(CREATE_HEAP_DESC{descriptor, pageable.Get()}));
Expand Down