Skip to content

Commit 1740bfb

Browse files
authored
Merge branch 'master' into taichi-ggui_unit_test
2 parents d155e22 + 4271be4 commit 1740bfb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+304
-893
lines changed

CMakeLists.txt

+4-9
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,15 @@ if (TI_BUILD_TESTS)
103103
endif()
104104

105105
option(TI_BUILD_EXAMPLES "Build the CPP examples" ON)
106-
option(TI_BUILD_RHI_EXAMPLES "Build the Unified Device API examples" OFF)
107106

108107
if(NOT TI_WITH_LLVM OR NOT TI_WITH_METAL)
109108
set(TI_BUILD_EXAMPLES OFF)
110109
endif()
111110

111+
if (TI_BUILD_EXAMPLES)
112+
include(cmake/TaichiExamples.cmake)
113+
endif()
114+
112115
message("C++ Flags: ${CMAKE_CXX_FLAGS}")
113116
message("Build type: ${CMAKE_BUILD_TYPE}")
114117

@@ -198,11 +201,3 @@ if (TI_WITH_C_API)
198201
include(cmake/TaichiCAPITests.cmake)
199202
endif()
200203
endif()
201-
202-
if (TI_BUILD_EXAMPLES)
203-
include(cmake/TaichiExamples.cmake)
204-
endif()
205-
206-
if (TI_BUILD_RHI_EXAMPLES)
207-
add_subdirectory(cpp_examples/rhi_examples)
208-
endif()

c_api/src/taichi_core_impl.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ TiTexture ti_allocate_texture(TiRuntime runtime,
244244

245245
switch ((taichi::lang::ImageDimension)allocate_info->dimension) {
246246
#define PER_IMAGE_DIMENSION(x) case taichi::lang::ImageDimension::x:
247-
#include "taichi/inc/rhi_constants.inc.h"
247+
#include "taichi/inc/image_dimension.inc.h"
248248
#undef PER_IMAGE_DIMENSION
249249
break;
250250
default: {
@@ -256,7 +256,7 @@ TiTexture ti_allocate_texture(TiRuntime runtime,
256256

257257
switch ((taichi::lang::BufferFormat)allocate_info->format) {
258258
#define PER_BUFFER_FORMAT(x) case taichi::lang::BufferFormat::x:
259-
#include "taichi/inc/rhi_constants.inc.h"
259+
#include "taichi/inc/buffer_format.inc.h"
260260
#undef PER_BUFFER_FORMAT
261261
break;
262262
default: {
@@ -357,7 +357,7 @@ void ti_transition_texture(TiRuntime runtime,
357357

358358
switch ((taichi::lang::ImageLayout)layout) {
359359
#define PER_IMAGE_LAYOUT(x) case taichi::lang::ImageLayout::x:
360-
#include "taichi/inc/rhi_constants.inc.h"
360+
#include "taichi/inc/image_layout.inc.h"
361361
#undef PER_IMAGE_LAYOUT
362362
break;
363363
default: {

cmake/TaichiCXXFlags.cmake

+4-6
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,24 @@ if (WIN32)
2525
endif()
2626
endif()
2727

28-
set(CMAKE_CXX_STANDARD 17)
29-
3028
if (WIN32)
3129
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/lib)
3230
if (MSVC)
3331
set(CMAKE_CXX_FLAGS
34-
"${CMAKE_CXX_FLAGS} /Zc:__cplusplus /bigobj /wd4244 /wd4267 /nologo /Zi /D \"_CRT_SECURE_NO_WARNINGS\" /D \"_ENABLE_EXTENDED_ALIGNED_STORAGE\"")
32+
"${CMAKE_CXX_FLAGS} /Zc:__cplusplus /std:c++17 /bigobj /wd4244 /wd4267 /nologo /Zi /D \"_CRT_SECURE_NO_WARNINGS\" /D \"_ENABLE_EXTENDED_ALIGNED_STORAGE\"")
3533
else()
36-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsized-deallocation -target x86_64-pc-windows-msvc")
34+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -fsized-deallocation -target x86_64-pc-windows-msvc")
3735
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -gcodeview")
3836
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -gcodeview")
3937
endif()
4038
else()
4139
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
4240
message("Clang compiler detected. Using std=c++17.")
43-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsized-deallocation -Wno-deprecated-declarations")
41+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -fsized-deallocation -Wno-deprecated-declarations")
4442
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
4543
message("GNU compiler detected. Using std=c++17.")
4644
message(WARNING "It is detected that you are using gcc as the compiler. This is an experimental feature. Consider adding -DCMAKE_CXX_COMPILER=clang argument to CMake to switch to clang (or MSVC on Windows).")
47-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsized-deallocation -Wno-class-memaccess -Wno-comment -Wno-sign-compare")
45+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -fsized-deallocation -Wno-class-memaccess -Wno-comment -Wno-sign-compare")
4846
else()
4947
message("Invalid compiler ${CMAKE_CXX_COMPILER_ID} detected.")
5048
message(FATAL_ERROR "clang and MSVC are the only supported compilers for Taichi compiler development. Consider using 'cmake -DCMAKE_CXX_COMPILER=clang' if you are on Linux.")

cpp_examples/rhi_examples/CMakeLists.txt

-30
This file was deleted.

cpp_examples/rhi_examples/common.h

-129
This file was deleted.

cpp_examples/rhi_examples/sample_1_window.cpp

-21
This file was deleted.

cpp_examples/rhi_examples/sample_2_triangle.cpp

-115
This file was deleted.

cpp_examples/rhi_examples/shaders/2_triangle.frag

-9
This file was deleted.

0 commit comments

Comments
 (0)