Cycles: Improve error reporting of large textures on HIP #118239

Merged
Brecht Van Lommel merged 1 commits from Alaska/blender:better-hip-texture-warning into blender-v4.1-release 2024-02-29 13:49:21 +01:00
1 changed files with 5 additions and 1 deletions

View File

@ -855,7 +855,11 @@ void HIPDevice::tex_alloc(device_texture &mem)
thread_scoped_lock lock(device_mem_map_mutex);
cmem = &device_mem_map[&mem];
hip_assert(hipTexObjectCreate(&cmem->texobject, &resDesc, &texDesc, NULL));
if (hipTexObjectCreate(&cmem->texobject, &resDesc, &texDesc, NULL) != hipSuccess) {
set_error(
Alaska marked this conversation as resolved Outdated

This type of change looks fine. Would prefer != 0 for clarity, and string_printf is not needed if it's just a plain string.

I would suggest for the message.

Failed to create texture. Maximum GPU texture size or available GPU memory was likely exceeded.

This type of change looks fine. Would prefer != 0 for clarity, and `string_printf` is not needed if it's just a plain string. I would suggest for the message. > Failed to create texture. Maximum GPU texture size or available GPU memory was likely exceeded.
"Failed to create texture. Maximum GPU texture size or available GPU memory was likely "
"exceeded.");
}
texture_info[slot].data = (uint64_t)cmem->texobject;
}