[Bf-blender-cvs] [f7ce482] master: Cycles: Fix another OpenCL logging issue

2016-10-20 Thread Lukas Stockner
Commit: f7ce482385b760135a36ff778e8c3436cdcf5404
Author: Lukas Stockner
Date:   Fri Oct 21 02:49:00 2016 +0200
Branches: master
https://developer.blender.org/rBf7ce482385b760135a36ff778e8c3436cdcf5404

Cycles: Fix another OpenCL logging issue

Previously an error message would be printed whenever the OpenCL build produced 
output.
However, some frameworks seem to print extra information even if the build 
succeeded, so now the actual returned error is checked as well.
When --debug-cycles is activated, the build output will always be printed, 
otherwise it only gets printed if there was an error.

===

M   intern/cycles/device/opencl/opencl_base.cpp
M   intern/cycles/device/opencl/opencl_util.cpp

===

diff --git a/intern/cycles/device/opencl/opencl_base.cpp 
b/intern/cycles/device/opencl/opencl_base.cpp
index ea65be3..e67ffb1 100644
--- a/intern/cycles/device/opencl/opencl_base.cpp
+++ b/intern/cycles/device/opencl/opencl_base.cpp
@@ -233,6 +233,9 @@ bool OpenCLDeviceBase::load_kernels(const 
DeviceRequestedFeatures& requested_fea
 #else
foreach(OpenCLProgram *program, programs) {
program->load();
+   if(!program->is_loaded()) {
+   return false;
+   }
}
 #endif
 
diff --git a/intern/cycles/device/opencl/opencl_util.cpp 
b/intern/cycles/device/opencl/opencl_util.cpp
index 86aa805..e425ae8 100644
--- a/intern/cycles/device/opencl/opencl_util.cpp
+++ b/intern/cycles/device/opencl/opencl_util.cpp
@@ -316,6 +316,10 @@ bool OpenCLDeviceBase::OpenCLProgram::build_kernel(const 
string *debug_src)
 
clGetProgramBuildInfo(program, device->cdDevice, CL_PROGRAM_BUILD_LOG, 
0, NULL, _val_size);
 
+   if(ciErr != CL_SUCCESS) {
+   add_error(string("OpenCL build failed with error ") + 
clewErrorString(ciErr) + ", errors in console.");
+   }
+
if(ret_val_size > 1) {
vector build_log(ret_val_size + 1);
clGetProgramBuildInfo(program, device->cdDevice, 
CL_PROGRAM_BUILD_LOG, ret_val_size, _log[0], NULL);
@@ -323,22 +327,11 @@ bool OpenCLDeviceBase::OpenCLProgram::build_kernel(const 
string *debug_src)
build_log[ret_val_size] = '\0';
/* Skip meaningless empty output from the NVidia compiler. */
if(!(ret_val_size == 2 && build_log[0] == '\n')) {
-   add_error("OpenCL build failed: errors in console");
-   if(use_stdout) {
-   fprintf(stderr, "OpenCL kernel build 
output:\n%s\n", _log[0]);
-   }
-   else {
-   compile_output = string(_log[0]);
-   }
+   add_log(string("OpenCL program ") + program_name + " 
build output: " + string(_log[0]), ciErr == CL_SUCCESS);
}
}
 
-   if(ciErr != CL_SUCCESS) {
-   add_error(string("OpenCL build failed: ") + 
clewErrorString(ciErr));
-   return false;
-   }
-
-   return true;
+   return (ciErr == CL_SUCCESS);
 }
 
 bool OpenCLDeviceBase::OpenCLProgram::compile_kernel(const string *debug_src)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [a14d7f3] transform-manipulators: Implement new rotation manipulators

2016-10-20 Thread Julian Eisel
Commit: a14d7f3009d75e5f15df4f9ea4342634d229ea4f
Author: Julian Eisel
Date:   Fri Oct 21 01:57:40 2016 +0200
Branches: transform-manipulators
https://developer.blender.org/rBa14d7f3009d75e5f15df4f9ea4342634d229ea4f

Implement new rotation manipulators

===

M   source/blender/editors/space_view3d/view3d_transform_manipulators.c

===

diff --git 
a/source/blender/editors/space_view3d/view3d_transform_manipulators.c 
b/source/blender/editors/space_view3d/view3d_transform_manipulators.c
index 3691bfc..714499f 100644
--- a/source/blender/editors/space_view3d/view3d_transform_manipulators.c
+++ b/source/blender/editors/space_view3d/view3d_transform_manipulators.c
@@ -92,10 +92,13 @@ enum TransformAxisType {
 typedef struct TransformManipulatorsInfo {
struct TranformAxisManipulator *axes; /* Array of axes */
 
+   wmManipulatorGroup *mgroup;
float mat[4][4]; /* Cached loc/rot matrix */
 } TransformManipulatorsInfo;
 
-typedef void TransformManipulatorUpdateFunc(const bContext *, const struct 
TransformManipulatorsInfo *,
+typedef wmManipulator *TransformManipulatorInitFunc(const 
TransformManipulatorsInfo *,
+struct 
TranformAxisManipulator *);
+typedef void TransformManipulatorUpdateFunc(const bContext *, const 
TransformManipulatorsInfo *,
 const struct 
TranformAxisManipulator *);
 
 typedef struct TranformAxisManipulator {
@@ -105,6 +108,7 @@ typedef struct TranformAxisManipulator {
int transform_type; /* View3d->twtype */
 
/* per-manipulator callbacks for initializing/updating data */
+   TransformManipulatorInitFunc   (*init);
TransformManipulatorUpdateFunc (*refresh);
TransformManipulatorUpdateFunc (*draw_prepare);
 
@@ -116,7 +120,7 @@ typedef struct TranformAxisManipulator {
float scale;
float line_width;
int theme_colorid;
-   int manipulator_type;
+   int manipulator_style;
 
 
/* -- initialized later -- */
@@ -124,10 +128,11 @@ typedef struct TranformAxisManipulator {
wmManipulator *manipulator;
 } TranformAxisManipulator;
 
-static void manipulator_refresh_arrow(
-const bContext *UNUSED(C), const TransformManipulatorsInfo *info, 
const TranformAxisManipulator *axis);
-static void manipulator_view_dial_draw_prepare(
-const bContext *C, const TransformManipulatorsInfo *info, const 
TranformAxisManipulator *axis);
+static TransformManipulatorInitFunc   manipulator_arrow_init;
+static TransformManipulatorUpdateFunc manipulator_arrow_draw_prepare;
+static TransformManipulatorInitFunc   manipulator_dial_init;
+static TransformManipulatorUpdateFunc manipulator_dial_refresh;
+static TransformManipulatorUpdateFunc manipulator_view_dial_draw_prepare;
 
 /**
  * This TranformAxisManipulator array contains all the info we need to 
initialize, store and identify all
@@ -138,28 +143,52 @@ static void manipulator_view_dial_draw_prepare(
 static TranformAxisManipulator tman_axes[] = {
{
MAN_AXIS_TRANS_X, V3D_MANIP_TRANSLATE,
-   manipulator_refresh_arrow, NULL,
+   manipulator_arrow_init, NULL, manipulator_arrow_draw_prepare,
"translate_x", {1, 0, 0}, OB_LOCK_LOCX,
1.0f, TRANSFORM_MAN_AXIS_LINE_WIDTH, TH_AXIS_X, 
MANIPULATOR_ARROW_STYLE_NORMAL,
},
{
MAN_AXIS_TRANS_Y, V3D_MANIP_TRANSLATE,
-   manipulator_refresh_arrow, NULL,
+   manipulator_arrow_init, NULL, manipulator_arrow_draw_prepare,
"translate_y", {0, 1, 0}, OB_LOCK_LOCY,
1.0f, TRANSFORM_MAN_AXIS_LINE_WIDTH, TH_AXIS_Y, 
MANIPULATOR_ARROW_STYLE_NORMAL,
},
{
MAN_AXIS_TRANS_Z, V3D_MANIP_TRANSLATE,
-   manipulator_refresh_arrow, NULL,
+   manipulator_arrow_init, NULL, manipulator_arrow_draw_prepare,
"translate_z", {0, 0, 1}, OB_LOCK_LOCZ,
1.0f, TRANSFORM_MAN_AXIS_LINE_WIDTH, TH_AXIS_Z, 
MANIPULATOR_ARROW_STYLE_NORMAL,
},
{
MAN_AXIS_TRANS_C, V3D_MANIP_TRANSLATE,
-   NULL, manipulator_view_dial_draw_prepare,
+   manipulator_dial_init, manipulator_dial_refresh, 
manipulator_view_dial_draw_prepare,
"translate_c", {0}, 0,
0.2f, TRANSFORM_MAN_AXIS_LINE_WIDTH, -1, 
MANIPULATOR_DIAL_STYLE_RING,
},
+   {
+   MAN_AXIS_ROT_X, V3D_MANIP_ROTATE,
+   manipulator_dial_init, manipulator_dial_refresh, NULL,
+   "rotate_x", {1, 0, 0}, OB_LOCK_ROTX,
+   1.0f, TRANSFORM_MAN_AXIS_LINE_WIDTH + 1.0f, TH_AXIS_X, 
MANIPULATOR_DIAL_STYLE_RING_CLIPPED,
+   },
+   {
+   MAN_AXIS_ROT_Y, V3D_MANIP_ROTATE,
+   

[Bf-blender-cvs] [57d6983] transform-manipulators: Add view aligned circle manipulator for free translation

2016-10-20 Thread Julian Eisel
Commit: 57d6983f52b9c4223a128aea04beb83a33901d93
Author: Julian Eisel
Date:   Thu Oct 20 23:47:23 2016 +0200
Branches: transform-manipulators
https://developer.blender.org/rB57d6983f52b9c4223a128aea04beb83a33901d93

Add view aligned circle manipulator for free translation

===

M   source/blender/editors/space_view3d/view3d_transform_manipulators.c
M   source/blender/windowmanager/CMakeLists.txt
M   source/blender/windowmanager/manipulators/WM_manipulator_library.h
A   
source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c
M   source/blender/windowmanager/manipulators/intern/wm_manipulator.c

===

diff --git 
a/source/blender/editors/space_view3d/view3d_transform_manipulators.c 
b/source/blender/editors/space_view3d/view3d_transform_manipulators.c
index 043ced6..3691bfc 100644
--- a/source/blender/editors/space_view3d/view3d_transform_manipulators.c
+++ b/source/blender/editors/space_view3d/view3d_transform_manipulators.c
@@ -86,21 +86,37 @@ enum TransformAxisType {
 
 #define TRANSFORM_MAN_AXIS_LINE_WIDTH 2.0f
 
+/**
+ * Struct for carrying data of transform manipulators as 
wmManipulatorGroup.customdata.
+ */
+typedef struct TransformManipulatorsInfo {
+   struct TranformAxisManipulator *axes; /* Array of axes */
+
+   float mat[4][4]; /* Cached loc/rot matrix */
+} TransformManipulatorsInfo;
+
+typedef void TransformManipulatorUpdateFunc(const bContext *, const struct 
TransformManipulatorsInfo *,
+const struct 
TranformAxisManipulator *);
+
 typedef struct TranformAxisManipulator {
/* -- initialized using static array -- */
 
enum TransformAxisType index;
int transform_type; /* View3d->twtype */
 
+   /* per-manipulator callbacks for initializing/updating data */
+   TransformManipulatorUpdateFunc (*refresh);
+   TransformManipulatorUpdateFunc (*draw_prepare);
+
const char *name;
-   /* op info */
-   const char *op_name;
int constraint[3]; /* {x, y, z} */
+   int protectflag; /* the protectflags this axis checks (e.g. 
OB_LOCK_LOCZ) */
 
/* appearance */
-   int theme_colorid, line_width;
+   float scale;
+   float line_width;
+   int theme_colorid;
int manipulator_type;
-   int protectflag; /* the protectflags this axis checks (e.g. 
OB_LOCK_LOCZ) */
 
 
/* -- initialized later -- */
@@ -108,14 +124,10 @@ typedef struct TranformAxisManipulator {
wmManipulator *manipulator;
 } TranformAxisManipulator;
 
-/**
- * Struct for carrying data of transform manipulators as 
wmManipulatorGroup.customdata.
- */
-typedef struct TransformManipulatorsInfo {
-   TranformAxisManipulator *axes; /* Array of axes */
-
-   float mat[4][4]; /* Cached loc/rot matrix */
-} TransformManipulatorsInfo;
+static void manipulator_refresh_arrow(
+const bContext *UNUSED(C), const TransformManipulatorsInfo *info, 
const TranformAxisManipulator *axis);
+static void manipulator_view_dial_draw_prepare(
+const bContext *C, const TransformManipulatorsInfo *info, const 
TranformAxisManipulator *axis);
 
 /**
  * This TranformAxisManipulator array contains all the info we need to 
initialize, store and identify all
@@ -126,21 +138,27 @@ typedef struct TransformManipulatorsInfo {
 static TranformAxisManipulator tman_axes[] = {
{
MAN_AXIS_TRANS_X, V3D_MANIP_TRANSLATE,
-   "translate_x", "TRANSFORM_OT_translate", {1, 0, 0},
-   TH_AXIS_X, TRANSFORM_MAN_AXIS_LINE_WIDTH,
-   MANIPULATOR_ARROW_STYLE_NORMAL, OB_LOCK_LOCX,
+   manipulator_refresh_arrow, NULL,
+   "translate_x", {1, 0, 0}, OB_LOCK_LOCX,
+   1.0f, TRANSFORM_MAN_AXIS_LINE_WIDTH, TH_AXIS_X, 
MANIPULATOR_ARROW_STYLE_NORMAL,
},
{
MAN_AXIS_TRANS_Y, V3D_MANIP_TRANSLATE,
-   "translate_y", "TRANSFORM_OT_translate", {0, 1, 0},
-   TH_AXIS_Y, TRANSFORM_MAN_AXIS_LINE_WIDTH,
-   MANIPULATOR_ARROW_STYLE_NORMAL, OB_LOCK_LOCY,
+   manipulator_refresh_arrow, NULL,
+   "translate_y", {0, 1, 0}, OB_LOCK_LOCY,
+   1.0f, TRANSFORM_MAN_AXIS_LINE_WIDTH, TH_AXIS_Y, 
MANIPULATOR_ARROW_STYLE_NORMAL,
},
{
MAN_AXIS_TRANS_Z, V3D_MANIP_TRANSLATE,
-   "translate_z", "TRANSFORM_OT_translate", {0, 0, 1},
-   TH_AXIS_Z, TRANSFORM_MAN_AXIS_LINE_WIDTH,
-   MANIPULATOR_ARROW_STYLE_NORMAL, OB_LOCK_LOCZ,
+   manipulator_refresh_arrow, NULL,
+   "translate_z", {0, 0, 1}, OB_LOCK_LOCZ,
+   1.0f, TRANSFORM_MAN_AXIS_LINE_WIDTH, TH_AXIS_Z, 
MANIPULATOR_ARROW_STYLE_NORMAL,
+   },
+   {
+   MAN_AXIS_TRANS_C, V3D_MANIP_TRANSLATE,
+  

[Bf-blender-cvs] [224d70c] temp-blender2.8: OpenGL: draw lamp objects with new imm mode

2016-10-20 Thread Mike Erwin
Commit: 224d70c978859bf17c5294c7e0a50b5041f8
Author: Mike Erwin
Date:   Thu Oct 20 16:55:40 2016 -0400
Branches: temp-blender2.8
https://developer.blender.org/rB224d70c978859bf17c5294c7e0a50b5041f8

OpenGL: draw lamp objects with new imm mode

Previous commit in blender2.8 branch had some... unintended
consequences. This one should be better.

Part of T49043. Also uses new matrix API (T49450)

===

M   source/blender/editors/space_view3d/drawobject.c

===

diff --git a/source/blender/editors/space_view3d/drawobject.c 
b/source/blender/editors/space_view3d/drawobject.c
index 1400ae1..88f1222 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -1033,7 +1033,7 @@ static void drawcube_size(float size, unsigned pos)
 #endif
 }
 
-static void drawshadbuflimits(Lamp *la, float mat[4][4])
+static void drawshadbuflimits(const Lamp *la, const float mat[4][4], unsigned 
pos)
 {
float sta[3], end[3], lavec[3];
 
@@ -1043,16 +1043,16 @@ static void drawshadbuflimits(Lamp *la, float mat[4][4])
madd_v3_v3v3fl(sta, mat[3], lavec, la->clipsta);
madd_v3_v3v3fl(end, mat[3], lavec, la->clipend);
 
-   glBegin(GL_LINES);
-   glVertex3fv(sta);
-   glVertex3fv(end);
-   glEnd();
+   immBegin(GL_LINES, 2);
+   immVertex3fv(pos, sta);
+   immVertex3fv(pos, end);
+   immEnd();
 
glPointSize(3.0);
-   glBegin(GL_POINTS);
-   glVertex3fv(sta);
-   glVertex3fv(end);
-   glEnd();
+   immBegin(GL_POINTS, 2);
+   immVertex3fv(pos, sta);
+   immVertex3fv(pos, end);
+   immEnd();
 }
 
 static void spotvolume(float lvec[3], float vvec[3], const float inp)
@@ -1118,31 +1118,33 @@ static void spotvolume(float lvec[3], float vvec[3], 
const float inp)
mul_m3_v3(mat2, vvec);
 }
 
-static void draw_spot_cone(Lamp *la, float x, float z)
+static void draw_spot_cone(Lamp *la, float x, float z, unsigned pos)
 {
z = fabsf(z);
 
-   glBegin(GL_TRIANGLE_FAN);
-   glVertex3f(0.0f, 0.0f, -x);
+   const bool square = (la->mode & LA_SQUARE);
+
+   immBegin(GL_TRIANGLE_FAN, square ? 6 : 34);
+   immVertex3f(pos, 0.0f, 0.0f, -x);
 
-   if (la->mode & LA_SQUARE) {
-   glVertex3f(z, z, 0);
-   glVertex3f(-z, z, 0);
-   glVertex3f(-z, -z, 0);
-   glVertex3f(z, -z, 0);
-   glVertex3f(z, z, 0);
+   if (square) {
+   immVertex3f(pos, z, z, 0);
+   immVertex3f(pos, -z, z, 0);
+   immVertex3f(pos, -z, -z, 0);
+   immVertex3f(pos, z, -z, 0);
+   immVertex3f(pos, z, z, 0);
}
else {
for (int a = 0; a < 33; a++) {
float angle = a * M_PI * 2 / (33 - 1);
-   glVertex3f(z * cosf(angle), z * sinf(angle), 0);
+   immVertex3f(pos, z * cosf(angle), z * sinf(angle), 
0.0f);
}
}
 
-   glEnd();
+   immEnd();
 }
 
-static void draw_transp_spot_volume(Lamp *la, float x, float z)
+static void draw_transp_spot_volume(Lamp *la, float x, float z, unsigned pos)
 {
glEnable(GL_CULL_FACE);
glEnable(GL_BLEND);
@@ -1152,17 +1154,17 @@ static void draw_transp_spot_volume(Lamp *la, float x, 
float z)
glCullFace(GL_FRONT);
 
glBlendFunc(GL_ZERO, GL_SRC_ALPHA);
-   glColor4f(0.0f, 0.0f, 0.0f, 0.4f);
+   immUniformColor4f(0.0f, 0.0f, 0.0f, 0.4f);
 
-   draw_spot_cone(la, x, z);
+   draw_spot_cone(la, x, z, pos);
 
/* draw front side lighting */
glCullFace(GL_BACK);
 
glBlendFunc(GL_ONE, GL_ONE);
-   glColor4f(0.2f, 0.2f, 0.2f, 1.0f);
+   immUniformColor4f(0.2f, 0.2f, 0.2f, 1.0f);
 
-   draw_spot_cone(la, x, z);
+   draw_spot_cone(la, x, z, pos);
 
/* restore state */
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -1173,7 +1175,7 @@ static void draw_transp_spot_volume(Lamp *la, float x, 
float z)
 }
 
 #ifdef WITH_GAMEENGINE
-static void draw_transp_sun_volume(Lamp *la)
+static void draw_transp_sun_volume(Lamp *la, unsigned pos)
 {
float box[8][3];
 
@@ -1186,7 +1188,7 @@ static void draw_transp_sun_volume(Lamp *la)
box[1][2] = box[2][2] = box[5][2] = box[6][2] = -la->clipsta;
 
/* draw edges */
-   draw_box(box, false);
+   imm_draw_box(box, false, pos);
 
/* draw faces */
glEnable(GL_CULL_FACE);
@@ -1197,17 +1199,17 @@ static void draw_transp_sun_volume(Lamp *la)
glCullFace(GL_FRONT);
 
glBlendFunc(GL_ZERO, GL_SRC_ALPHA);
-   glColor4f(0.0f, 0.0f, 0.0f, 0.4f);
+   immUniformColor4f(0.0f, 0.0f, 0.0f, 0.4f);
 
-   draw_box(box, true);
+   imm_draw_box(box, true, pos);
 
/* draw front side lighting */

[Bf-blender-cvs] [ca10cac] transform-manipulators: Remove unused includes

2016-10-20 Thread Julian Eisel
Commit: ca10cacf6cb272337eb3e2608aea74a0954d236d
Author: Julian Eisel
Date:   Thu Oct 20 22:14:34 2016 +0200
Branches: transform-manipulators
https://developer.blender.org/rBca10cacf6cb272337eb3e2608aea74a0954d236d

Remove unused includes

===

M   
source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c

===

diff --git 
a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
 
b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
index cc14699..0ff9c73 100644
--- 
a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
+++ 
b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
@@ -34,9 +34,7 @@
 #include "DNA_userdef_types.h"
 #include "DNA_windowmanager_types.h"
 
-#include "GPU_basic_shader.h"
 #include "GPU_immediate.h"
-#include "GPU_matrix.h"
 #include "GPU_select.h"
 
 #include "MEM_guardedalloc.h"

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [693265e] transform-manipulators: Use more modern OpenGL for arrow manipulator drawing

2016-10-20 Thread Julian Eisel
Commit: 693265e1e9b8c945ab748dab1619e65329a3b737
Author: Julian Eisel
Date:   Thu Oct 20 21:12:34 2016 +0200
Branches: transform-manipulators
https://developer.blender.org/rB693265e1e9b8c945ab748dab1619e65329a3b737

Use more modern OpenGL for arrow manipulator drawing

Could/should do hings like sharing VBOs between manipulators, using own shader, 
use GPU_matrix API, etc but would need to figure out requirements some more 
first.

===

M   source/blender/windowmanager/CMakeLists.txt
M   
source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
A   
source/blender/windowmanager/manipulators/intern/manipulator_library/geom_cone.c
A   
source/blender/windowmanager/manipulators/intern/manipulator_library/manipulator_geometry.h
M   
source/blender/windowmanager/manipulators/intern/manipulator_library/manipulator_library_intern.h
M   
source/blender/windowmanager/manipulators/intern/manipulator_library/manipulator_library_utils.c
M   source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h

===

diff --git a/source/blender/windowmanager/CMakeLists.txt 
b/source/blender/windowmanager/CMakeLists.txt
index 03172d3..94b7d55 100644
--- a/source/blender/windowmanager/CMakeLists.txt
+++ b/source/blender/windowmanager/CMakeLists.txt
@@ -74,6 +74,7 @@ set(SRC
manipulators/intern/wm_manipulatorgroup.c
manipulators/intern/wm_manipulatormap.c
manipulators/intern/manipulator_library/arrow_manipulator.c
+   manipulators/intern/manipulator_library/geom_cone.c
manipulators/intern/manipulator_library/manipulator_library_utils.c
 
WM_api.h
@@ -92,6 +93,7 @@ set(SRC
manipulators/WM_manipulator_types.h
manipulators/wm_manipulator_wmapi.h
manipulators/intern/wm_manipulator_intern.h
+   manipulators/intern/manipulator_library/manipulator_geometry.h
manipulators/intern/manipulator_library/manipulator_library_intern.h
 )
 
diff --git 
a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
 
b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
index 5d5e401..cc14699 100644
--- 
a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
+++ 
b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
@@ -34,6 +34,9 @@
 #include "DNA_userdef_types.h"
 #include "DNA_windowmanager_types.h"
 
+#include "GPU_basic_shader.h"
+#include "GPU_immediate.h"
+#include "GPU_matrix.h"
 #include "GPU_select.h"
 
 #include "MEM_guardedalloc.h"
@@ -42,6 +45,7 @@
 
 #include "WM_types.h"
 
+#include "manipulator_geometry.h"
 #include "manipulator_library_intern.h"
 #include "WM_manipulator_types.h"
 #include "wm_manipulator_wmapi.h"
@@ -55,49 +59,65 @@ typedef struct ArrowManipulator {
 } ArrowManipulator;
 
 
-static void arrow_draw_geom(const ArrowManipulator *arrow, const bool 
UNUSED(select))
+static void arrow_draw_line(const ArrowManipulator *arrow, const float col[4], 
const float len)
 {
-   const float len = 1.0f; /* TODO arrow->len */
-   const float vec[2][3] = {
-   {0.0f, 0.0f, 0.0f},
-   {0.0f, 0.0f, len},
-   };
+   VertexFormat *format = immVertexFormat();
+   unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 3, KEEP_FLOAT);
+
+   immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
+   immUniformColor4fv(col);
 
glLineWidth(arrow->manipulator.line_width);
-   glEnableClientState(GL_VERTEX_ARRAY);
-   glVertexPointer(3, GL_FLOAT, 0, vec);
-   glDrawArrays(GL_LINE_STRIP, 0, ARRAY_SIZE(vec));
-   glDisableClientState(GL_VERTEX_ARRAY);
-   glLineWidth(1.0);
 
+   immBegin(GL_LINES, 2);
+   immVertex3f(pos, 0.0f, 0.0f, 0.0f);
+   immVertex3f(pos, 0.0f, 0.0f, len);
+   immEnd();
 
-   /* *** draw arrow head *** */
+   immUnbindProgram();
+}
 
-   glPushMatrix();
+static void arrow_draw_cone(const bool select)
+{
+   const ManipulatorGeometryInfo cone_geo = {
+   _MANIPULATOR_nverts_Cone,
+   _MANIPULATOR_ntris_Cone,
+   _MANIPULATOR_verts_Cone,
+   _MANIPULATOR_normals_Cone,
+   _MANIPULATOR_indices_Cone,
+   true,
+   };
+   const float scale = 0.25f;
 
-   const float head_len = 0.25f;
-   const float width = 0.06f;
+   glScalef(scale, scale, scale);
+   wm_manipulator_geometryinfo_draw(_geo, select);
+}
+
+static void arrow_draw_geom(const ArrowManipulator *arrow, const float col[4], 
const bool select)
+{
+   const float len = 1.0f; /* TODO arrow->len */
const bool use_lighting = /*select == false && ((U.manipulator_flag & 
V3D_SHADED_MANIPULATORS) != 0)*/ false;
 
+   glColor4fv(col);
+   

[Bf-blender-cvs] [fb80477] blender2.8: Revert "OpenGL: draw lamp objects with new imm mode"

2016-10-20 Thread Mike Erwin
Commit: fb80477ee1b831f166aa4b87bd164213c98b60a4
Author: Mike Erwin
Date:   Thu Oct 20 15:13:02 2016 -0400
Branches: blender2.8
https://developer.blender.org/rBfb80477ee1b831f166aa4b87bd164213c98b60a4

Revert "OpenGL: draw lamp objects with new imm mode"

This reverts commit 7a0377e22ba8e5d3a79e76699b00743e0eca757e.

===

A   source/blender/editors/space_file/CMakeLists.txt
A   source/blender/editors/space_file/file_draw.c
A   source/blender/editors/space_file/file_intern.h
A   source/blender/editors/space_file/file_ops.c
A   source/blender/editors/space_file/file_panels.c
A   source/blender/editors/space_file/file_utils.c
A   source/blender/editors/space_file/filelist.c
A   source/blender/editors/space_file/filelist.h
A   source/blender/editors/space_file/filesel.c
A   source/blender/editors/space_file/fsmenu.c
A   source/blender/editors/space_file/fsmenu.h
A   source/blender/editors/space_file/space_file.c
A   source/blender/editors/space_graph/CMakeLists.txt
A   source/blender/editors/space_graph/graph_buttons.c
A   source/blender/editors/space_graph/graph_draw.c
A   source/blender/editors/space_graph/graph_edit.c
A   source/blender/editors/space_graph/graph_intern.h
A   source/blender/editors/space_graph/graph_ops.c
A   source/blender/editors/space_graph/graph_select.c
A   source/blender/editors/space_graph/graph_utils.c
A   source/blender/editors/space_graph/space_graph.c
A   source/blender/editors/space_image/CMakeLists.txt
A   source/blender/editors/space_image/image_buttons.c
A   source/blender/editors/space_image/image_draw.c
A   source/blender/editors/space_image/image_edit.c
A   source/blender/editors/space_image/image_intern.h
A   source/blender/editors/space_image/image_ops.c
A   source/blender/editors/space_image/space_image.c
A   source/blender/editors/space_info/CMakeLists.txt
A   source/blender/editors/space_info/info_draw.c
A   source/blender/editors/space_info/info_intern.h
A   source/blender/editors/space_info/info_ops.c
A   source/blender/editors/space_info/info_report.c
A   source/blender/editors/space_info/info_stats.c
A   source/blender/editors/space_info/space_info.c
A   source/blender/editors/space_info/textview.c
A   source/blender/editors/space_info/textview.h
A   source/blender/editors/space_logic/CMakeLists.txt
A   source/blender/editors/space_logic/logic_buttons.c
A   source/blender/editors/space_logic/logic_intern.h
A   source/blender/editors/space_logic/logic_ops.c
A   source/blender/editors/space_logic/logic_window.c
A   source/blender/editors/space_logic/space_logic.c
A   source/blender/editors/space_nla/CMakeLists.txt
A   source/blender/editors/space_nla/nla_buttons.c
A   source/blender/editors/space_nla/nla_channels.c
A   source/blender/editors/space_nla/nla_draw.c
A   source/blender/editors/space_nla/nla_edit.c
A   source/blender/editors/space_nla/nla_intern.h
A   source/blender/editors/space_nla/nla_ops.c
A   source/blender/editors/space_nla/nla_select.c
A   source/blender/editors/space_nla/space_nla.c
A   source/blender/editors/space_node/CMakeLists.txt
A   source/blender/editors/space_node/drawnode.c
A   source/blender/editors/space_node/node_add.c
A   source/blender/editors/space_node/node_buttons.c
A   source/blender/editors/space_node/node_draw.c
A   source/blender/editors/space_node/node_edit.c
A   source/blender/editors/space_node/node_group.c
A   source/blender/editors/space_node/node_intern.h
A   source/blender/editors/space_node/node_ops.c
A   source/blender/editors/space_node/node_relationships.c
A   source/blender/editors/space_node/node_select.c
A   source/blender/editors/space_node/node_templates.c
A   source/blender/editors/space_node/node_toolbar.c
A   source/blender/editors/space_node/node_view.c
A   source/blender/editors/space_node/space_node.c
A   source/blender/editors/space_outliner/CMakeLists.txt
A   source/blender/editors/space_outliner/outliner_draw.c
A   source/blender/editors/space_outliner/outliner_edit.c
A   source/blender/editors/space_outliner/outliner_intern.h
A   source/blender/editors/space_outliner/outliner_ops.c
A   source/blender/editors/space_outliner/outliner_select.c
A   source/blender/editors/space_outliner/outliner_tools.c
A   source/blender/editors/space_outliner/outliner_tree.c
A   source/blender/editors/space_outliner/space_outliner.c
A   source/blender/editors/space_script/CMakeLists.txt
A   source/blender/editors/space_script/script_edit.c
A   source/blender/editors/space_script/script_intern.h
A   source/blender/editors/space_script/script_ops.c
A   source/blender/editors/space_script/space_script.c
A   

[Bf-blender-cvs] [395568d] fluid-mantaflow: change path's to literal strings, to prevent escape issues with windows paths.

2016-10-20 Thread lazydodo
Commit: 395568ddae61fc2d1ea504f61a29b96e79b50952
Author: lazydodo
Date:   Thu Oct 20 13:00:55 2016 -0600
Branches: fluid-mantaflow
https://developer.blender.org/rB395568ddae61fc2d1ea504f61a29b96e79b50952

change path's to literal strings, to prevent escape issues with windows paths.

===

M   intern/mantaflow/intern/FLUID.cpp

===

diff --git a/intern/mantaflow/intern/FLUID.cpp 
b/intern/mantaflow/intern/FLUID.cpp
index 281d504..6f70cf1 100644
--- a/intern/mantaflow/intern/FLUID.cpp
+++ b/intern/mantaflow/intern/FLUID.cpp
@@ -983,7 +983,7 @@ void FLUID::saveMesh(char *filename)
mCommands.clear();
std::ostringstream save_mesh_low;

-   save_mesh_low <<  "save_mesh_low('" << path << "')";
+   save_mesh_low <<  "save_mesh_low(r'" << path << "')";
mCommands.push_back(save_mesh_low.str());

runPythonString(mCommands);
@@ -996,7 +996,7 @@ void FLUID::saveMeshHigh(char *filename)
mCommands.clear();
std::ostringstream save_mesh_high;

-   save_mesh_high <<  "save_mesh_high('" << path << "')";
+   save_mesh_high <<  "save_mesh_high(r'" << path << "')";
mCommands.push_back(save_mesh_high.str());

runPythonString(mCommands);
@@ -1008,7 +1008,7 @@ void FLUID::saveSmokeData(char *pathname)

mCommands.clear();
std::ostringstream save_smoke_data_low;
-   save_smoke_data_low <<  "save_smoke_data_low('" << path << "')";
+   save_smoke_data_low <<  "save_smoke_data_low(r'" << path << "')";
mCommands.push_back(save_smoke_data_low.str());

runPythonString(mCommands);
@@ -1020,7 +1020,7 @@ void FLUID::saveSmokeDataHigh(char *pathname)

mCommands.clear();
std::ostringstream save_smoke_data_high;
-   save_smoke_data_high <<  "save_smoke_data_high('" << path << "')";
+   save_smoke_data_high <<  "save_smoke_data_high(r'" << path << "')";
mCommands.push_back(save_smoke_data_high.str());

runPythonString(mCommands);
@@ -1032,7 +1032,7 @@ void FLUID::saveLiquidData(char *pathname)

mCommands.clear();
std::ostringstream save_liquid_data_low;
-   save_liquid_data_low <<  "save_liquid_data_low('" << path << "')";
+   save_liquid_data_low <<  "save_liquid_data_low(r'" << path << "')";
mCommands.push_back(save_liquid_data_low.str());

runPythonString(mCommands);
@@ -1044,7 +1044,7 @@ void FLUID::saveLiquidDataHigh(char *pathname)

mCommands.clear();
std::ostringstream save_liquid_data_high;
-   save_liquid_data_high <<  "save_liquid_data_high('" << path << "')";
+   save_liquid_data_high <<  "save_liquid_data_high(r'" << path << "')";
mCommands.push_back(save_liquid_data_high.str());

runPythonString(mCommands);
@@ -1056,7 +1056,7 @@ void FLUID::loadLiquidData(char *pathname)

mCommands.clear();
std::ostringstream load_liquid_data_low;
-   load_liquid_data_low <<  "load_liquid_data_low('" <<  path << "')";
+   load_liquid_data_low <<  "load_liquid_data_low(r'" <<  path << "')";
mCommands.push_back(load_liquid_data_low.str());

runPythonString(mCommands);
@@ -1068,7 +1068,7 @@ void FLUID::loadLiquidDataHigh(char *pathname)

mCommands.clear();
std::ostringstream load_liquid_data_high;
-   load_liquid_data_high <<  "load_liquid_data_high('" <<  path << "')";
+   load_liquid_data_high <<  "load_liquid_data_high(r'" <<  path << "')";
mCommands.push_back(load_liquid_data_high.str());

runPythonString(mCommands);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [7a0377e] blender2.8: OpenGL: draw lamp objects with new imm mode

2016-10-20 Thread Mike Erwin
Commit: 7a0377e22ba8e5d3a79e76699b00743e0eca757e
Author: Mike Erwin
Date:   Thu Oct 20 14:48:31 2016 -0400
Branches: blender2.8
https://developer.blender.org/rB7a0377e22ba8e5d3a79e76699b00743e0eca757e

OpenGL: draw lamp objects with new imm mode

Part of T49043. Also uses new matrix API (T49450)

===

D   source/blender/editors/space_file/CMakeLists.txt
D   source/blender/editors/space_file/file_draw.c
D   source/blender/editors/space_file/file_intern.h
D   source/blender/editors/space_file/file_ops.c
D   source/blender/editors/space_file/file_panels.c
D   source/blender/editors/space_file/file_utils.c
D   source/blender/editors/space_file/filelist.c
D   source/blender/editors/space_file/filelist.h
D   source/blender/editors/space_file/filesel.c
D   source/blender/editors/space_file/fsmenu.c
D   source/blender/editors/space_file/fsmenu.h
D   source/blender/editors/space_file/space_file.c
D   source/blender/editors/space_graph/CMakeLists.txt
D   source/blender/editors/space_graph/graph_buttons.c
D   source/blender/editors/space_graph/graph_draw.c
D   source/blender/editors/space_graph/graph_edit.c
D   source/blender/editors/space_graph/graph_intern.h
D   source/blender/editors/space_graph/graph_ops.c
D   source/blender/editors/space_graph/graph_select.c
D   source/blender/editors/space_graph/graph_utils.c
D   source/blender/editors/space_graph/space_graph.c
D   source/blender/editors/space_image/CMakeLists.txt
D   source/blender/editors/space_image/image_buttons.c
D   source/blender/editors/space_image/image_draw.c
D   source/blender/editors/space_image/image_edit.c
D   source/blender/editors/space_image/image_intern.h
D   source/blender/editors/space_image/image_ops.c
D   source/blender/editors/space_image/space_image.c
D   source/blender/editors/space_info/CMakeLists.txt
D   source/blender/editors/space_info/info_draw.c
D   source/blender/editors/space_info/info_intern.h
D   source/blender/editors/space_info/info_ops.c
D   source/blender/editors/space_info/info_report.c
D   source/blender/editors/space_info/info_stats.c
D   source/blender/editors/space_info/space_info.c
D   source/blender/editors/space_info/textview.c
D   source/blender/editors/space_info/textview.h
D   source/blender/editors/space_logic/CMakeLists.txt
D   source/blender/editors/space_logic/logic_buttons.c
D   source/blender/editors/space_logic/logic_intern.h
D   source/blender/editors/space_logic/logic_ops.c
D   source/blender/editors/space_logic/logic_window.c
D   source/blender/editors/space_logic/space_logic.c
D   source/blender/editors/space_nla/CMakeLists.txt
D   source/blender/editors/space_nla/nla_buttons.c
D   source/blender/editors/space_nla/nla_channels.c
D   source/blender/editors/space_nla/nla_draw.c
D   source/blender/editors/space_nla/nla_edit.c
D   source/blender/editors/space_nla/nla_intern.h
D   source/blender/editors/space_nla/nla_ops.c
D   source/blender/editors/space_nla/nla_select.c
D   source/blender/editors/space_nla/space_nla.c
D   source/blender/editors/space_node/CMakeLists.txt
D   source/blender/editors/space_node/drawnode.c
D   source/blender/editors/space_node/node_add.c
D   source/blender/editors/space_node/node_buttons.c
D   source/blender/editors/space_node/node_draw.c
D   source/blender/editors/space_node/node_edit.c
D   source/blender/editors/space_node/node_group.c
D   source/blender/editors/space_node/node_intern.h
D   source/blender/editors/space_node/node_ops.c
D   source/blender/editors/space_node/node_relationships.c
D   source/blender/editors/space_node/node_select.c
D   source/blender/editors/space_node/node_templates.c
D   source/blender/editors/space_node/node_toolbar.c
D   source/blender/editors/space_node/node_view.c
D   source/blender/editors/space_node/space_node.c
D   source/blender/editors/space_outliner/CMakeLists.txt
D   source/blender/editors/space_outliner/outliner_draw.c
D   source/blender/editors/space_outliner/outliner_edit.c
D   source/blender/editors/space_outliner/outliner_intern.h
D   source/blender/editors/space_outliner/outliner_ops.c
D   source/blender/editors/space_outliner/outliner_select.c
D   source/blender/editors/space_outliner/outliner_tools.c
D   source/blender/editors/space_outliner/outliner_tree.c
D   source/blender/editors/space_outliner/space_outliner.c
D   source/blender/editors/space_script/CMakeLists.txt
D   source/blender/editors/space_script/script_edit.c
D   source/blender/editors/space_script/script_intern.h
D   source/blender/editors/space_script/script_ops.c
D   source/blender/editors/space_script/space_script.c
D   source/blender/editors/space_sequencer/CMakeLists.txt

[Bf-blender-cvs] [a92d20a] blender2.8: OpenGL: dirty bit for GPU matrix API

2016-10-20 Thread Mike Erwin
Commit: a92d20a0a467ece2680d8bb7600a37be470fce66
Author: Mike Erwin
Date:   Thu Oct 20 14:17:54 2016 -0400
Branches: blender2.8
https://developer.blender.org/rBa92d20a0a467ece2680d8bb7600a37be470fce66

OpenGL: dirty bit for GPU matrix API

Have matrices changed since the most recent bind?

Part of T49450

===

M   source/blender/gpu/GPU_matrix.h
M   source/blender/gpu/intern/gpu_matrix.c

===

diff --git a/source/blender/gpu/GPU_matrix.h b/source/blender/gpu/GPU_matrix.h
index 3c3acc0..f311849 100644
--- a/source/blender/gpu/GPU_matrix.h
+++ b/source/blender/gpu/GPU_matrix.h
@@ -135,6 +135,7 @@ void gpuMatrixBegin3D_legacy(void);
 
 /* set uniform values for currently bound shader */
 void gpuBindMatrices(GLuint program);
+bool gpuMatricesDirty(void); /* since last bind */
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/gpu/intern/gpu_matrix.c 
b/source/blender/gpu/intern/gpu_matrix.c
index 9abce9d..f55f9f0 100644
--- a/source/blender/gpu/intern/gpu_matrix.c
+++ b/source/blender/gpu/intern/gpu_matrix.c
@@ -52,7 +52,9 @@ typedef struct {
 
MatrixMode mode;
unsigned top; /* of current stack (would have to replicate if 
gpuResume2D/3D are implemented) */
-   
+
+   bool dirty;
+
/* TODO: cache of derived matrices (Normal, MVP, inverse MVP, etc)
 * generate as needed for shaders, invalidate when original matrices 
change
 *
@@ -95,6 +97,7 @@ void gpuMatrixBegin3D_legacy()
/* copy top matrix from each legacy stack into new fresh stack */
state.mode = MATRIX_MODE_3D;
state.top = 0;
+   state.dirty = true;
glGetFloatv(GL_MODELVIEW_MATRIX, (float*)ModelView3D);
glGetFloatv(GL_PROJECTION_MATRIX, (float*)Projection3D);
 }
@@ -146,6 +149,7 @@ void gpuPopMatrix()
BLI_assert(state.mode != MATRIX_MODE_INACTIVE);
BLI_assert(state.top > 0);
state.top--;
+   state.dirty = true;
 }
 
 void gpuLoadMatrix3D(const float m[4][4])
@@ -153,6 +157,7 @@ void gpuLoadMatrix3D(const float m[4][4])
BLI_assert(state.mode == MATRIX_MODE_3D);
copy_m4_m4(ModelView3D, m);
CHECKMAT(ModelView3D);
+   state.dirty = true;
 }
 
 void gpuLoadMatrix2D(const float m[3][3])
@@ -160,6 +165,7 @@ void gpuLoadMatrix2D(const float m[3][3])
BLI_assert(state.mode == MATRIX_MODE_2D);
copy_m3_m3(ModelView2D, m);
CHECKMAT(ModelView2D);
+   state.dirty = true;
 }
 
 void gpuLoadIdentity()
@@ -174,6 +180,7 @@ void gpuLoadIdentity()
default:
BLI_assert(false);
}
+   state.dirty = true;
 }
 
 void gpuTranslate2f(float x, float y)
@@ -192,8 +199,8 @@ void gpuTranslate2fv(const float vec[2])
 
 void gpuTranslate3f(float x, float y, float z)
 {
-#if 1
BLI_assert(state.mode == MATRIX_MODE_3D);
+#if 1
translate_m4(ModelView3D, x, y, z);
CHECKMAT(ModelView3D);
 #else /* above works well in early testing, below is generic version */
@@ -204,6 +211,7 @@ void gpuTranslate3f(float x, float y, float z)
m[3][2] = z;
gpuMultMatrix3D(m);
 #endif
+   state.dirty = true;
 }
 
 void gpuTranslate3fv(const float vec[3])
@@ -275,6 +283,7 @@ void gpuMultMatrix3D(const float m[4][4])
BLI_assert(state.mode == MATRIX_MODE_3D);
mul_m4_m4_pre(ModelView3D, m);
CHECKMAT(ModelView3D);
+   state.dirty = true;
 }
 
 void gpuMultMatrix2D(const float m[3][3])
@@ -282,6 +291,7 @@ void gpuMultMatrix2D(const float m[3][3])
BLI_assert(state.mode == MATRIX_MODE_2D);
mul_m3_m3_pre(ModelView2D, m);
CHECKMAT(ModelView2D);
+   state.dirty = true;
 }
 
 void gpuRotate3fv(float deg, const float axis[3])
@@ -293,10 +303,11 @@ void gpuRotate3fv(float deg, const float axis[3])
 
 void gpuRotateAxis(float deg, char axis)
 {
-#if 1 /* rotate_m4 works in place, right? */
BLI_assert(state.mode == MATRIX_MODE_3D);
+#if 1 /* rotate_m4 works in place, right? */
rotate_m4(ModelView3D, axis, DEG2RADF(deg));
CHECKMAT(ModelView3D);
+   state.dirty = true;
 #else /* rotate_m4 creates a new matrix */
Mat4 m;
rotate_m4(m, axis, DEG2RADF(deg));
@@ -325,6 +336,8 @@ static void mat4_ortho_set(float m[4][4], float left, float 
right, float bottom,
m[1][3] = 0.0f;
m[2][3] = 0.0f;
m[3][3] = 1.0f;
+
+   state.dirty = true;
 }
 
 static void mat4_frustum_set(float m[][4], float left, float right, float 
bottom, float top, float near, float far)
@@ -348,6 +361,8 @@ static void mat4_frustum_set(float m[][4], float left, 
float right, float bottom
m[1][3] = 0.0f;
m[2][3] = -1.0f;
m[3][3] = 0.0f;
+
+   state.dirty = true;
 }
 
 static void mat4_look_from_origin(float m[4][4], float lookdir[3], float 
camup[3])
@@ -412,6 +427,8 @@ static void mat4_look_from_origin(float 

[Bf-blender-cvs] [4ea6917] blender2.8: OpenGL: box & circle outline functions that work with 3D position (z=0)

2016-10-20 Thread Mike Erwin
Commit: 4ea6917468ec82c966a2f67db0b0b6f375d8d9d4
Author: Mike Erwin
Date:   Thu Oct 20 14:33:32 2016 -0400
Branches: blender2.8
https://developer.blender.org/rB4ea6917468ec82c966a2f67db0b0b6f375d8d9d4

OpenGL: box & circle outline functions that work with 3D position (z=0)

New immediate mode API is strict about attribute formats. These new functions 
make existing code easier to port.

Supports T49043

===

M   source/blender/editors/include/BIF_glutil.h
M   source/blender/editors/screen/glutil.c

===

diff --git a/source/blender/editors/include/BIF_glutil.h 
b/source/blender/editors/include/BIF_glutil.h
index 30718cc..7045340 100644
--- a/source/blender/editors/include/BIF_glutil.h
+++ b/source/blender/editors/include/BIF_glutil.h
@@ -92,6 +92,9 @@ void glutil_draw_filled_arc(float start, float angle, float 
radius, int nsegment
  */
 void imm_draw_lined_circle(unsigned pos, float x, float y, float radius, int 
nsegments);
 
+/* use this version when VertexFormat has a vec3 position */
+void imm_draw_lined_circle_3D(unsigned pos, float x, float y, float radius, 
int nsegments);
+
 /**
  * Draw a filled circle with the given \a radius.
  * The circle is centered at \a x, \a y and drawn in the XY plane.
@@ -115,6 +118,9 @@ void imm_draw_filled_circle(unsigned pos, float x, float y, 
float radius, int ns
 */
 void imm_draw_line_box(unsigned pos, float x1, float y1, float x2, float y2);
 
+/* use this version when VertexFormat has a vec3 position */
+void imm_draw_line_box_3D(unsigned pos, float x1, float y1, float x2, float 
y2);
+
 /**
 * Pack color into 3 bytes
 *
diff --git a/source/blender/editors/screen/glutil.c 
b/source/blender/editors/screen/glutil.c
index a7e8c21..b64152b 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -203,6 +203,17 @@ void imm_draw_filled_circle(unsigned pos, float x, float 
y, float rad, int nsegm
imm_draw_circle(GL_TRIANGLE_FAN, pos, x, y, rad, nsegments);
 }
 
+void imm_draw_lined_circle_3D(unsigned pos, float x, float y, float rad, int 
nsegments)
+{
+   immBegin(GL_LINE_LOOP, nsegments);
+   for (int i = 0; i < nsegments; ++i) {
+   float angle = 2 * M_PI * ((float)i / (float)nsegments);
+   immVertex3f(pos, x + rad * cosf(angle),
+y + rad * sinf(angle), 0.0f);
+   }
+   immEnd();
+}
+
 void imm_draw_line_box(unsigned pos, float x1, float y1, float x2, float y2)
 {
immBegin(GL_LINE_LOOP, 4);
@@ -213,6 +224,17 @@ void imm_draw_line_box(unsigned pos, float x1, float y1, 
float x2, float y2)
immEnd();
 }
 
+void imm_draw_line_box_3D(unsigned pos, float x1, float y1, float x2, float y2)
+{
+   /* use this version when VertexFormat has a vec3 position */
+   immBegin(GL_LINE_LOOP, 4);
+   immVertex3f(pos, x1, y1, 0.0f);
+   immVertex3f(pos, x1, y2, 0.0f);
+   immVertex3f(pos, x2, y2, 0.0f);
+   immVertex3f(pos, x2, y1, 0.0f);
+   immEnd();
+}
+
 void imm_cpack(unsigned int x)
 {
immUniformColor3ub(((x)& 0xFF),

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [c6abbb4] blender2.8: Gawain: closer integration of immediate mode & matrix APIs

2016-10-20 Thread Mike Erwin
Commit: c6abbb40ad8e62a74c992ca02b8bc85171b6af8e
Author: Mike Erwin
Date:   Thu Oct 20 14:29:59 2016 -0400
Branches: blender2.8
https://developer.blender.org/rBc6abbb40ad8e62a74c992ca02b8bc85171b6af8e

Gawain: closer integration of immediate mode & matrix APIs

- any shader program can use matrix state (not only built-in shaders)
- you can mix matrix & begin/end calls, and the bound shader will use the 
latest matrix state

Part of T49450 & T49043

===

M   source/blender/gpu/gawain/immediate.c
M   source/blender/gpu/intern/gpu_immediate.c

===

diff --git a/source/blender/gpu/gawain/immediate.c 
b/source/blender/gpu/gawain/immediate.c
index 30c82fd..7c3edc2 100644
--- a/source/blender/gpu/gawain/immediate.c
+++ b/source/blender/gpu/gawain/immediate.c
@@ -13,6 +13,10 @@
 #include "attrib_binding.h"
 #include 
 
+// necessary functions from matrix API
+extern void gpuBindMatrices(GLuint program);
+extern bool gpuMatricesDirty(void);
+
 typedef struct {
// TODO: organize this struct by frequency of change (run-time)
 
@@ -116,6 +120,7 @@ void immBindProgram(GLuint program)
{
 #if TRUST_NO_ONE
assert(imm.bound_program == 0);
+   assert(glIsProgram(program));
 #endif
 
if (!imm.vertex_format.packed)
@@ -124,6 +129,8 @@ void immBindProgram(GLuint program)
glUseProgram(program);
get_attrib_locations(_format, _binding, program);
imm.bound_program = program;
+
+   gpuBindMatrices(program);
}
 
 void immUnbindProgram()
@@ -326,6 +333,9 @@ static void immDrawSetup(void)
glVertexAttribIPointer(loc, a->comp_ct, 
a->comp_type, stride, pointer);
}
}
+
+   if (gpuMatricesDirty())
+   gpuBindMatrices(imm.bound_program);
}
 
 void immEnd()
diff --git a/source/blender/gpu/intern/gpu_immediate.c 
b/source/blender/gpu/intern/gpu_immediate.c
index 711afda..0706c74 100644
--- a/source/blender/gpu/intern/gpu_immediate.c
+++ b/source/blender/gpu/intern/gpu_immediate.c
@@ -35,7 +35,6 @@ void immBindBuiltinProgram(GPUBuiltinShader shader_id)
 {
GPUShader *shader = GPU_shader_get_builtin_shader(shader_id);
immBindProgram(shader->program);
-   gpuBindMatrices(shader->program);
 }
 
 void immUniformThemeColor(int color_id)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0c4d949] master: Alembic: only export custom data (UVs, VCols) once, on the first frame.

2016-10-20 Thread Kévin Dietrich
Commit: 0c4d949effa88f2ad54297a865fb2763f61c61aa
Author: Kévin Dietrich
Date:   Thu Oct 20 19:43:22 2016 +0200
Branches: master
https://developer.blender.org/rB0c4d949effa88f2ad54297a865fb2763f61c61aa

Alembic: only export custom data (UVs, VCols) once, on the first frame.

This would cause Alembic to throw an exception and fail exporting
animations because it was trying to recreate and overwrite the
attributes for each frame.

===

M   source/blender/alembic/intern/abc_mesh.cc

===

diff --git a/source/blender/alembic/intern/abc_mesh.cc 
b/source/blender/alembic/intern/abc_mesh.cc
index 84b89d9..bb5d5ce 100644
--- a/source/blender/alembic/intern/abc_mesh.cc
+++ b/source/blender/alembic/intern/abc_mesh.cc
@@ -401,7 +401,7 @@ void AbcMeshWriter::writeMesh(DerivedMesh *dm)
Int32ArraySample(loop_counts));
 
UVSample sample;
-   if (m_settings.export_uvs) {
+   if (m_first_frame && m_settings.export_uvs) {
const char *name = get_uv_sample(sample, m_custom_data_config, 
>loopData);
 
if (!sample.indices.empty() && !sample.uvs.empty()) {
@@ -470,7 +470,7 @@ void AbcMeshWriter::writeSubD(DerivedMesh *dm)
  Int32ArraySample(loop_counts));
 
UVSample sample;
-   if (m_settings.export_uvs) {
+   if (m_first_frame && m_settings.export_uvs) {
const char *name = get_uv_sample(sample, m_custom_data_config, 
>loopData);
 
if (!sample.indices.empty() && !sample.uvs.empty()) {
@@ -565,7 +565,7 @@ void AbcMeshWriter::writeArbGeoParams(DerivedMesh *dm)
return;
}
 
-   if (m_settings.export_vcols) {
+   if (m_first_frame && m_settings.export_vcols) {
if (m_subdiv_schema.valid()) {
write_custom_data(m_subdiv_schema.getArbGeomParams(), 
m_custom_data_config, >loopData, CD_MLOOPCOL);
}

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [338e000] fluid-mantaflow: better inflow map generation

2016-10-20 Thread Sebastián Barschkis
Commit: 338e0006a139cf24c9e156c62ef32efa65440d54
Author: Sebastián Barschkis
Date:   Mon Oct 17 21:02:35 2016 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB338e0006a139cf24c9e156c62ef32efa65440d54

better inflow map generation

===

M   source/blender/blenkernel/intern/smoke.c

===

diff --git a/source/blender/blenkernel/intern/smoke.c 
b/source/blender/blenkernel/intern/smoke.c
index aedae4a..5c96469 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -1614,7 +1614,11 @@ static void update_mesh_distances(int index, float 
*inflow_map, BVHTreeFromMesh
float ray_dirs[6][3] = {{1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, 
0.0f, 1.0f},
{-1.0f, 0.0f, 0.0f}, 
{0.0f, -1.0f, 0.0f}, {0.0f, 0.0f, -1.0f}};
size_t ray_cnt = sizeof ray_dirs / sizeof ray_dirs[0];
-   inflow_map[index] = 1.0f; // Init inflow map to one, undetermined 
otherwise which is not good ...
+   
+   /* Initialize inflow map. Any following initialization leaves points 
inside mesh ( < 0.0f) unaffected */
+   if (inflow_map[index] >= 0.0f) {
+   inflow_map[index] = 0.5f;
+   }
 
for (i = 0; i < ray_cnt; i++) {
BVHTreeRayHit hit_tree = {0};
@@ -1640,9 +1644,10 @@ static void update_mesh_distances(int index, float 
*inflow_map, BVHTreeFromMesh
min_dist_combined = MIN2(min_dist_pos, min_dist_neg);
min_dist_combined_normalized = min_dist_combined; // / cell_size[0]; // 
TODO (sebbas): normalization results in too big values

-   /* If distance is still undetermined (=) use default manta value 
(=0.5) instead (outside emission map value is also 0.5)
-* Otherwise use computed distance. inflow_map is either 1.0 or -1.0. 
Multiplied with dist_comb we have mesh dist from out- and inside */
-   inflow_map[index] *= (min_dist_combined == ) ? 0.5f : 
min_dist_combined_normalized;
+   /* Multiply actual distances to those points inside mesh (those points 
in inflow map with value -1)*/
+   if (min_dist_combined != ) {
+   inflow_map[index] *= min_dist_combined_normalized;
+   }
 }
 
 static void sample_derivedmesh(

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [5db51d2] fluid-mantaflow: updated manta files with linker fixes

2016-10-20 Thread Sebastián Barschkis
Commit: 5db51d21197a4499fbca07819b49daa415e0ccb2
Author: Sebastián Barschkis
Date:   Thu Oct 20 17:44:01 2016 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB5db51d21197a4499fbca07819b49daa415e0ccb2

updated manta files with linker fixes

===

M   intern/mantaflow/CMakeLists.txt
M   intern/mantaflow/intern/manta_pp/commonkernels.h
M   intern/mantaflow/intern/manta_pp/commonkernels.h.reg.cpp
M   intern/mantaflow/intern/manta_pp/conjugategrad.cpp
M   intern/mantaflow/intern/manta_pp/conjugategrad.h
M   intern/mantaflow/intern/manta_pp/conjugategrad.h.reg.cpp
M   intern/mantaflow/intern/manta_pp/edgecollapse.cpp
M   intern/mantaflow/intern/manta_pp/edgecollapse.h
M   intern/mantaflow/intern/manta_pp/edgecollapse.h.reg.cpp
M   intern/mantaflow/intern/manta_pp/fastmarch.cpp
M   intern/mantaflow/intern/manta_pp/fastmarch.h
M   intern/mantaflow/intern/manta_pp/fastmarch.h.reg.cpp
M   intern/mantaflow/intern/manta_pp/fileio.cpp
M   intern/mantaflow/intern/manta_pp/fileio.h
M   intern/mantaflow/intern/manta_pp/fileio.h.reg.cpp
M   intern/mantaflow/intern/manta_pp/fluidsolver.cpp
M   intern/mantaflow/intern/manta_pp/fluidsolver.h
M   intern/mantaflow/intern/manta_pp/fluidsolver.h.reg.cpp
M   intern/mantaflow/intern/manta_pp/general.cpp
M   intern/mantaflow/intern/manta_pp/general.h
M   intern/mantaflow/intern/manta_pp/general.h.reg.cpp
M   intern/mantaflow/intern/manta_pp/gitinfo.h
M   intern/mantaflow/intern/manta_pp/grid.cpp
M   intern/mantaflow/intern/manta_pp/grid.h
M   intern/mantaflow/intern/manta_pp/grid.h.reg
M   intern/mantaflow/intern/manta_pp/grid.h.reg.cpp
M   intern/mantaflow/intern/manta_pp/grid4d.cpp
M   intern/mantaflow/intern/manta_pp/grid4d.h
M   intern/mantaflow/intern/manta_pp/grid4d.h.reg.cpp
M   intern/mantaflow/intern/manta_pp/kernel.cpp
M   intern/mantaflow/intern/manta_pp/kernel.h
M   intern/mantaflow/intern/manta_pp/kernel.h.reg.cpp
M   intern/mantaflow/intern/manta_pp/levelset.cpp
M   intern/mantaflow/intern/manta_pp/levelset.h
M   intern/mantaflow/intern/manta_pp/levelset.h.reg.cpp
M   intern/mantaflow/intern/manta_pp/mesh.cpp
M   intern/mantaflow/intern/manta_pp/mesh.h
M   intern/mantaflow/intern/manta_pp/mesh.h.reg.cpp
M   intern/mantaflow/intern/manta_pp/movingobs.cpp
M   intern/mantaflow/intern/manta_pp/movingobs.h
M   intern/mantaflow/intern/manta_pp/movingobs.h.reg.cpp
M   intern/mantaflow/intern/manta_pp/noisefield.cpp
M   intern/mantaflow/intern/manta_pp/noisefield.h
M   intern/mantaflow/intern/manta_pp/noisefield.h.reg.cpp
M   intern/mantaflow/intern/manta_pp/particle.cpp
M   intern/mantaflow/intern/manta_pp/particle.h
M   intern/mantaflow/intern/manta_pp/particle.h.reg.cpp
M   intern/mantaflow/intern/manta_pp/plugin/advection.cpp
M   intern/mantaflow/intern/manta_pp/plugin/extforces.cpp
M   intern/mantaflow/intern/manta_pp/plugin/fire.cpp
M   intern/mantaflow/intern/manta_pp/plugin/flip.cpp
M   intern/mantaflow/intern/manta_pp/plugin/initplugins.cpp
M   intern/mantaflow/intern/manta_pp/plugin/kepsilon.cpp
M   intern/mantaflow/intern/manta_pp/plugin/meshplugins.cpp
M   intern/mantaflow/intern/manta_pp/plugin/pressure.cpp
M   intern/mantaflow/intern/manta_pp/plugin/surfaceturbulence.cpp
M   intern/mantaflow/intern/manta_pp/plugin/vortexplugins.cpp
M   intern/mantaflow/intern/manta_pp/plugin/waveletturbulence.cpp
M   intern/mantaflow/intern/manta_pp/plugin/waves.cpp
M   intern/mantaflow/intern/manta_pp/pwrapper/pclass.cpp
M   intern/mantaflow/intern/manta_pp/pwrapper/pclass.h
M   intern/mantaflow/intern/manta_pp/pwrapper/pythonInclude.h
M   intern/mantaflow/intern/manta_pp/pwrapper/registry.cpp
M   intern/mantaflow/intern/manta_pp/pwrapper/registry.h
M   intern/mantaflow/intern/manta_pp/python/defines.py.reg
M   intern/mantaflow/intern/manta_pp/python/defines.py.reg.cpp
A   intern/mantaflow/intern/manta_pp/registration.cpp
M   intern/mantaflow/intern/manta_pp/shapes.cpp
M   intern/mantaflow/intern/manta_pp/shapes.h
M   intern/mantaflow/intern/manta_pp/shapes.h.reg.cpp
M   intern/mantaflow/intern/manta_pp/test.cpp
M   intern/mantaflow/intern/manta_pp/timing.cpp
M   intern/mantaflow/intern/manta_pp/timing.h
M   intern/mantaflow/intern/manta_pp/timing.h.reg.cpp
M   intern/mantaflow/intern/manta_pp/turbulencepart.cpp
M   intern/mantaflow/intern/manta_pp/turbulencepart.h
M   intern/mantaflow/intern/manta_pp/turbulencepart.h.reg.cpp
M   intern/mantaflow/intern/manta_pp/vortexpart.cpp
M   intern/mantaflow/intern/manta_pp/vortexpart.h
M   intern/mantaflow/intern/manta_pp/vortexpart.h.reg.cpp
M   intern/mantaflow/intern/manta_pp/vortexsheet.cpp
M   

[Bf-blender-cvs] [8ef9cff] fluid-mantaflow: adapted draw routine to handle liquid domains better

2016-10-20 Thread Sebastián Barschkis
Commit: 8ef9cff3a14653b4dc98ad9960570ec0cfb96ca9
Author: Sebastián Barschkis
Date:   Wed Oct 12 10:41:44 2016 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB8ef9cff3a14653b4dc98ad9960570ec0cfb96ca9

adapted draw routine to handle liquid domains better

===

M   source/blender/editors/space_view3d/drawobject.c

===

diff --git a/source/blender/editors/space_view3d/drawobject.c 
b/source/blender/editors/space_view3d/drawobject.c
index 0b06ea4..e3aaeef 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -7846,7 +7846,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, 
Base *base, const short
}
 
/* draw code for smoke, only draw domains */
-   if (smd && smd->domain && (smd->domain->type == 
MOD_SMOKE_DOMAIN_TYPE_GAS)) {
+   if (smd && smd->domain) {
SmokeDomainSettings *sds = smd->domain;
float viewnormal[3];
 
@@ -7898,20 +7898,22 @@ void draw_object(Scene *scene, ARegion *ar, View3D 
*v3d, Base *base, const short
p1[1] = (sds->p0[1] + sds->cell_size[1] * 
sds->res_max[1] + sds->obj_shift_f[1]) * fabsf(ob->size[1]);
p1[2] = (sds->p0[2] + sds->cell_size[2] * 
sds->res_max[2] + sds->obj_shift_f[2]) * fabsf(ob->size[2]);

-   if (sds->fluid && sds->viewport_display_mode == 
SM_VIEWPORT_GEOMETRY) {
-   // Nothing to do here
-   }
-   else if (!(sds->fluid && sds->flags & 
MOD_SMOKE_HIGHRES) || sds->viewport_display_mode == SM_VIEWPORT_PREVIEW) {
-   sds->tex = NULL;
-   GPU_create_smoke(smd, 0);
-   draw_smoke_volume(sds, ob, p0, p1, viewnormal);
-   GPU_free_smoke(smd);
-   }
-   else if (sds->fluid && sds->flags & MOD_SMOKE_HIGHRES 
&& sds->viewport_display_mode == SM_VIEWPORT_FINAL) {
-   sds->tex = NULL;
-   GPU_create_smoke(smd, 1);
-   draw_smoke_volume(sds, ob, p0, p1, viewnormal);
-   GPU_free_smoke(smd);
+   if (smd->domain->type == MOD_SMOKE_DOMAIN_TYPE_GAS) {
+   if (sds->fluid && sds->viewport_display_mode == 
SM_VIEWPORT_GEOMETRY) {
+   // Nothing to do here
+   }
+   else if (!(sds->fluid && sds->flags & 
MOD_SMOKE_HIGHRES) || sds->viewport_display_mode == SM_VIEWPORT_PREVIEW) {
+   sds->tex = NULL;
+   GPU_create_smoke(smd, 0);
+   draw_smoke_volume(sds, ob, p0, p1, 
viewnormal);
+   GPU_free_smoke(smd);
+   }
+   else if (sds->fluid && sds->flags & 
MOD_SMOKE_HIGHRES && sds->viewport_display_mode == SM_VIEWPORT_FINAL) {
+   sds->tex = NULL;
+   GPU_create_smoke(smd, 1);
+   draw_smoke_volume(sds, ob, p0, p1, 
viewnormal);
+   GPU_free_smoke(smd);
+   }
}
 
/* smoke debug render */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [92d1ebc] fluid-mantaflow: fix for CMakeLists

2016-10-20 Thread Sebastián Barschkis
Commit: 92d1ebc7d21cd3675e7283c9dca9ef758df02b16
Author: Sebastián Barschkis
Date:   Mon Oct 10 22:39:12 2016 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB92d1ebc7d21cd3675e7283c9dca9ef758df02b16

fix for CMakeLists

===

M   CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fbf256e..a51c69b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -610,7 +610,7 @@ if(APPLE)
 
if(${XCODE_VERSION} VERSION_LESS 4.3)
# use guaranteed existing sdk
-   set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.10.sdk CACHE 
PATH "" FORCE)
+   set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX${OSX_SYSTEM}.sdk 
CACHE PATH "" FORCE)
else()
# note: xcode-select path could be ambigous,
# cause /Applications/Xcode.app/Contents/Developer or 
/Applications/Xcode.app would be allowed
@@ -630,9 +630,21 @@ if(APPLE)
set(CMAKE_FIND_ROOT_PATH ${CMAKE_OSX_SYSROOT})
endif()
 
-   if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
-   # 10.6 is our min. target, if you use higher sdk, weak linking 
happens
-   set(CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE STRING "" FORCE)
+   if(WITH_CXX11)
+   # 10.9 is our min. target, if you use higher sdk, weak linking 
happens
+   if(CMAKE_OSX_DEPLOYMENT_TARGET)
+   if(${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS 10.9)
+   message(STATUS "Setting deployment target to 
10.9, lower versions are incompatible with WITH_CXX11")
+   set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE 
STRING "" FORCE)
+   endif()
+   else()
+   set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "" 
FORCE)
+   endif()
+   else()
+   if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
+   # 10.6 is our min. target, if you use higher sdk, weak 
linking happens
+   set(CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE STRING "" 
FORCE)
+   endif()
endif()

if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode")

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [079ac5b] cycles_split_kernel: Cycles: Begin moving split kernel logic into own class

2016-10-20 Thread Mai Lavelle
Commit: 079ac5b2b93c955c15d882087f4c037c3c7ab532
Author: Mai Lavelle
Date:   Thu Oct 20 17:17:51 2016 +0200
Branches: cycles_split_kernel
https://developer.blender.org/rB079ac5b2b93c955c15d882087f4c037c3c7ab532

Cycles: Begin moving split kernel logic into own class

The new class `DeviceSplitKernel` will handle all logic for enqueueing of
kernels and memory memory management for the split kernel. Devices that
support the split kernel will create an instance of this class and call
its methods to run the split kernel.

There's still some work to do yet to make this device independent and to
deal with tile splitting.

===

M   intern/cycles/device/CMakeLists.txt
M   intern/cycles/device/device.h
A   intern/cycles/device/device_split_kernel.cpp
A   intern/cycles/device/device_split_kernel.h
M   intern/cycles/device/opencl/opencl.h
M   intern/cycles/device/opencl/opencl_split.cpp

===

diff --git a/intern/cycles/device/CMakeLists.txt 
b/intern/cycles/device/CMakeLists.txt
index 5c25434..a237345 100644
--- a/intern/cycles/device/CMakeLists.txt
+++ b/intern/cycles/device/CMakeLists.txt
@@ -34,6 +34,7 @@ set(SRC
device_cuda.cpp
device_multi.cpp
device_opencl.cpp
+   device_split_kernel.cpp
device_task.cpp
 )
 
@@ -57,6 +58,7 @@ set(SRC_HEADERS
device_memory.h
device_intern.h
device_network.h
+   device_split_kernel.h
device_task.h
 )
 
diff --git a/intern/cycles/device/device.h b/intern/cycles/device/device.h
index 31dbb90..7857e5f 100644
--- a/intern/cycles/device/device.h
+++ b/intern/cycles/device/device.h
@@ -305,21 +305,25 @@ public:
device_memory& 
/*split_data*/,
device_memory& 
/*ray_state*/,
device_memory& 
/*queue_index*/,
-   device_memory& 
/*use_queues_flag*/
-#ifdef __WORK_STEALING__
-   , device_memory& 
/*work_pool_wgs*/
-#endif
-   )
+   device_memory& 
/*use_queues_flag*/,
+   device_memory& 
/*work_pool_wgs*/)
{
assert(!"not implemented for this device");
return false;
}
+
virtual SplitKernelFunction* get_split_kernel_function(string 
/*kernel_name*/, const DeviceRequestedFeatures&)
{
assert(!"not implemented for this device");
return NULL;
}
 
+   virtual size_t sizeof_KernelGlobals()
+   {
+   assert(!"not implemented for this device");
+   return 0;
+   }
+
/* tasks */
virtual int get_split_task_count(DeviceTask& task) = 0;
virtual void task_add(DeviceTask& task) = 0;
diff --git a/intern/cycles/device/device_split_kernel.cpp 
b/intern/cycles/device/device_split_kernel.cpp
new file mode 100644
index 000..0a6ac77
--- /dev/null
+++ b/intern/cycles/device/device_split_kernel.cpp
@@ -0,0 +1,274 @@
+/*
+ * Copyright 2011-2016 Blender Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "device_split_kernel.h"
+
+#include "kernel_types.h"
+#include "kernel_split_data.h"
+
+CCL_NAMESPACE_BEGIN
+
+DeviceSplitKernel::DeviceSplitKernel(Device *device) : device(device)
+{
+   path_iteration_times = PATH_ITER_INC_FACTOR;
+   current_max_closure = -1;
+   first_tile = true;
+}
+
+DeviceSplitKernel::~DeviceSplitKernel()
+{
+   device->mem_free(kgbuffer);
+   device->mem_free(split_data);
+   device->mem_free(ray_state);
+   device->mem_free(use_queues_flag);
+   device->mem_free(queue_index);
+   device->mem_free(work_pool_wgs);
+}
+
+bool DeviceSplitKernel::load_kernels(const DeviceRequestedFeatures& 
requested_features)
+{
+#define LOAD_KERNEL(name) \
+   kernel_##name = device->get_split_kernel_function(#name, 
requested_features); \
+   if(!kernel_##name) { \
+   return false; \
+   }
+
+   LOAD_KERNEL(scene_intersect);
+   LOAD_KERNEL(lamp_emission);
+   LOAD_KERNEL(queue_enqueue);
+   

[Bf-blender-cvs] [26de2b4] transform-manipulators: Get tranform manipulators type toggle to work; increase arrow line-width; cleanup

2016-10-20 Thread Julian Eisel
Commit: 26de2b4f9cda043a6909aa65f318ad01684bc314
Author: Julian Eisel
Date:   Thu Oct 20 16:45:38 2016 +0200
Branches: transform-manipulators
https://developer.blender.org/rB26de2b4f9cda043a6909aa65f318ad01684bc314

Get tranform manipulators type toggle to work; increase arrow line-width; 
cleanup

===

M   source/blender/editors/space_view3d/view3d_transform_manipulators.c

===

diff --git 
a/source/blender/editors/space_view3d/view3d_transform_manipulators.c 
b/source/blender/editors/space_view3d/view3d_transform_manipulators.c
index ece5819..043ced6 100644
--- a/source/blender/editors/space_view3d/view3d_transform_manipulators.c
+++ b/source/blender/editors/space_view3d/view3d_transform_manipulators.c
@@ -80,22 +80,17 @@ enum TransformAxisType {
MAN_AXIS_LAST,
 };
 
-enum TransformType {
-   MAN_AXES_ALL = 0,
-   MAN_AXES_TRANSLATE,
-   MAN_AXES_ROTATE,
-   MAN_AXES_SCALE,
-};
+/* threshold for testing view aligned axis manipulator */
+#define TRANSFORM_MAN_AXIS_DOT_MIN 0.02f
+#define TRANSFORM_MAN_AXIS_DOT_MAX 0.1f
 
-/* threshold for testing view aligned manipulator axis */
-#define TW_AXIS_DOT_MIN 0.02f
-#define TW_AXIS_DOT_MAX 0.1f
+#define TRANSFORM_MAN_AXIS_LINE_WIDTH 2.0f
 
 typedef struct TranformAxisManipulator {
/* -- initialized using static array -- */
 
enum TransformAxisType index;
-   enum TransformType type;
+   int transform_type; /* View3d->twtype */
 
const char *name;
/* op info */
@@ -103,7 +98,7 @@ typedef struct TranformAxisManipulator {
int constraint[3]; /* {x, y, z} */
 
/* appearance */
-   int theme_colorid;
+   int theme_colorid, line_width;
int manipulator_type;
int protectflag; /* the protectflags this axis checks (e.g. 
OB_LOCK_LOCZ) */
 
@@ -130,19 +125,22 @@ typedef struct TransformManipulatorsInfo {
  */
 static TranformAxisManipulator tman_axes[] = {
{
-   MAN_AXIS_TRANS_X, MAN_AXES_TRANSLATE,
+   MAN_AXIS_TRANS_X, V3D_MANIP_TRANSLATE,
"translate_x", "TRANSFORM_OT_translate", {1, 0, 0},
-   TH_AXIS_X, MANIPULATOR_ARROW_STYLE_NORMAL, OB_LOCK_LOCX,
+   TH_AXIS_X, TRANSFORM_MAN_AXIS_LINE_WIDTH,
+   MANIPULATOR_ARROW_STYLE_NORMAL, OB_LOCK_LOCX,
},
{
-   MAN_AXIS_TRANS_Y, MAN_AXES_TRANSLATE,
+   MAN_AXIS_TRANS_Y, V3D_MANIP_TRANSLATE,
"translate_y", "TRANSFORM_OT_translate", {0, 1, 0},
-   TH_AXIS_Y, MANIPULATOR_ARROW_STYLE_NORMAL, OB_LOCK_LOCY,
+   TH_AXIS_Y, TRANSFORM_MAN_AXIS_LINE_WIDTH,
+   MANIPULATOR_ARROW_STYLE_NORMAL, OB_LOCK_LOCY,
},
{
-   MAN_AXIS_TRANS_Z, MAN_AXES_TRANSLATE,
+   MAN_AXIS_TRANS_Z, V3D_MANIP_TRANSLATE,
"translate_z", "TRANSFORM_OT_translate", {0, 0, 1},
-   TH_AXIS_Z, MANIPULATOR_ARROW_STYLE_NORMAL, OB_LOCK_LOCZ,
+   TH_AXIS_Z, TRANSFORM_MAN_AXIS_LINE_WIDTH,
+   MANIPULATOR_ARROW_STYLE_NORMAL, OB_LOCK_LOCZ,
},
{0, 0, NULL}
 };
@@ -164,7 +162,7 @@ static void transform_manipulators_info_free(void 
*customdata)
 /* init callback and helpers */
 
 /**
- * Custom handler for manipulator widgets
+ * Custom handler for transform manipulators to update them while modal 
transform operator runs.
  */
 static int transform_axis_manipulator_handler(
 bContext *C, const wmEvent *UNUSED(event), wmManipulator *widget, 
const int UNUSED(flag))
@@ -196,6 +194,7 @@ static void 
transform_axis_manipulator_init(TranformAxisManipulator *axis, wmMan
 
PointerRNA *ptr = WM_manipulator_set_operator(axis->manipulator, 
axis->op_name);
WM_manipulator_set_custom_handler(axis->manipulator, 
transform_axis_manipulator_handler);
+   WM_manipulator_set_line_width(axis->manipulator, axis->line_width);
 
if (RNA_struct_find_property(ptr, "constraint_axis")) {
RNA_boolean_set_array(ptr, "constraint_axis", axis->constraint);
@@ -225,9 +224,10 @@ static void transform_manipulatorgroup_init(const bContext 
*UNUSED(C), wmManipul
 /*  */
 /* refresh callback and helpers */
 
-static bool transfrom_axis_manipulator_is_visible(TranformAxisManipulator 
*axis, int protectflag)
+static bool transform_axis_manipulator_is_visible(TranformAxisManipulator 
*axis, char transform_type, int protectflag)
 {
-   return ((axis->protectflag & protectflag) != axis->protectflag);
+   return ((axis->transform_type & transform_type) &&
+   ((axis->protectflag & protectflag) != axis->protectflag));
 }
 
 static int transform_manipulators_protectflag_posemode_get(Object *ob, View3D 
*v3d)
@@ -383,7 +383,7 @@ static void 

[Bf-blender-cvs] [32c2cba] master: Fix T49797: Exception from scene update handler might leak external engine descriptors

2016-10-20 Thread Sergey Sharybin
Commit: 32c2cba4ef1c940dab559cdc47b886c60cc9f2e1
Author: Sergey Sharybin
Date:   Thu Oct 20 13:32:52 2016 +0200
Branches: master
https://developer.blender.org/rB32c2cba4ef1c940dab559cdc47b886c60cc9f2e1

Fix T49797: Exception from scene update handler might leak external engine 
descriptors

This was causing memory leaks in Cycles.

Some more detailed information in the comment in the code.

Seems to be safe and nice enough for 2.78a.

===

M   source/blender/python/intern/bpy_app_handlers.c

===

diff --git a/source/blender/python/intern/bpy_app_handlers.c 
b/source/blender/python/intern/bpy_app_handlers.c
index 6a8b0b0..1cc2d6f 100644
--- a/source/blender/python/intern/bpy_app_handlers.c
+++ b/source/blender/python/intern/bpy_app_handlers.c
@@ -317,7 +317,13 @@ void bpy_app_generic_callback(struct Main *UNUSED(main), 
struct ID *id, void *ar
func = PyList_GET_ITEM(cb_list, pos);
ret = PyObject_Call(func, args, NULL);
if (ret == NULL) {
-   PyErr_Print();
+   /* Don't set last system variables because they 
might cause some
+* dangling pointers to external render engines 
(when exception
+* happens during rendering) which will break 
logic of render pipeline
+* which expects to be the only user of render 
engine when rendering
+* is finished.
+*/
+   PyErr_PrintEx(0);
PyErr_Clear();
}
else {

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [243a0e3] cycles_disney_brdf: Switching between OSL and SVM is more consistant now when using Disney BSDF.

2016-10-20 Thread Pascal Schoen
Commit: 243a0e3eb80ef82704d5ea2657384c3a4b9fb497
Author: Pascal Schoen
Date:   Thu Oct 20 10:01:45 2016 +0200
Branches: cycles_disney_brdf
https://developer.blender.org/rB243a0e3eb80ef82704d5ea2657384c3a4b9fb497

Switching between OSL and SVM is more consistant now when using Disney
BSDF.

There were some minor differences in the OSL implementation, e.g. the
refraction roughness was missing.

===

M   intern/cycles/kernel/closure/bsdf_microfacet_multi_impl.h
M   intern/cycles/kernel/shaders/node_disney_bsdf.osl
M   intern/cycles/kernel/svm/svm_closure.h

===

diff --git a/intern/cycles/kernel/closure/bsdf_microfacet_multi_impl.h 
b/intern/cycles/kernel/closure/bsdf_microfacet_multi_impl.h
index 97af724..11f3525 100644
--- a/intern/cycles/kernel/closure/bsdf_microfacet_multi_impl.h
+++ b/intern/cycles/kernel/closure/bsdf_microfacet_multi_impl.h
@@ -276,7 +276,7 @@ ccl_device float3 MF_FUNCTION_FULL_NAME(mf_sample)(float3 
wi, float3 *wo, const
float FH = (fresnel_dielectric_cos(dot(wi, normalize(wi + wr)), 
eta) - F0) * F0_norm; //schlick_fresnel(dot(wi, normalize(wi + wr))); //
throughput2 = cspec0 * (1.0f - FH) + make_float3(1.0f, 1.0f, 
1.0f) * FH;
}
-#else defined(MF_MULTI_GLOSSY)
+#elif defined(MF_MULTI_GLOSSY)
float3 t_color = cspec0;
float3 throughput2 = make_float3(1.0f, 1.0f, 1.0f);
float F0 = fresnel_dielectric_cos(1.0f, eta);
diff --git a/intern/cycles/kernel/shaders/node_disney_bsdf.osl 
b/intern/cycles/kernel/shaders/node_disney_bsdf.osl
index 5372948..ae1addd 100644
--- a/intern/cycles/kernel/shaders/node_disney_bsdf.osl
+++ b/intern/cycles/kernel/shaders/node_disney_bsdf.osl
@@ -18,9 +18,9 @@
 #include "node_fresnel.h"
 
 shader node_disney_bsdf(
-   string distribution = "Multiscatter GGX",
-   color BaseColor = color(0.6427, 0.41514809, 0.01698805),
-   color SubsurfaceColor = color(0.6427, 0.41514809, 0.01698805),
+string distribution = "Multiscatter GGX",
+color BaseColor = color(0.6427, 0.41514809, 0.01698805),
+color SubsurfaceColor = color(0.6427, 0.41514809, 0.01698805),
 float Metallic = 0.0,
 float Subsurface = 0.0,
 float Specular = 0.5,
@@ -33,16 +33,23 @@ shader node_disney_bsdf(
 float ClearcoatGloss = 1.0,
 float IOR = 1.45,
 float Transparency = 0.0,
+float RefractionRoughness = 0.0,
 float AnisotropicRotation = 0.0,
-   normal Normal = N,
-   normal ClearcoatNormal = N,
-   normal Tangent = normalize(dPdu),
-   output closure color BSDF = 0)
+normal Normal = N,
+normal ClearcoatNormal = N,
+normal Tangent = normalize(dPdu),
+output closure color BSDF = 0)
 {
-   float f = max(IOR, 1e-5);
+float f = max(IOR, 1e-5);
 float diffuse_weight = (1.0 - clamp(Metallic, 0.0, 1.0)) * (1.0 - 
clamp(Transparency, 0.0, 1.0));
 float transp = clamp(Transparency, 0.0, 1.0) * (1.0 - clamp(Metallic, 0.0, 
1.0));
 float specular_weight = (1.0 - transp);
+
+vector T = Tangent;
+
+/* rotate tangent */
+if (AnisotropicRotation != 0.0)
+T = rotate(T, AnisotropicRotation * M_2PI, point(0.0, 0.0, 0.0), 
Normal);
 
 if (diffuse_weight > 1e-5) {
 if (Subsurface > 1e-5) {
@@ -51,7 +58,7 @@ shader node_disney_bsdf(
 BSDF = disney_diffuse(Normal, BaseColor, Roughness);
 }
 
-if (Sheen != 0.0) {
+if (Sheen > 1e-5) {
 BSDF = BSDF + disney_sheen(Normal, BaseColor, Sheen, SheenTint);
 }
 
@@ -71,10 +78,10 @@ shader node_disney_bsdf(
 
 color Cspec0 = (Specular * 0.08 * tmp_col) * (1.0 - Metallic) + 
BaseColor * Metallic;
 
-if (distribution == "Multiscatter GGX") {
-BSDF = BSDF + specular_weight * 
microfacet_multi_ggx_aniso_fresnel(Normal, Tangent, alpha_x, alpha_y, (2.0 / 
(1.0 - sqrt(0.08 * Specular))) - 1.0, BaseColor, Cspec0);
+if (distribution == "GGX" || Roughness <= 0.075) {
+BSDF = BSDF  + specular_weight * 
microfacet_ggx_aniso_fresnel(Normal, T, alpha_x, alpha_y, (2.0 / (1.0 - 
sqrt(0.08 * Specular))) - 1.0, BaseColor, Cspec0);
 } else {
-BSDF = BSDF  + specular_weight * 
microfacet_ggx_aniso_fresnel(Normal, Tangent, alpha_x, alpha_y, (2.0 / (1.0 - 
sqrt(0.08 * Specular))) - 1.0, BaseColor, Cspec0);
+BSDF = BSDF + specular_weight * 
microfacet_multi_ggx_aniso_fresnel(Normal, T, alpha_x, alpha_y, (2.0 / (1.0 - 
sqrt(0.08 * Specular))) - 1.0, BaseColor, Cspec0);
 }
 }
 
@@ -82,19 +89,27 @@ shader node_disney_bsdf(
 color Cspec0 = BaseColor * SpecularTint + color(1.0, 1.0, 1.0) * (1.0 
- SpecularTint);
 float eta = backfacing() ? 1.0 / f : f;
 
-if (distribution == "Multiscatter GGX") {
-BSDF = BSDF + transp * 

[Bf-blender-cvs] [4dfcf45] cycles_disney_brdf: Merge branch 'master' into cycles_disney_brdf

2016-10-20 Thread Pascal Schoen
Commit: 4dfcf455f7769752044e051b399fb6a5dfcd0e22
Author: Pascal Schoen
Date:   Thu Oct 20 10:41:50 2016 +0200
Branches: cycles_disney_brdf
https://developer.blender.org/rB4dfcf455f7769752044e051b399fb6a5dfcd0e22

Merge branch 'master' into cycles_disney_brdf

===



===

diff --cc intern/cycles/kernel/closure/bsdf_microfacet_multi.h
index d271162,cea59ad..79e4463
--- a/intern/cycles/kernel/closure/bsdf_microfacet_multi.h
+++ b/intern/cycles/kernel/closure/bsdf_microfacet_multi.h
@@@ -404,7 -393,7 +404,7 @@@ ccl_device float3 bsdf_microfacet_multi
*pdf = mf_ggx_aniso_pdf(localI, localO, 
make_float2(bsdf->alpha_x, bsdf->alpha_y));
else
*pdf = mf_ggx_pdf(localI, localO, bsdf->alpha_x);
-   return mf_eval_glossy(localI, localO, true, bsdf->extra->color, 
bsdf->extra->cspec0, bsdf->alpha_x, bsdf->alpha_y, lcg_state, NULL, NULL, 
bsdf->ior, bsdf->extra->use_fresnel);
 -  return mf_eval_glossy(localI, localO, true, bsdf->extra->color, 
bsdf->alpha_x, bsdf->alpha_y, lcg_state, NULL, NULL);
++  return mf_eval_glossy(localI, localO, true, bsdf->extra->color, 
bsdf->alpha_x, bsdf->alpha_y, lcg_state, NULL, NULL, bsdf->ior, 
bsdf->extra->use_fresnel, bsdf->extra->cspec0);
  }
  
  ccl_device int bsdf_microfacet_multi_ggx_sample(KernelGlobals *kg, const 
ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, 
float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 
*domega_in_dy, float *pdf, ccl_addr_space uint *lcg_state)
@@@ -430,7 -419,7 +430,7 @@@
float3 localI = make_float3(dot(I, X), dot(I, Y), dot(I, Z));
float3 localO;
  
-   *eval = mf_sample_glossy(localI, , bsdf->extra->color, 
bsdf->extra->cspec0, bsdf->alpha_x, bsdf->alpha_y, lcg_state, NULL, NULL, 
bsdf->ior, bsdf->extra->use_fresnel);
 -  *eval = mf_sample_glossy(localI, , bsdf->extra->color, 
bsdf->alpha_x, bsdf->alpha_y, lcg_state, NULL, NULL);
++  *eval = mf_sample_glossy(localI, , bsdf->extra->color, 
bsdf->alpha_x, bsdf->alpha_y, lcg_state, NULL, NULL, bsdf->ior, 
bsdf->extra->use_fresnel, bsdf->extra->cspec0);
if(is_aniso)
*pdf = mf_ggx_aniso_pdf(localI, localO, 
make_float2(bsdf->alpha_x, bsdf->alpha_y));
else
@@@ -447,7 -436,7 +447,7 @@@
  
  /* Multiscattering GGX Glass closure */
  
- ccl_device int bsdf_microfacet_multi_ggx_glass_setup(MicrofacetBsdf *bsdf, 
bool use_fresnel = false, bool initial_outside = true)
 -ccl_device int bsdf_microfacet_multi_ggx_glass_setup(MicrofacetBsdf *bsdf)
++ccl_device int bsdf_microfacet_multi_ggx_glass_setup(MicrofacetBsdf *bsdf, 
bool use_fresnel = false)
  {
bsdf->alpha_x = clamp(bsdf->alpha_x, 1e-4f, 1.0f);
bsdf->alpha_y = bsdf->alpha_x;
@@@ -455,11 -444,6 +455,10 @@@
bsdf->extra->color.x = saturate(bsdf->extra->color.x);
bsdf->extra->color.y = saturate(bsdf->extra->color.y);
bsdf->extra->color.z = saturate(bsdf->extra->color.z);
 +  bsdf->extra->use_fresnel = use_fresnel;
 +  bsdf->extra->cspec0.x = saturate(bsdf->extra->cspec0.x);
 +  bsdf->extra->cspec0.y = saturate(bsdf->extra->cspec0.y);
 +  bsdf->extra->cspec0.z = saturate(bsdf->extra->cspec0.z);
-   bsdf->extra->initial_outside = initial_outside;
  
bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID;
  
@@@ -499,7 -483,7 +498,7 @@@ ccl_device float3 bsdf_microfacet_multi
float3 localO = make_float3(dot(omega_in, X), dot(omega_in, Y), 
dot(omega_in, Z));
  
*pdf = mf_glass_pdf(localI, localO, bsdf->alpha_x, bsdf->ior);
-   return mf_eval_glass(localI, localO, true, bsdf->extra->color, 
bsdf->extra->cspec0, bsdf->alpha_x, bsdf->alpha_y, lcg_state, bsdf->ior, 
bsdf->extra->use_fresnel, bsdf->extra->initial_outside);
 -  return mf_eval_glass(localI, localO, true, bsdf->extra->color, 
bsdf->alpha_x, bsdf->alpha_y, lcg_state, bsdf->ior);
++  return mf_eval_glass(localI, localO, true, bsdf->extra->color, 
bsdf->alpha_x, bsdf->alpha_y, lcg_state, bsdf->ior, bsdf->extra->use_fresnel, 
bsdf->extra->cspec0);
  }
  
  ccl_device int bsdf_microfacet_multi_ggx_glass_sample(KernelGlobals *kg, 
const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float 
randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, 
float3 *domega_in_dy, float *pdf, ccl_addr_space uint *lcg_state)
@@@ -546,7 -530,7 +545,7 @@@
float3 localI = make_float3(dot(I, X), dot(I, Y), dot(I, Z));
float3 localO;
  
-   *eval = mf_sample_glass(localI, , bsdf->extra->color, 
bsdf->extra->cspec0, bsdf->alpha_x, bsdf->alpha_y, lcg_state, bsdf->ior, 
bsdf->extra->use_fresnel, bsdf->extra->initial_outside);
 -  *eval = mf_sample_glass(localI, , bsdf->extra->color, 
bsdf->alpha_x, bsdf->alpha_y, lcg_state, bsdf->ior);
++  *eval = mf_sample_glass(localI, ,