[Bf-blender-cvs] [9822428] soc-2013-viewport_fx: Merge branch 'master' into soc-2013-viewport_fx
jwilkins
noreply at git.blender.org
Tue Mar 4 22:43:23 CET 2014
Commit: 9822428f6c2e4e279241f856886d7df5fa2cd144
Author: jwilkins
Date: Tue Mar 4 15:43:06 2014 -0600
https://developer.blender.org/rB9822428f6c2e4e279241f856886d7df5fa2cd144
Merge branch 'master' into soc-2013-viewport_fx
Conflicts:
CMakeLists.txt
intern/cycles/app/CMakeLists.txt
intern/ghost/CMakeLists.txt
intern/ghost/intern/GHOST_Window.h
intern/ghost/intern/GHOST_WindowWin32.cpp
intern/ghost/intern/GHOST_WindowWin32.h
release/datafiles/startup.blend
source/blender/blenfont/BLF_api.h
source/blender/blenfont/intern/blf_font.c
source/blender/blenfont/intern/blf_glyph.c
source/blender/blenfont/intern/blf_lang.c
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/editderivedmesh.c
source/blender/blenkernel/intern/mball.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/pbvh.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenlib/BLI_math_base.h
source/blender/blenlib/BLI_math_matrix.h
source/blender/blenlib/BLI_smallhash.h
source/blender/blenlib/intern/math_matrix.c
source/blender/blenlib/intern/math_vector_inline.c
source/blender/blenlib/intern/storage.c
source/blender/blenloader/BLO_readfile.h
source/blender/datatoc/CMakeLists.txt
source/blender/editors/animation/keyframes_draw.c
source/blender/editors/armature/CMakeLists.txt
source/blender/editors/armature/editarmature_sketch.c
source/blender/editors/gpencil/drawgpencil.c
source/blender/editors/include/BIF_gl.h
source/blender/editors/include/BIF_glutil.h
source/blender/editors/include/UI_interface.h
source/blender/editors/interface/interface_draw.c
source/blender/editors/interface/interface_ops.c
source/blender/editors/interface/interface_panel.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/mask/mask_draw.c
source/blender/editors/mesh/editmesh_knife.c
source/blender/editors/mesh/editmesh_select.c
source/blender/editors/screen/glutil.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/screen/screendump.c
source/blender/editors/sculpt_paint/paint_cursor.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_image_proj.c
source/blender/editors/sculpt_paint/paint_intern.h
source/blender/editors/sculpt_paint/sculpt_intern.h
source/blender/editors/space_action/action_draw.c
source/blender/editors/space_action/space_action.c
source/blender/editors/space_clip/clip_dopesheet_draw.c
source/blender/editors/space_clip/clip_draw.c
source/blender/editors/space_file/file_intern.h
source/blender/editors/space_graph/graph_draw.c
source/blender/editors/space_image/image_draw.c
source/blender/editors/space_info/textview.c
source/blender/editors/space_nla/nla_draw.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/editors/space_text/text_draw.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/drawvolume.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_fly.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform.h
source/blender/editors/transform/transform_constraints.c
source/blender/editors/transform/transform_manipulator.c
source/blender/editors/util/ed_util.c
source/blender/editors/uvedit/CMakeLists.txt
source/blender/editors/uvedit/uvedit_draw.c
source/blender/editors/uvedit/uvedit_smart_stitch.c
source/blender/gpu/GPU_buffers.h
source/blender/gpu/intern/gpu_buffers.c
source/blender/gpu/intern/gpu_codegen.c
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/intern/gpu_extensions.c
source/blender/gpu/intern/gpu_simple_shader.c
source/blender/gpu/shaders/gpu_shader_material.glsl
source/blender/render/intern/source/voxeldata.c
source/blender/windowmanager/intern/wm_dragdrop.c
source/blender/windowmanager/intern/wm_draw.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_gesture.c
source/blender/windowmanager/intern/wm_subwindow.c
source/blender/windowmanager/intern/wm_window.c
===================================================================
===================================================================
diff --cc CMakeLists.txt
index 2f0ef61,7ebc20f..461faf3
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@@ -172,12 -172,8 +172,9 @@@ if(UNIX AND NOT APPLE
option(WITH_X11_XINPUT "Enable X11 Xinput (tablet support and unicode input)" ON)
option(WITH_X11_XF86VMODE "Enable X11 video mode switching" ON)
option(WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library provided by the operating system" ON)
+ option(WITH_SYSTEM_GLES "Use OpenGL ES library provided by the operating system" ON)
- # freebsd doesn't seems to support XDND
- if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
- option(WITH_GHOST_XDND "Enable drag'n'drop support on Linux using XDND protocol" ON)
- endif()
+ option(WITH_GHOST_XDND "Enable drag'n'drop support on X11 using XDND protocol" ON)
else()
# not an option for other OS's
set(WITH_SYSTEM_GLEW OFF)
@@@ -2452,19 -2378,9 +2538,22 @@@ if(FIRST_RUN
info_cfg_option(WITH_MOD_FLUID)
info_cfg_option(WITH_MOD_OCEANSIM)
+ info_cfg_text("OpenGL:")
+ info_cfg_option(WITH_GLEW_ES)
+ info_cfg_option(WITH_GLU)
+ info_cfg_option(WITH_GL_SYSTEM_DESKTOP)
+ info_cfg_option(WITH_GL_SYSTEM_EMBEDDED)
+ info_cfg_option(WITH_GL_PROFILE_COMPAT)
+ info_cfg_option(WITH_GL_PROFILE_CORE)
+ info_cfg_option(WITH_GL_PROFILE_ES20)
+ info_cfg_option(WITH_GPU_SAFETY)
+ if(WIN32)
+ info_cfg_option(WITH_ANGLE)
+ endif()
+
+ info_cfg_text("Other:")
+ info_cfg_option(WITH_OPENNL)
+
# debug
message(STATUS "HAVE_STDBOOL_H = ${HAVE_STDBOOL_H}")
diff --cc intern/cycles/app/CMakeLists.txt
index d44f93a,52806b0..71d8f55
--- a/intern/cycles/app/CMakeLists.txt
+++ b/intern/cycles/app/CMakeLists.txt
@@@ -20,14 -20,23 +20,23 @@@ set(LIBRARIE
cycles_subd
cycles_util
${BOOST_LIBRARIES}
+ ${OPENEXR_LIBRARIES}
- ${OPENGL_LIBRARIES}
- ${CYCLES_GLEW_LIBRARY}
+ ${SYSTEM_GL_LIBRARIES}
- ${CYCLES_GLEW_LIBRARY}
++ ${CYCLES_GLEW_LIBRARY} # XXX jwilkins, is this needed with the viewport fx re-factor?
${OPENIMAGEIO_LIBRARIES}
+ ${PNG_LIBRARIES}
+ ${JPEG_LIBRARIES}
+ ${ZLIB_LIBRARIES}
+ ${TIFF_LIBRARY}
)
- link_directories(${OPENIMAGEIO_LIBPATH} ${BOOST_LIBPATH})
+ if(WIN32)
+ list(APPEND LIBRARIES ${PTHREADS_LIBRARIES})
+ endif()
+
+ link_directories(${OPENIMAGEIO_LIBPATH} ${BOOST_LIBPATH} ${PNG_LIBPATH} ${JPEG_LIBPATH} ${ZLIB_LIBPATH} ${TIFF_LIBPATH})
- if(WITH_CYCLES_TEST)
+ if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI)
list(APPEND LIBRARIES ${GLUT_LIBRARIES})
endif()
diff --cc intern/cycles/device/device.cpp
index ee160b2,a3264f0..9d60d06
--- a/intern/cycles/device/device.cpp
+++ b/intern/cycles/device/device.cpp
@@@ -57,27 -59,67 +59,69 @@@ void Device::draw_pixels(device_memory
if(transparent) {
glEnable(GL_BLEND);
- glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+ glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); /* non-standard blend function */
}
- glPixelZoom((float)width/(float)w, (float)height/(float)h);
- glRasterPos2f(0, dy);
+ glColor3f(1.0f, 1.0f, 1.0f);
+
+ if(rgba.data_type == TYPE_HALF) {
+ /* for multi devices, this assumes the ineffecient method that we allocate
+ * all pixels on the device even though we only render to a subset */
+ GLhalf *data_pointer = (GLhalf*)rgba.data_pointer;
+ data_pointer += 4*y*w;
+
+ /* draw half float texture, GLSL shader for display transform assumed to be bound */
+ GLuint texid;
+ glGenTextures(1, &texid);
+ glBindTexture(GL_TEXTURE_2D, texid);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, w, h, 0, GL_RGBA, GL_HALF_FLOAT, data_pointer);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+
+ glEnable(GL_TEXTURE_2D);
+
+ glPushMatrix();
+ glTranslatef(0.0f, (float)dy, 0.0f);
+
+ glBegin(GL_QUADS);
+
+ glTexCoord2f(0.0f, 0.0f);
+ glVertex2f(0.0f, 0.0f);
+ glTexCoord2f(1.0f, 0.0f);
+ glVertex2f((float)width, 0.0f);
+ glTexCoord2f(1.0f, 1.0f);
+ glVertex2f((float)width, (float)height);
+ glTexCoord2f(0.0f, 1.0f);
+ glVertex2f(0.0f, (float)height);
+
+ glEnd();
+
+ glPopMatrix();
+
+ glBindTexture(GL_TEXTURE_2D, 0);
+ glDisable(GL_TEXTURE_2D);
+ glDeleteTextures(1, &texid);
+ }
+ else {
+ /* fallback for old graphics cards that don't support GLSL, half float,
+ * and non-power-of-two textures */
+ glPixelZoom((float)width/(float)w, (float)height/(float)h);
+ glRasterPos2f(0, dy);
- uint8_t *pixels = (uint8_t*)rgba.data_pointer;
+ uint8_t *pixels = (uint8_t*)rgba.data_pointer;
- /* for multi devices, this assumes the ineffecient method that we allocate
- * all pixels on the device even though we only render to a subset */
- pixels += 4*y*w;
+ pixels += 4*y*w;
- glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
+ glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
- glRasterPos2f(0.0f, 0.0f);
- glPixelZoom(1.0f, 1.0f);
+ glRasterPos2f(0.0f, 0.0f);
+ glPixelZoom(1.0f, 1.0f);
+ }
- if(transparent)
+ if(transparent) {
glDisable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); /* reset blender default */
+ }
}
Device *Device::create(DeviceInfo& info, Stats &stats, bool background)
diff --cc intern/cycles/device/device_cuda.cpp
index d28dba7,3073f07..107ca16
--- a/intern/cycles/device/device_cuda.cpp
+++ b/intern/cycles/device/device_cuda.cpp
@@@ -835,14 -918,17 +918,17 @@@ public
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, pmem.cuPBO);
glBindTexture(GL_TEXTURE_2D, pmem.cuTexId);
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, (void*)offset);
+ if(mem.data_type == TYPE_HALF)
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_RGBA, GL_HALF_FLOAT, (void*)offset);
+ else
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, (void*)offset);
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
-
+
glEnable(GL_TEXTURE_2D);
-
+
if(transparent) {
glEnable(GL_BLEND);
- glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+ glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); /* non-standard blend function */
}
glColor3f(1.0f, 1.0f, 1.0f);
diff --cc intern/ghost/CMakeLists.txt
index 2d1a656,beca24f..b720492
--- a/intern/ghost/CMakeLists.txt
+++ b/intern/ghost/CMakeLists.txt
@@@ -133,19 -128,13 +132,12 @@@ if(WITH_HEADLESS OR WITH_GHOST_SDL
add_definitions(-DWITH_GHOST_SDL)
endif()
-
# ack, this is still system dependant
if(APPLE)
- if(WITH_COCOA)
- list(APPEND SRC
- intern/GHOST_SystemPathsCocoa.mm
- intern/GHOST_SystemPathsCocoa.h
- )
- else()
- list(APPEND SRC
- intern/GHOST_SystemPathsCarbon.cpp
- intern/GHOST_SystemPathsCarbon.h
- )
- endif()
+ list(APPEND SRC
+ intern/GHOST_SystemPathsCocoa.mm
+ intern/GHOST_SystemPathsCocoa.h
+ )
elseif(UNIX)
list(APPEND SRC
@@@ -174,76 -164,57 +166,65 @@@
)
endif()
-elseif(APPLE)
+else()
+ if(WITH_GL_SYSTEM_EMBEDDED)
+ list(APPEND SRC
+ intern/GHOST_ContextEGL.cpp
+
+ intern/GHOST_ContextEGL.h
+ )
+ endif()
+
+ if(APPLE)
- if(WITH_COCOA)
- list(APPEND SRC
- intern/GHOST_DisplayManagerCocoa.mm
- intern/GHOST_SystemCocoa.mm
- intern/GHOST_SystemPathsCocoa.mm
- intern/GHOST_WindowCocoa.mm
-
- intern/GHOST_DisplayManagerCocoa.h
- intern/GHOST_SystemCocoa.h
- intern/GHOST_SystemPathsCocoa.h
- intern/GHOST_WindowCocoa.h
- )
+ list(APPEND SRC
+ intern/GHOST_DisplayManagerCocoa.mm
+ intern/GHOST_SystemCocoa.mm
+ intern/GHOST_SystemPathsCocoa.mm
+ intern/GHOST_WindowCocoa.mm
+
+ intern/GHOST_DisplayManagerCocoa.h
+ intern/GHOST_SystemCocoa.h
+ intern/GHOST_SystemPathsCocoa.h
+ intern/GHOST_WindowCocoa.h
+ )
+
+ if (WITH_GL_SYSTEM_DESKTOP)
+ list(APPEND SRC
+ intern/GHOST_ContextCGL.mm
+
+ intern/GHOST_ContextCGL.h
+ )
+ endif()
- if(WITH_INPUT_NDOF)
- list(APPEND SRC
- intern/GHOST_NDOFManagerCocoa.mm
+ if(WITH_INPUT_NDOF)
+ list(APPEND SRC
+ intern/GHOST_NDOFManagerCocoa.mm
+
- intern/GHOST_NDOFManagerCocoa.h
- )
- endif()
-
- else()
- list(APPEND SRC
- intern/GHOST_DisplayManagerCarbon.cpp
- intern/GHOST_SystemCarbon.cpp
- intern/GHOST_SystemPathsCarbon.cpp
- intern/GHOST_WindowCarbon.cpp
-
- intern/GHOST_DisplayManagerCarbon.h
- intern/GHOST_SystemCarbon.h
- intern/GHOST_SystemPathsCarbon.h
- intern/GHOST_WindowCarbon.h
+ intern/GHOST_NDOFManagerCocoa.h
+ )
+ list(APPEND SRC_NDOF3DCONNEXION
+ intern/GHOST_NDOFManager3Dconnexion.c
+ intern/GHOST_NDOFManager3Dconnexion.h
- )
- endif()
+ )
- if(WITH_CODEC_QUICKTIME)
- add_definitions(-DWITH_QUICKTIME)
- endif()
-
-elseif(UNIX)
+ if (WITH_GL_SYSTEM_DESKTOP)
+ list(APPEND SRC
+ intern/GHOST_ContextAGL.cpp
+
+ intern/GHOST_ContextAGL.h
+ )
+ endif()
- list(APPEND INC_SYS
- ${X11_X11_INCLUDE_PATH}
- )
+ endif()
- list(APPEND SRC
- intern/GHOST_DisplayManagerX11.cpp
- intern/GHOST_SystemX11.cpp
- intern/GHOST_SystemPathsX11.cpp
- intern/GHOST_WindowX11.cpp
-
- intern/GHOST_DisplayManagerX11.h
- intern/GHOST_SystemX11.h
- intern/GHOST_SystemPathsX11.h
- intern/GHOST_WindowX11.h
- )
+ if(WITH_CODEC_QUICKTIME)
+ add_definitions(-DWITH_QUICKTIME)
+ endif()
- if(WITH_GHOST_XDND)
- add_definitions(-DWITH_XDND)
+ elseif(UNIX)
- list(APPEND INC
- ../../extern/xdnd
+ list(APPEND INC_SYS
+ ${X11_X11_INCLUDE_PATH}
)
list(APPEND SRC
@@@ -362,6 -296,11 +343,12 @@@
endif()
-add_definitions(-DGLEW_STATIC)
++
+add_definitions(${GL_DEFINITIONS})
blender_add_lib(bf_intern_ghost "${SRC}" "${INC}" "${INC_SYS}")
+
+ # workaround for apple clang mangling extern "C" symbols
+ if(WITH_INPUT_NDOF AND APPLE)
+ blender_add_lib(bf_intern_ghostndof3dconnexion "${SRC_NDOF3DCONNEXION}" "${INC}" "${INC_SYS}")
+ endif()
diff --cc intern/ghost/intern/GHOST_Window.h
index 67fa0d8,77ee4db..5091ab8
--- a/intern/ghost/intern/GHOST_Window.h
+++ b/intern/ghost/intern/GHOST_Window.h
@@@ -67,6 -66,10 +67,8 @@@ public
* virtual GHOST_TSuccess setS
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list