File tree Expand file tree Collapse file tree 13 files changed +98
-13
lines changed Expand file tree Collapse file tree 13 files changed +98
-13
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,9 @@ option(RR_NO_TESTS "Don't add any unit tests and remove any test functionality f
11
11
option (RR_ENABLE_STATIC "Create static libraries rather than dynamic" OFF )
12
12
option (RR_SHARED_CALC "Link Calc(compute abstraction layer) dynamically" OFF )
13
13
option (RR_ENABLE_RAYMASK "Enable ray masking in intersection kernels" OFF )
14
- option (RR_TUTORIALS "Add tutorials projects" OFF )
14
+ # option(RR_TUTORIALS "Add tutorials projects" OFF)
15
15
option (RR_SAFE_MATH "use safe math" OFF )
16
+ mark_as_advanced (FORCE RR_USE_VULKAN )
16
17
17
18
#global settings
18
19
if (WIN32 )
@@ -64,9 +65,4 @@ if (NOT RR_NO_TESTS)
64
65
add_subdirectory (UnitTest )
65
66
endif (NOT RR_NO_TESTS )
66
67
67
- if (RR_TUTORIALS )
68
- # add_subdirectory(Tutorials)
69
- endif (RR_TUTORIALS )
70
-
71
-
72
68
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ if (RR_USE_OPENCL)
9
9
elseif (RR_USE_VULKAN )
10
10
list (APPEND SOURCES
11
11
src/calc_vkw.cpp
12
- src/device_vkw.cpp )
12
+ src/device_vkw.cpp )
13
13
endif (RR_USE_OPENCL )
14
14
15
15
if (RR_SHARED_CALC )
@@ -33,3 +33,11 @@ endif (UNIX)
33
33
if (RR_USE_OPENCL )
34
34
target_link_libraries (Calc PUBLIC CLW )
35
35
endif (RR_USE_OPENCL )
36
+
37
+ if (RR_USE_VULKAN )
38
+ #Need to add Anvil to include path
39
+ target_include_directories (Calc
40
+ PRIVATE ${RadeonRaysSDK_SOURCE_DIR} /Anvil/deps
41
+ PRIVATE ${RadeonRaysSDK_SOURCE_DIR} /Anvil/include )
42
+ target_link_libraries (Calc PUBLIC Vulkan::Vulkan )
43
+ endif (RR_USE_VULKAN )
Original file line number Diff line number Diff line change @@ -122,6 +122,10 @@ set(SOURCES
122
122
${UTIL_SOURCES}
123
123
${WORLD_SOURCES} )
124
124
125
+ if (RR_EMBED_KERNELS )
126
+ add_subdirectory (src/kernels )
127
+ endif (RR_EMBED_KERNELS )
128
+
125
129
#Declare RadeonRays library
126
130
if (RR_ENABLE_STATIC )
127
131
add_library (RadeonRays STATIC ${SOURCES} )
@@ -131,6 +135,12 @@ else (NOT RR_ENABLE_STATIC)
131
135
target_compile_definitions (RadeonRays PUBLIC RR_STATIC_LIBRARY=0 )
132
136
endif (RR_ENABLE_STATIC )
133
137
138
+ if (RR_EMBED_KERNELS )
139
+ target_compile_definitions (RadeonRays PRIVATE RR_EMBED_KERNELS=1 )
140
+ add_dependencies (RadeonRays RadeonRaysKernelCache )
141
+ target_include_directories (RadeonRays PRIVATE ${RadeonRays_BINARY_DIR} )
142
+ endif (RR_EMBED_KERNELS )
143
+
134
144
#Configure RadeonRays build
135
145
target_include_directories (RadeonRays PUBLIC include )
136
146
target_include_directories (RadeonRays
@@ -159,7 +169,13 @@ if (RR_USE_OPENCL)
159
169
endif (RR_USE_OPENCL )
160
170
161
171
if (RR_USE_VULKAN )
162
- target_link_libraries (RadeonRays PUBLIC Vulkan::Vulkan Anvil Thread::Threads )
172
+ #Need to add Anvil to include path
173
+
174
+ target_include_directories (RadeonRays
175
+ PRIVATE ${RadeonRaysSDK_SOURCE_DIR} /Anvil/deps
176
+ PRIVATE ${RadeonRaysSDK_SOURCE_DIR} /Anvil/include )
177
+
178
+ target_link_libraries (RadeonRays PUBLIC Vulkan::Vulkan Anvil Threads::Threads )
163
179
endif (RR_USE_VULKAN )
164
180
165
181
if (UNIX )
Original file line number Diff line number Diff line change @@ -36,7 +36,10 @@ THE SOFTWARE.
36
36
37
37
#ifdef RR_EMBED_KERNELS
38
38
#if USE_OPENCL
39
- # include " RadeonRays/src/kernelcache/kernels_cl.h"
39
+ # include " kernels_cl.h"
40
+ #endif
41
+ #if USE_VULKAN
42
+ # include " kernels_vk.h"
40
43
#endif
41
44
#endif // RR_EMBED_KERNELS
42
45
Original file line number Diff line number Diff line change @@ -163,11 +163,11 @@ namespace RadeonRays
163
163
164
164
#ifdef RR_EMBED_KERNELS
165
165
#if USE_OPENCL
166
- # include " RadeonRays/src/kernelcache/ kernels_cl.h"
166
+ # include " kernels_cl.h"
167
167
#endif
168
168
169
169
#if USE_VULKAN
170
- # include < RadeonRays/src/kernelcache/ kernels_vk.h>
170
+ # include " kernels_vk.h"
171
171
#endif
172
172
#endif // RR_EMBED_KERNELS
173
173
Original file line number Diff line number Diff line change
1
+ add_custom_command (
2
+ OUTPUT ${RadeonRays_BINARY_DIR} /kernels_cl.h
3
+ COMMAND ${PYTHON_EXECUTABLE} ${STRINGIFY_SCRIPT} ${RadeonRays_SOURCE_DIR} /src/kernels/CL/ .cl opencl > ${RadeonRays_BINARY_DIR} /kernels_cl.h
4
+ MAIN_DEPENDENCY ${SHADER}
5
+ COMMENT "Generating RadeonRays OpenCL kernel cache"
6
+ VERBATIM )
7
+ add_custom_target (RadeonRaysKernelCache DEPENDS "${RadeonRays_BINARY_DIR} /kernels_cl.h" )
8
+
Original file line number Diff line number Diff line change
1
+ if (RR_USE_OPENCL )
2
+ add_subdirectory (CL )
3
+ elseif (RR_USE_VULKAN )
4
+ add_subdirectory (GLSL )
5
+ endif (RR_USE_OPENCL )
Original file line number Diff line number Diff line change
1
+ add_custom_command (
2
+ OUTPUT ${RadeonRays_BINARY_DIR} /kernels_vk.h
3
+ COMMAND ${PYTHON_EXECUTABLE} ${STRINGIFY_SCRIPT} ${RadeonRays_SOURCE_DIR} /src/kernels/GLSL/ .comp vulkan > ${RadeonRays_BINARY_DIR} /kernels_vk.h
4
+ MAIN_DEPENDENCY ${SHADER}
5
+ COMMENT "Generating RadeonRays Vulkan kernel cache"
6
+ VERBATIM )
7
+ add_custom_target (RadeonRaysKernelCache DEPENDS "${RadeonRays_BINARY_DIR} /kernels_vk.h" )
8
+
Original file line number Diff line number Diff line change
1
+ #add_subdirectory(Tools)
2
+ #add_subdirectory(CornellBox)
3
+ #add_subdirectory(CornellBoxShadow)
4
+ #add_subdirectory(Triangle)
5
+ #add_subdirectory(TriangleLight)
Original file line number Diff line number Diff line change
1
+ project (TutorialCornellBox CXX )
2
+
3
+ set (SOURCES main.cpp
4
+ $< TARGET_OBJECTS:TutorialTools> )
5
+
6
+ #message(FATAL_ERROR $<TARGET_OBJECTS:TutorialTools>)
7
+
8
+ add_executable (TutorialCornellBox ${SOURCES} )
9
+ target_compile_features (TutorialCornellBox PRIVATE cxx_std_11 )
10
+ target_link_libraries (TutorialCornellBox PRIVATE RadeonRays )
11
+ if (APPLE OR UNIX )
12
+ target_link_libraries (TutorialCornellBox PRIVATE OpenGL::GL GLUT::GLUT GLEW::GLEW ${OIIO_LIBS} )
13
+ elseif (WIN32 )
14
+ target_include_directories (TutorialCornellBox
15
+ PRIVATE ${GLUT_INCLUDES}
16
+ PRIVATE ${GLEW_INCLUDES}
17
+ PRIVATE ${OIIO_INCLUDES} )
18
+ target_link_libraries (TutorialCornellBox PRIVATE OpenGL::GL ${GLUT_LIBS} ${GLEW_LIBS} ${OIIO_LIBS} )
19
+ endif (APPLE OR UNIX )
You can’t perform that action at this time.
0 commit comments