diff --git a/extern/hipew/include/hiprtew.h b/extern/hipew/include/hiprtew.h index a5472896dd9..5f967e7c99c 100644 --- a/extern/hipew/include/hiprtew.h +++ b/extern/hipew/include/hiprtew.h @@ -79,6 +79,7 @@ typedef hiprtError(thiprtSetFuncTable)(hiprtContext context, hiprtFuncDataSet set); typedef hiprtError(thiprtDestroyFuncTable)(hiprtContext context, hiprtFuncTable funcTable); +typedef void(thiprtSetLogLevel)( hiprtLogLevel level ); /* Function declarations. */ extern thiprtCreateContext *hiprtCreateContext; @@ -94,6 +95,7 @@ extern thiprtGetSceneBuildTemporaryBufferSize *hiprtGetSceneBuildTemporaryBuffer extern thiprtCreateFuncTable *hiprtCreateFuncTable; extern thiprtSetFuncTable *hiprtSetFuncTable; extern thiprtDestroyFuncTable *hiprtDestroyFuncTable; +extern thiprtSetLogLevel *hiprtSetLogLevel; /* HIPEW API. */ diff --git a/extern/hipew/src/hiprtew.cc b/extern/hipew/src/hiprtew.cc index 84403bb2283..5844d6466b3 100644 --- a/extern/hipew/src/hiprtew.cc +++ b/extern/hipew/src/hiprtew.cc @@ -41,6 +41,7 @@ thiprtGetSceneBuildTemporaryBufferSize *hiprtGetSceneBuildTemporaryBufferSize; thiprtCreateFuncTable *hiprtCreateFuncTable; thiprtSetFuncTable *hiprtSetFuncTable; thiprtDestroyFuncTable *hiprtDestroyFuncTable; +thiprtSetLogLevel *hiprtSetLogLevel; static void hipewHipRtExit(void) { @@ -89,6 +90,7 @@ bool hiprtewInit() HIPRT_LIBRARY_FIND(hiprtCreateFuncTable) HIPRT_LIBRARY_FIND(hiprtSetFuncTable) HIPRT_LIBRARY_FIND(hiprtDestroyFuncTable) + HIPRT_LIBRARY_FIND(hiprtSetLogLevel) result = true; #endif diff --git a/intern/cycles/device/hiprt/device_impl.cpp b/intern/cycles/device/hiprt/device_impl.cpp index 5d5c2d6b2a2..d23f85b07cd 100644 --- a/intern/cycles/device/hiprt/device_impl.cpp +++ b/intern/cycles/device/hiprt/device_impl.cpp @@ -95,6 +95,8 @@ HIPRTDevice::HIPRTDevice(const DeviceInfo &info, Stats &stats, Profiler &profile set_error(string_printf("Failed to create HIPRT Function Table")); return; } + + hiprtSetLogLevel(hiprtLogLevelNone); } HIPRTDevice::~HIPRTDevice() @@ -260,8 +262,7 @@ string HIPRTDevice::compile_kernel(const uint kernel_features, const char *name, linker_options.append(" --offload-arch=").append(arch); linker_options.append(" -fgpu-rdc --hip-link --cuda-device-only "); string hiprt_ver(HIPRT_VERSION_STR); - string hiprt_bc; - hiprt_bc = hiprt_path + "\\hiprt" + hiprt_ver + "_amd_lib_win.bc"; + string hiprt_bc = hiprt_path + "\\dist\\bin\\Release\\hiprt" + hiprt_ver + "_amd_lib_win.bc"; string linker_command = string_printf("clang++ %s \"%s\" %s -o \"%s\"", linker_options.c_str(), diff --git a/intern/cycles/device/hiprt/queue.cpp b/intern/cycles/device/hiprt/queue.cpp index 28cc6673c87..22f47ddd1a0 100644 --- a/intern/cycles/device/hiprt/queue.cpp +++ b/intern/cycles/device/hiprt/queue.cpp @@ -60,6 +60,8 @@ bool HIPRTDeviceQueue::enqueue(DeviceKernel kernel, 0), "enqueue"); + debug_enqueue_end(); + return !(hiprt_device_->have_error()); } diff --git a/intern/cycles/kernel/device/hiprt/bvh.h b/intern/cycles/kernel/device/hiprt/bvh.h index 2c7daa2f2fa..b352cbcb014 100644 --- a/intern/cycles/kernel/device/hiprt/bvh.h +++ b/intern/cycles/kernel/device/hiprt/bvh.h @@ -45,11 +45,11 @@ ccl_device_intersect bool scene_intersect(KernelGlobals kg, GET_TRAVERSAL_STACK() if (visibility & PATH_RAY_SHADOW_OPAQUE) { - GET_TRAVERSAL_ANY_HIT(table_closest_intersect, 0) + GET_TRAVERSAL_ANY_HIT(table_closest_intersect, 0, ray->time) hit = traversal.getNextHit(); } else { - GET_TRAVERSAL_CLOSEST_HIT(table_closest_intersect, 0) + GET_TRAVERSAL_CLOSEST_HIT(table_closest_intersect, 0, ray->time) hit = traversal.getNextHit(); } if (hit.hasHit()) { @@ -156,13 +156,13 @@ ccl_device_intersect bool scene_intersect_shadow_all(KernelGlobals kg, payload.in_state = state; payload.max_hits = max_hits; payload.visibility = visibility; - payload.prim_type = PRIMITIVE_TRIANGLE; + payload.prim_type = PRIMITIVE_NONE; payload.ray_time = ray->time; payload.num_hits = 0; payload.r_num_recorded_hits = num_recorded_hits; payload.r_throughput = throughput; GET_TRAVERSAL_STACK() - GET_TRAVERSAL_ANY_HIT(table_shadow_intersect, 1) + GET_TRAVERSAL_ANY_HIT(table_shadow_intersect, 1, ray->time) hiprtHit hit = traversal.getNextHit(); num_recorded_hits = payload.r_num_recorded_hits; throughput = payload.r_throughput; @@ -200,7 +200,7 @@ ccl_device_intersect bool scene_intersect_volume(KernelGlobals kg, GET_TRAVERSAL_STACK() - GET_TRAVERSAL_CLOSEST_HIT(table_volume_intersect, 3) + GET_TRAVERSAL_CLOSEST_HIT(table_volume_intersect, 3, ray->time) hiprtHit hit = traversal.getNextHit(); // return hit.hasHit(); if (hit.hasHit()) { diff --git a/intern/cycles/kernel/device/hiprt/common.h b/intern/cycles/kernel/device/hiprt/common.h index 44e9846d42a..05f902769c1 100644 --- a/intern/cycles/kernel/device/hiprt/common.h +++ b/intern/cycles/kernel/device/hiprt/common.h @@ -52,7 +52,7 @@ struct LocalPayload { # endif # ifdef HIPRT_SHARED_STACK -# define GET_TRAVERSAL_ANY_HIT(FUNCTION_TABLE, RAY_TYPE) \ +# define GET_TRAVERSAL_ANY_HIT(FUNCTION_TABLE, RAY_TYPE, RAY_TIME) \ hiprtSceneTraversalAnyHitCustomStack traversal(kernel_data.device_bvh, \ ray_hip, \ stack, \ @@ -60,10 +60,10 @@ struct LocalPayload { hiprtTraversalHintDefault, \ &payload, \ kernel_params.FUNCTION_TABLE, \ - RAY_TYPE); \ - hiprtSceneTraversalAnyHitCustomStack traversal_simple( \ - kernel_data.device_bvh, ray_hip, stack, visibility); -# define GET_TRAVERSAL_CLOSEST_HIT(FUNCTION_TABLE, RAY_TYPE) \ + RAY_TYPE, \ + RAY_TIME); + +# define GET_TRAVERSAL_CLOSEST_HIT(FUNCTION_TABLE, RAY_TYPE, RAY_TIME) \ hiprtSceneTraversalClosestCustomStack traversal(kernel_data.device_bvh, \ ray_hip, \ stack, \ @@ -71,9 +71,8 @@ struct LocalPayload { hiprtTraversalHintDefault, \ &payload, \ kernel_params.FUNCTION_TABLE, \ - RAY_TYPE); \ - hiprtSceneTraversalClosestCustomStack traversal_simple( \ - kernel_data.device_bvh, ray_hip, stack, visibility); + RAY_TYPE, \ + RAY_TIME); # else # define GET_TRAVERSAL_ANY_HIT(FUNCTION_TABLE) \ hiprtSceneTraversalAnyHit traversal(kernel_data.device_bvh, \ @@ -81,16 +80,14 @@ struct LocalPayload { visibility, \ FUNCTION_TABLE, \ hiprtTraversalHintDefault, \ - &payload); \ - hiprtSceneTraversalAnyHit traversal_simple(kernel_data.device_bvh, ray_hip, visibility); + &payload); # define GET_TRAVERSAL_CLOSEST_HIT(FUNCTION_TABLE) \ hiprtSceneTraversalClosest traversal(kernel_data.device_bvh, \ ray_hip, \ visibility, \ FUNCTION_TABLE, \ hiprtTraversalHintDefault, \ - &payload); \ - hiprtSceneTraversalClosest traversal_simple(kernel_data.device_bvh, ray_hip, visibility); + &payload); # endif ccl_device_inline void set_intersect_point(KernelGlobals kg,