[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58376] branches/soc-2013-viewport_fx/ source/blender: compiles again with glew-es disabled, still seems to run fine on legacy even after all the tweaks I made ( much to my surprise, I expect things to be broken for a bit)
Jason Wilkins
Jason.A.Wilkins at gmail.com
Fri Jul 19 11:14:01 CEST 2013
Revision: 58376
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58376
Author: jwilkins
Date: 2013-07-19 09:14:01 +0000 (Fri, 19 Jul 2013)
Log Message:
-----------
compiles again with glew-es disabled, still seems to run fine on legacy even after all the tweaks I made (much to my surprise, I expect things to be broken for a bit)
Modified Paths:
--------------
branches/soc-2013-viewport_fx/source/blender/editors/screen/glutil.c
branches/soc-2013-viewport_fx/source/blender/editors/space_sequencer/sequencer_draw.c
branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_draw.c
branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_extension_wrapper.c
branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_extensions.c
branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_glew.h
branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_lighting_inline.h
branches/soc-2013-viewport_fx/source/blender/windowmanager/intern/wm_init_exit.c
Modified: branches/soc-2013-viewport_fx/source/blender/editors/screen/glutil.c
===================================================================
--- branches/soc-2013-viewport_fx/source/blender/editors/screen/glutil.c 2013-07-19 09:09:30 UTC (rev 58375)
+++ branches/soc-2013-viewport_fx/source/blender/editors/screen/glutil.c 2013-07-19 09:14:01 UTC (rev 58376)
@@ -451,7 +451,7 @@
* it's possible to use GL_RGBA16F
*/
- if (GLEW_VERSION_3_0 || GL_ARB_texture_float || GL_EXT_texture_storage || GL_EXT_color_buffer_half_float) {
+ if (GLEW_VERSION_3_0 || GLEW_ARB_texture_float || GLEW_EXT_texture_storage || GLEW_EXT_color_buffer_half_float) {
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F, tex_w, tex_h, 0, format, GL_FLOAT, NULL);
}
else {
Modified: branches/soc-2013-viewport_fx/source/blender/editors/space_sequencer/sequencer_draw.c
===================================================================
--- branches/soc-2013-viewport_fx/source/blender/editors/space_sequencer/sequencer_draw.c 2013-07-19 09:09:30 UTC (rev 58375)
+++ branches/soc-2013-viewport_fx/source/blender/editors/space_sequencer/sequencer_draw.c 2013-07-19 09:14:01 UTC (rev 58376)
@@ -1149,7 +1149,7 @@
if (type == GL_FLOAT) {
- if (GLEW_VERSION_3_0 || GL_ARB_texture_float || GL_EXT_texture_storage || GL_EXT_color_buffer_half_float) {
+ if (GLEW_VERSION_3_0 || GLEW_ARB_texture_float || GLEW_EXT_texture_storage || GLEW_EXT_color_buffer_half_float) {
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F, ibuf->x, ibuf->y, 0, format, type, display_buffer);
}
else {
Modified: branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_draw.c
===================================================================
--- branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_draw.c 2013-07-19 09:09:30 UTC (rev 58375)
+++ branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_draw.c 2013-07-19 09:14:01 UTC (rev 58376)
@@ -820,7 +820,7 @@
mipmap = mipmap && GPU_get_mipmap();
if (use_high_bit_depth) {
- if (GLEW_VERSION_3_0 || GL_ARB_texture_float || GL_EXT_texture_storage || GL_EXT_color_buffer_half_float) {
+ if (GLEW_VERSION_3_0 || GLEW_ARB_texture_float || GLEW_EXT_texture_storage || GLEW_EXT_color_buffer_half_float) {
GPU_mipmap_2D(mipmap, GL_RGBA16F, rectw, recth, GL_FLOAT, frect);
}
else {
Modified: branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_extension_wrapper.c
===================================================================
--- branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_extension_wrapper.c 2013-07-19 09:09:30 UTC (rev 58375)
+++ branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_extension_wrapper.c 2013-07-19 09:14:01 UTC (rev 58376)
@@ -267,7 +267,7 @@
gpu_glGenFramebuffers = glGenFramebuffersEXT;
gpu_glBindFramebuffer = glBindFramebufferEXT;
gpu_glDeleteFramebuffers = glDeleteFramebuffersEXT;
- gpu_glFramebufferTexture2D = glFramebufferTextureEXT;
+ gpu_glFramebufferTexture2D = glFramebufferTexture2DEXT;
gpu_glCheckFramebufferStatus = glCheckFramebufferStatusEXT;
return GL_TRUE;
Modified: branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_extensions.c
===================================================================
--- branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_extensions.c 2013-07-19 09:09:30 UTC (rev 58375)
+++ branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_extensions.c 2013-07-19 09:14:01 UTC (rev 58376)
@@ -117,12 +117,6 @@
return GG.maxtexsize;
}
-int GPU_max_textures(void)
-{
- return GG.maxtextures;
-}
-
-//#include READ_GL_MODE
static GLint calc_max_textures(void)
{
GLint maxTextureUnits;
@@ -158,16 +152,18 @@
return MAX3(maxTextureUnits, maxTextureCoords, maxCombinedTextureImageUnits);
}
-//#include FAKE_GL_MODE
-//#include REAL_GL_MODE
+int GPU_max_textures(void)
+{
+ return GG.maxtextures;
+}
+
void GPU_extensions_init(void)
{
GLint r, g, b;
const char *vendor, *renderer;
int bdepth = -1;
-
/* can't avoid calling this multiple times, see wm_window_add_ghostwindow */
if (gpu_extensions_init) return;
gpu_extensions_init= 1;
@@ -177,12 +173,12 @@
gpuInitializeViewFuncs();
GPU_codegen_init();
+ GG.maxtextures = calc_max_textures();
+
#if defined(WITH_GL_PROFILE_ES20) || defined(WITH_GL_PROFILE_CORE)
gpu_object_init_gles();
#endif
- GG.maxtexsize = calc_max_textures();
-
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &GG.maxtexsize);
glGetIntegerv(GL_RED_BITS, &r);
@@ -782,7 +778,7 @@
/* Now we tweak some of the settings */
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RG32F_EXT, size, size, 0, GL_RG_EXT, GL_FLOAT, NULL);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RG32F, size, size, 0, GL_RG, GL_FLOAT, NULL);
GPU_texture_unbind(tex);
}
Modified: branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_glew.h
===================================================================
--- branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_glew.h 2013-07-19 09:09:30 UTC (rev 58375)
+++ branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_glew.h 2013-07-19 09:14:01 UTC (rev 58376)
@@ -110,8 +110,8 @@
#define GLEW_ARB_shadow 0
#endif
-#ifndef GL_ARB_texture_float
-#define GL_ARB_texture_float 0
+#ifndef GLEW_ARB_texture_float
+#define GLEW_ARB_texture_float 0
#endif
#ifndef GLEW_ARB_texture_non_power_of_two
@@ -200,22 +200,62 @@
#if defined(GLEW_NO_ES)
-#ifndef GL_OES_framebuffer_object
+#ifndef GLEW_ES_VERSION_2_0
+#define GLEW_ES_VERSION_2_0 0
+#endif
+
+#ifndef GLEW_EXT_texture_storage
+#define GLEW_EXT_texture_storage 0
+#endif
+
+#ifndef GLEW_OES_framebuffer_object
#define GLEW_OES_framebuffer_object 0
#endif
-#ifndef GL_OES_mapbuffer
+#ifndef GLEW_OES_mapbuffer
#define GLEW_OES_mapbuffer 0
#endif
-#ifndef GL_OES_framebuffer_object
-#define GLEW_OES_framebuffer_object 0
+#ifndef GLEW_OES_required_internalformat
+#define GLEW_OES_required_internalformat 0
#endif
-#ifndef GLEW_ES_VERSION_2_0
-#define GLEW_ES_VERSION_2_0 0
+#ifndef GLEW_EXT_color_buffer_half_float
+#define GLEW_EXT_color_buffer_half_float 0
#endif
+#ifndef GLEW_OES_depth_texture
+#define GLEW_OES_depth_texture 0
+#endif
+
+#ifndef GLEW_EXT_shadow_samplers
+#define GLEW_EXT_shadow_samplers 0
+#endif
+
+#ifndef GLEW_ARB_texture3D
+#define GLEW_ARB_texture3D 0
+#endif
+
+#ifndef GLEW_OES_texture_3D
+#define GLEW_OES_texture_3D 0
+#endif
+
+#ifndef GLEW_ARB_texture_rg
+#define GLEW_ARB_texture_rg 0
+#endif
+
+#ifndef GLEW_EXT_texture_rg
+#define GLEW_EXT_texture_rg 0
+#endif
+
+#ifndef GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT
+#endif
+
+#ifndef GL_FRAMEBUFFER_INCOMPLETE_FORMATS
+#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT
+#endif
+
#endif /* defined(GLEW_NO_ES) */
Modified: branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_lighting_inline.h
===================================================================
--- branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_lighting_inline.h 2013-07-19 09:09:30 UTC (rev 58375)
+++ branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_lighting_inline.h 2013-07-19 09:14:01 UTC (rev 58376)
@@ -35,7 +35,9 @@
#include "gpu_lighting.h"
+// XXX jwilkins: need rudimentary gpu safety
+
BLI_INLINE void gpuMaterialfv(GLenum face, GLenum pname, const GLfloat *params)
{
GPU_LIGHTING->material_fv(face, pname, params);
Modified: branches/soc-2013-viewport_fx/source/blender/windowmanager/intern/wm_init_exit.c
===================================================================
--- branches/soc-2013-viewport_fx/source/blender/windowmanager/intern/wm_init_exit.c 2013-07-19 09:09:30 UTC (rev 58375)
+++ branches/soc-2013-viewport_fx/source/blender/windowmanager/intern/wm_init_exit.c 2013-07-19 09:14:01 UTC (rev 58376)
@@ -141,21 +141,11 @@
wm_ghost_init(C); /* note: it assigns C to ghost! */
wm_init_cursor_data();
- /* begin - init opengl compatibility layer */
+ gpuInitializeLighting(); // XXX jwilkins: sort out this initialization order
GPU_ms_init();
GPU_init_object_func();
+ }
- immediate = gpuNewImmediate();
- gpuImmediateMakeCurrent(immediate);
- gpuImmediateMaxVertexCount(500000); // XXX: temporary!
-
- gindex = gpuNewIndex();
- gpuImmediateIndex(gindex);
- gpuImmediateMaxIndexCount(500000); // XXX: temporary!
-
- gpuInitializeLighting();
- /* end - init opengl compatibility layer */
- }
GHOST_CreateSystemPaths();
BKE_addon_pref_type_init();
@@ -211,6 +201,18 @@
GPU_set_anisotropic(U.anisotropic_filter);
GPU_set_gpu_mipmapping(U.use_gpu_mipmap);
+ /* begin - init opengl compatibility layer */
+
+ immediate = gpuNewImmediate();
+ gpuImmediateMakeCurrent(immediate);
+ gpuImmediateMaxVertexCount(500000); // XXX: temporary!
+
+ gindex = gpuNewIndex();
+ gpuImmediateIndex(gindex);
+ gpuImmediateMaxIndexCount(500000); // XXX: temporary!
+
+ /* end - init opengl compatibility layer */
+
UI_init();
}
More information about the Bf-blender-cvs
mailing list