move Gawain library to intern
authorMike Erwin <significant.bit@gmail.com>
Fri, 17 Mar 2017 03:32:35 +0000 (23:32 -0400)
committerMike Erwin <significant.bit@gmail.com>
Fri, 17 Mar 2017 03:32:35 +0000 (23:32 -0400)
Before now it lived in source/blender/gpu for convenience. Only a few files in the gpu module use Gawain directly.

Tested on Mac, time to push and test on Windows.

Todo: some CMake magic to make it easy to
#include "gawain/some_header.h"
from any C or H file. Main problem here is the many editors that include GPU_immediate.h which includes Gawain's immediate.h -- is there a way to avoid changing every editor's CMakeLists?

27 files changed:
build_files/cmake/macros.cmake
intern/CMakeLists.txt
intern/gawain/CMakeLists.txt [new file with mode: 0644]
intern/gawain/gawain/attrib_binding.h [moved from source/blender/gpu/gawain/attrib_binding.h with 100% similarity]
intern/gawain/gawain/batch.h [moved from source/blender/gpu/gawain/batch.h with 100% similarity]
intern/gawain/gawain/buffer_id.h [moved from source/blender/gpu/gawain/buffer_id.h with 100% similarity]
intern/gawain/gawain/common.h [moved from source/blender/gpu/gawain/common.h with 100% similarity]
intern/gawain/gawain/element.h [moved from source/blender/gpu/gawain/element.h with 100% similarity]
intern/gawain/gawain/imm_util.h [moved from source/blender/gpu/gawain/imm_util.h with 100% similarity]
intern/gawain/gawain/immediate.h [moved from source/blender/gpu/gawain/immediate.h with 100% similarity]
intern/gawain/gawain/primitive.h [moved from source/blender/gpu/gawain/primitive.h with 100% similarity]
intern/gawain/gawain/shader_interface.h [moved from source/blender/gpu/gawain/shader_interface.h with 100% similarity]
intern/gawain/gawain/vertex_buffer.h [moved from source/blender/gpu/gawain/vertex_buffer.h with 100% similarity]
intern/gawain/gawain/vertex_format.h [moved from source/blender/gpu/gawain/vertex_format.h with 100% similarity]
intern/gawain/src/attrib_binding.c [moved from source/blender/gpu/gawain/attrib_binding.c with 100% similarity]
intern/gawain/src/batch.c [moved from source/blender/gpu/gawain/batch.c with 100% similarity]
intern/gawain/src/buffer_id.cpp [moved from source/blender/gpu/gawain/buffer_id.cpp with 100% similarity]
intern/gawain/src/element.c [moved from source/blender/gpu/gawain/element.c with 100% similarity]
intern/gawain/src/imm_util.c [moved from source/blender/gpu/gawain/imm_util.c with 100% similarity]
intern/gawain/src/immediate.c [moved from source/blender/gpu/gawain/immediate.c with 100% similarity]
intern/gawain/src/primitive.c [moved from source/blender/gpu/gawain/primitive.c with 100% similarity]
intern/gawain/src/shader_interface.c [moved from source/blender/gpu/gawain/shader_interface.c with 100% similarity]
intern/gawain/src/vertex_buffer.c [moved from source/blender/gpu/gawain/vertex_buffer.c with 100% similarity]
intern/gawain/src/vertex_format.c [moved from source/blender/gpu/gawain/vertex_format.c with 100% similarity]
source/blender/gpu/CMakeLists.txt
source/blender/gpu/GPU_batch.h
source/blender/gpu/GPU_immediate.h

index 43c341c79c7e8d552c06ad000a7518da8bb69575..7b47578cbc7da6d44d94d6d98f994dae7ae3b182 100644 (file)
@@ -598,6 +598,7 @@ function(SETUP_BLENDER_SORTED_LIBS)
                bf_bmesh
                bf_gpu
                bf_draw
+               bf_intern_gawain
                bf_blenloader
                bf_blenkernel
                bf_physics
index bfe230250ae7db42cc40cb5188f0a3d597b4ca24..af3b9296077143af1a7023585270d5aa310c74c3 100644 (file)
@@ -33,6 +33,7 @@ add_subdirectory(opencolorio)
 add_subdirectory(mikktspace)
 add_subdirectory(glew-mx)
 add_subdirectory(eigen)
+add_subdirectory(gawain)
 
 if(WITH_GAMEENGINE_DECKLINK)
        add_subdirectory(decklink)
diff --git a/intern/gawain/CMakeLists.txt b/intern/gawain/CMakeLists.txt
new file mode 100644 (file)
index 0000000..99adab8
--- /dev/null
@@ -0,0 +1,34 @@
+
+set(INC gawain)
+
+set(INC_SYS ${GLEW_INCLUDE_PATH})
+
+set(SRC
+       src/attrib_binding.c
+       src/batch.c
+       src/element.c
+       src/buffer_id.cpp
+       src/immediate.c
+       src/imm_util.c
+       src/primitive.c
+       src/shader_interface.c
+       src/vertex_buffer.c
+       src/vertex_format.c
+
+       gawain/attrib_binding.h
+       gawain/batch.h
+       gawain/buffer_id.h
+       gawain/common.h
+       gawain/element.h
+       gawain/immediate.h
+       gawain/imm_util.h
+       gawain/primitive.h
+       gawain/shader_interface.h
+       gawain/vertex_buffer.h
+       gawain/vertex_format.h
+)
+
+# remove this when we switch to core profile
+add_definitions(-DWITH_GL_PROFILE_COMPAT)
+
+blender_add_lib(bf_intern_gawain "${SRC}" "${INC}" "${INC_SYS}")
index 391efdaeb00d4776709aa03b78b0ad151e08b9ae..1791b34d4c85bbd9927aa5326341201c4466bf88 100644 (file)
@@ -42,6 +42,7 @@ set(INC
        ../../../intern/glew-mx
        ../../../intern/guardedalloc
        ../../../intern/smoke/extern
+       ../../../intern/gawain
 )
 
 set(INC_SYS
@@ -70,28 +71,6 @@ set(SRC
        intern/gpu_uniformbuffer.c
        intern/gpu_viewport.c
 
-       gawain/attrib_binding.c
-       gawain/attrib_binding.h
-       gawain/batch.c
-       gawain/batch.h
-       gawain/buffer_id.h
-       gawain/buffer_id.cpp
-       gawain/common.h
-       gawain/element.c
-       gawain/element.h
-       gawain/immediate.c
-       gawain/immediate.h
-       gawain/imm_util.c
-       gawain/imm_util.h
-       gawain/primitive.h
-       gawain/primitive.c
-       gawain/shader_interface.c
-       gawain/shader_interface.h
-       gawain/vertex_buffer.c
-       gawain/vertex_buffer.h
-       gawain/vertex_format.c
-       gawain/vertex_format.h
-
        shaders/gpu_shader_fx_lib.glsl
        shaders/gpu_shader_fx_ssao_frag.glsl
        shaders/gpu_shader_fx_dof_frag.glsl
index 6d63965952aa2a0282fbae0d4a004b148a319e1b..2232e333bb65eb423f41ed3a1c20cd7c7ebef508 100644 (file)
 
 #pragma once
 
-#include "gawain/batch.h"
+#include "../../../intern/gawain/gawain/batch.h"
+
+// TODO: CMake magic to do this:
+// #include "gawain/batch.h"
+
 #include "GPU_shader.h"
 
 /* Extend Batch_set_program to use Blender’s library of built-in shader programs. */
index 4a0840e22c08fe49b2ed8d5327f353abb4a9c676..35964a81030727010a4f5d8833ee006e37ae1451 100644 (file)
 
 #pragma once
 
-#include "gawain/immediate.h"
-#include "gawain/imm_util.h"
+#include "../../../intern/gawain/gawain/immediate.h"
+#include "../../../intern/gawain/gawain/imm_util.h"
+
+// TODO: CMake magic to do this:
+// #include "gawain/immediate.h"
+// #include "gawain/imm_util.h"
+
 #include "GPU_shader.h"
 
 /* Extend immBindProgram to use Blender’s library of built-in shader programs.