Commit: 36ae26472717b19ce5a90d5eec29f0ca402ffdff
Author: Antony Riakiotakis
Date:   Wed Mar 18 22:00:34 2015 +0100
Branches: temp_viewport_fx_merge
https://developer.blender.org/rB36ae26472717b19ce5a90d5eec29f0ca402ffdff

Still more files from branch that were left over uncommitted.

===================================================================

M       source/blender/editors/screen/glutil.c
M       source/blender/gpu/CMakeLists.txt
A       source/blender/gpu/GPU_font.h
M       source/blender/gpu/GPU_immediate.h
M       source/blender/gpu/intern/gpu_font.c
M       source/blender/gpu/intern/gpu_immediate.c
M       source/blender/gpu/intern/gpu_init_exit.c
M       source/blender/gpu/intern/gpu_primitives.c
M       source/blender/gpu/intern/gpu_sprite.c
A       source/blender/gpu/shaders/gpu_shader_font_frag.glsl
A       source/blender/gpu/shaders/gpu_shader_font_vert.glsl
A       source/blender/gpu/shaders/gpu_shader_pixels_frag.glsl
A       source/blender/gpu/shaders/gpu_shader_pixels_uniforms.glsl
A       source/blender/gpu/shaders/gpu_shader_pixels_vert.glsl
A       source/blender/gpu/shaders/gpu_shader_raster_frag.glsl
A       source/blender/gpu/shaders/gpu_shader_raster_uniforms.glsl
A       source/blender/gpu/shaders/gpu_shader_raster_vert.glsl

===================================================================

diff --git a/source/blender/editors/screen/glutil.c 
b/source/blender/editors/screen/glutil.c
index 0da23f9..489ec7c 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -133,16 +133,6 @@ const GLubyte stipple_diag_stripes_neg[128] = {
        0x0f, 0xf0, 0x0f, 0xf0, 0x1f, 0xe0, 0x1f, 0xe0,
        0x3f, 0xc0, 0x3f, 0xc0, 0x7f, 0x80, 0x7f, 0x80};
 
-const GLubyte stipple_checker_8px[128] = {
-       255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0,
-       255,  0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0,
-       0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255,
-       0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255,
-       255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0,
-       255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0,
-       0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255,
-       0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255};
-
 /* UNUSED */
 #if 0
 void fdrawbezier(float vec[4][3])
diff --git a/source/blender/gpu/CMakeLists.txt 
b/source/blender/gpu/CMakeLists.txt
index f478c44..d5be4f3 100644
--- a/source/blender/gpu/CMakeLists.txt
+++ b/source/blender/gpu/CMakeLists.txt
@@ -55,6 +55,7 @@ set(SRC
        intern/gpu_clipping.c
        intern/gpu_draw.c
        intern/gpu_extensions.c
+       intern/gpu_font.c
        intern/gpu_immediate.c
        intern/gpu_init_exit.c
        intern/gpu_material.c
@@ -64,6 +65,7 @@ set(SRC
        intern/gpu_raster.c
        intern/gpu_simple_shader.c
        intern/gpu_select.c
+       intern/gpu_sprite.c
        intern/gpu_compositing.c
        intern/gpu_debug.c
 
@@ -84,6 +86,14 @@ set(SRC
        shaders/gpu_shader_common_uniforms.glsl
        shaders/gpu_shader_common_constants.glsl
        shaders/gpu_shader_common_attribs.glsl
+       shaders/gpu_shader_pixels_uniforms.glsl
+       shaders/gpu_shader_pixels_vert.glsl
+       shaders/gpu_shader_pixels_frag.glsl
+       shaders/gpu_shader_raster_uniforms.glsl
+       shaders/gpu_shader_raster_vert.glsl
+       shaders/gpu_shader_raster_frag.glsl
+       shaders/gpu_shader_font_vert.glsl
+       shaders/gpu_shader_font_frag.glsl
 
        GPU_aspect.h
        GPU_buffers.h
@@ -92,6 +102,7 @@ set(SRC
        GPU_draw.h
        GPU_debug.h
        GPU_extensions.h
+       GPU_font.h
        GPU_glew.h
        GPU_init_exit.h
        GPU_material.h
@@ -128,6 +139,14 @@ data_to_c_simple(shaders/gpu_shader_fx_lib.glsl SRC)
 data_to_c_simple(shaders/gpu_shader_common_uniforms.glsl SRC)
 data_to_c_simple(shaders/gpu_shader_common_constants.glsl SRC)
 data_to_c_simple(shaders/gpu_shader_common_attribs.glsl SRC)
+data_to_c_simple(shaders/gpu_shader_pixels_uniforms.glsl SRC)
+data_to_c_simple(shaders/gpu_shader_pixels_vert.glsl SRC)
+data_to_c_simple(shaders/gpu_shader_pixels_frag.glsl SRC)
+data_to_c_simple(shaders/gpu_shader_raster_uniforms.glsl SRC)
+data_to_c_simple(shaders/gpu_shader_raster_vert.glsl SRC)
+data_to_c_simple(shaders/gpu_shader_raster_frag.glsl SRC)
+data_to_c_simple(shaders/gpu_shader_font_vert.glsl SRC)
+data_to_c_simple(shaders/gpu_shader_font_frag.glsl SRC)
 
 if(WITH_GAMEENGINE)
        add_definitions(-DWITH_GAMEENGINE)
diff --git a/source/blender/gpu/intern/gpu_init_exit.c 
b/source/blender/gpu/GPU_font.h
similarity index 56%
copy from source/blender/gpu/intern/gpu_init_exit.c
copy to source/blender/gpu/GPU_font.h
index 163946e..89fc5c3 100644
--- a/source/blender/gpu/intern/gpu_init_exit.c
+++ b/source/blender/gpu/GPU_font.h
@@ -1,3 +1,6 @@
+#ifndef _GPU_FONT_H_
+#define _GPU_FONT_H_
+
 /*
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
@@ -25,49 +28,29 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file source/blender/gpu/intern/gpu_init_exit.c
+/** \file source/blender/gpu/GPU_font.h
  *  \ingroup gpu
  */
 
-#include "BLI_sys_types.h"
-#include "GPU_init_exit.h"  /* interface */
 
-#include "intern/gpu_codegen.h"
-#include "intern/gpu_private.h"
 
-/**
- * although the order of initialization and shutdown should not matter
- * (except for the extensions), I chose alphabetical and reverse alphabetical 
order
- */
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-static bool initialized = false;
 
-void GPU_init(void)
-{
-       /* can't avoid calling this multiple times, see 
wm_window_add_ghostwindow */
-       if (initialized)
-               return;
+void GPU_font_begin(void);
+void GPU_font_end  (void);
 
-       initialized = true;
+void GPU_font_shader_init  (void);
+void GPU_font_shader_exit  (void);
+void GPU_font_shader_bind  (void);
+void GPU_font_shader_unbind(void);
 
-       gpu_extensions_init(); /* must come first */
-       gpu_matrix_init();
 
-       gpu_codegen_init();
 
-       GPU_DEBUG_INIT();
+#ifdef __cplusplus
 }
+#endif
 
-
-
-void GPU_exit(void)
-{
-       GPU_DEBUG_EXIT();
-
-       gpu_matrix_exit();
-       gpu_codegen_exit();
-
-       gpu_extensions_exit(); /* must come last */
-
-       initialized = false;
-}
+#endif
\ No newline at end of file
diff --git a/source/blender/gpu/GPU_immediate.h 
b/source/blender/gpu/GPU_immediate.h
index 99abd43..3b4d60d 100644
--- a/source/blender/gpu/GPU_immediate.h
+++ b/source/blender/gpu/GPU_immediate.h
@@ -48,14 +48,14 @@
 extern "C" {
 #endif
 
-struct GPUimmediate;
+struct GPUImmediate;
 struct GPUindex;
 
 void gpu_lock_buffer_gl(void);
 void gpu_unlock_buffer_gl(void);
 void gpu_begin_buffer_gl(void);
 void gpu_end_buffer_gl(void);
-void gpu_shutdown_buffer_gl(struct GPUimmediate *immediate);
+void gpu_shutdown_buffer_gl(struct GPUImmediate *immediate);
 void gpu_current_normal_gl(void);
 void gpu_index_begin_buffer_gl(void);
 void gpu_index_end_buffer_gl(void);
@@ -193,7 +193,7 @@ typedef struct GPUImmediateFormat {
        size_t    attribCount_ub;
 } GPUImmediateFormat;
 
-typedef struct GPUimmediate {
+typedef struct GPUImmediate {
        GLenum mode;
 
        GPUImmediateFormat format;
@@ -221,26 +221,26 @@ typedef struct GPUimmediate {
 
        GLint     lastTexture;
        GLboolean hasOverflowed;
-} GPUimmediate;
+} GPUImmediate;
 
-extern GPUimmediate *GPU_IMMEDIATE;
+extern GPUImmediate *GPU_IMMEDIATE;
 
 
 
-GPUimmediate* gpuNewImmediate(void);
-void gpuImmediateMakeCurrent(GPUimmediate *immediate);
-void gpuDeleteImmediate(GPUimmediate *immediate);
+GPUImmediate* gpuNewImmediate(void);
+void gpuImmediateMakeCurrent(GPUImmediate *immediate);
+void gpuDeleteImmediate(GPUImmediate *immediate);
 
 void gpuPushImmediate(void);
-GPUimmediate* gpuPopImmediate(void);
-void gpuImmediateSingleDraw(GLenum mode, GPUimmediate *immediate);
-void gpuImmediateSingleRepeat(GPUimmediate *immediate);
+GPUImmediate* gpuPopImmediate(void);
+void gpuImmediateSingleDraw(GLenum mode, GPUImmediate *immediate);
+void gpuImmediateSingleRepeat(GPUImmediate *immediate);
 
-void gpuImmediateSingleDrawElements(GLenum mode, GPUimmediate *immediate);
-void gpuImmediateSingleRepeatElements(GPUimmediate *immediate);
+void gpuImmediateSingleDrawElements(GLenum mode, GPUImmediate *immediate);
+void gpuImmediateSingleRepeatElements(GPUImmediate *immediate);
 
-void gpuImmediateSingleDrawRangeElements(GLenum mode, GPUimmediate *immediate);
-void gpuImmediateSingleRepeatRangeElements(GPUimmediate *immediate);
+void gpuImmediateSingleDrawRangeElements(GLenum mode, GPUImmediate *immediate);
+void gpuImmediateSingleRepeatRangeElements(GPUImmediate *immediate);
 
 
 
@@ -304,7 +304,7 @@ extern const GPUarrays GPU_ARRAYS_C3F_N3F_V3F;
 
 
 typedef struct GPUindex {
-       struct GPUimmediate *immediate;
+       struct GPUImmediate *immediate;
 
        void   *element_stream;
        void   *mappedBuffer;
diff --git a/source/blender/gpu/intern/gpu_font.c 
b/source/blender/gpu/intern/gpu_font.c
index e3c2dc6..55163b9 100644
--- a/source/blender/gpu/intern/gpu_font.c
+++ b/source/blender/gpu/intern/gpu_font.c
@@ -29,17 +29,14 @@
  *  \ingroup gpu
  */
 
-/* my interface */
+#include "BLI_sys_types.h"
+
 #include "intern/gpu_private.h"
 
-/* my library */
-#include "GPU_blender_aspect.h"
+#include "GPU_aspect.h"
 #include "GPU_extensions.h"
-#include "GPU_safety.h"
-
-/* internal */
-#include "intern/gpu_common_intern.h"
-#include "intern/gpu_matrix_intern.h"
+#include "GPU_debug.h"
+#include "GPU_font.h"
 
 /* external */
 
@@ -54,11 +51,7 @@ static struct GPUShader*  FONT_SHADER = NULL;
 static struct GPUcommon   FONT_COMMON = {0};
 static bool               FONT_FAILED = false;
 
-#if GPU_SAFETY
 static bool FONT_BEGUN = false;
-#endif
-
-
 
 void gpu_font_init(void)
 {
@@ -71,7 +64,7 @@ void gpu_font_exit(void)
 {
        GPU_shader_free(FONT_SHADER);
 
-#if GPU_SAFETY
+#ifdef GPU_SAFETY
        FONT_BEGUN = false;
 #endif
 }
@@ -112,7 +105,7 @@ static void gpu_font_shader(void)
                defs_cstring = BLI_dynstr_get_cstring(defs);
 
                FONT_SHADER =
-                       GPU_shader_create("Font", vert_cstring, frag_cstring, 
NULL, defs_cstring);
+                       GPU_shader_create(vert_cstring, frag_cstring, NULL, 
defs_cstring);
 
                MEM_freeN(vert_cstring);
                MEM_freeN(frag_cstring);
@@ -148,14 +141,14 @@ void gpu_font_bind(void)
 {
        bool glsl_support = GPU_glsl_support();
 
-       GPU_ASSERT(FONT_BEGUN);
+       BLI_assert(FONT_BEGUN);
 
        if (glsl_support)
                gpu_font_shader();
 
 #if defined(WITH_GL_PROFILE_COMPAT)
        if (!glsl_support)
-               GPU_CHECK(glEnable(GL_TEXTURE_2D));
+               GPU_CHECK_ERRORS_AROUND(glEnable(GL_TEXTURE_2D));
 #endif
 
        gpu_commit_matrix();
@@ -167,14 +160,14 @@ void gpu_font_unbind(void)
 {
        bool glsl_support = GPU_glsl_support();
 
-       GPU_ASSERT(FONT_BEGUN);
+       BLI_assert(FONT_BEGUN);
 
        if (glsl_support)
                GPU_shader_unbind();
 
 #if defined(WITH_GL_PROFILE_COMPAT)
        if (!glsl_support)
-               GPU_CHECK(glDisable(GL_TEXTURE_2D));
+               GPU_CHECK_ERRORS_AROUND(glDisable(GL_TEXTURE_2D));
 #endif
 }
 
@@ -182,8 +175,8 @@ void gpu_font_unbind(void)
 
 void GPU_font_begin(void)
 {
-#if GPU_SAFETY
-       GPU_ASSERT(!FONT_BEGUN);
+#ifdef GPU_SAFETY
+       BLI_assert(!FONT_BEGUN);
        FONT_BEGUN = true;
 #endif
 
@@ -196,13 +189,13 @@ void GPU_font_begin(void)
 
 void GPU_font_end(void)
 {
-#if GPU_SAFETY
-       GPU_ASSERT(FONT_BEGUN);
+#ifdef GPU_SAFETY
+       BLI_assert(FONT_BEGUN);
 #endif
 
        GPU_aspect_end();
 
-#if GPU_SAFETY
+#ifdef GPU_SAFETY
        FONT_BEGUN = false;
 #endif
 
diff --git a/source/blender/gpu/intern/gpu_immediate.c 
b/source/blender/gpu/intern/gpu_immediate.c
index 69c7fdb..8b8aeaa 100644
--- a/source/blender/gpu/intern/gpu_immediate.c
+++ b/source/blender/gpu/intern/gpu_immediate.c
@@ -709,7 +709,7 @@ void gpu_index_shutdown_buffer_gl(GPUindex *index)
 
 
 
-void gpu_shutdown_buffer_gl(GPUimmediate *immediate)
+void gpu_shutdown_buffer_gl(GPUImmediate *immediate)

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to