move Gawain library to intern

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?
This commit is contained in:
Mike Erwin 2017-03-16 23:32:35 -04:00
parent b4e8dc8c82
commit 4452bea2f1
27 changed files with 49 additions and 25 deletions

View 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

View 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)

View File

@ -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}")

View 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

View File

@ -30,7 +30,11 @@
#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 Blenders library of built-in shader programs. */

View File

@ -30,8 +30,13 @@
#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 Blenders library of built-in shader programs.