[Bf-blender-cvs] [8619e09] blender2.8: OpenGL: tweak legacy 2D shader
Commit: 8619e091072c57a2b1c4d471c3c7823063a2d848 Author: Mike Erwin Date: Mon Aug 15 21:44:44 2016 -0400 Branches: blender2.8 https://developer.blender.org/rB8619e091072c57a2b1c4d471c3c7823063a2d848 OpenGL: tweak legacy 2D shader EXT_gpu_shader4 lets us say “noperspective” in GLSL #version 120 just like in later GLSL. Mac shader now matches modern GLSL available on other platforms. === M source/blender/gpu/shaders/gpu_shader_2D_smooth_color_frag.glsl M source/blender/gpu/shaders/gpu_shader_2D_smooth_color_vert.glsl === diff --git a/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_frag.glsl b/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_frag.glsl index 89d23e2..654439d 100644 --- a/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_frag.glsl @@ -1,6 +1,6 @@ #if __VERSION__ == 120 - varying vec4 finalColor; + noperspective varying vec4 finalColor; #define fragColor gl_FragColor #else noperspective in vec4 finalColor; diff --git a/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_vert.glsl index 49bed5d..0160662 100644 --- a/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_vert.glsl @@ -3,7 +3,7 @@ attribute vec2 pos; attribute vec4 color; - varying vec4 finalColor; + noperspective varying vec4 finalColor; #else in vec2 pos; in vec4 color; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [04c4ea2] soc-2016-pbvh-painting: Merge branch 'master' into soc-2016-pbvh-painting
Commit: 04c4ea25f26929e4cec43cbcdb961ae55de70b6b Author: Nathan Vollmer Date: Mon Aug 15 19:09:40 2016 -0600 Branches: soc-2016-pbvh-painting https://developer.blender.org/rB04c4ea25f26929e4cec43cbcdb961ae55de70b6b Merge branch 'master' into soc-2016-pbvh-painting === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [996165a] soc-2016-pbvh-painting: Fixed spray mode in vertex paint.
Commit: 996165ac9491a106bc3dda5e3458d8a141ffc4e8 Author: Nathan Vollmer Date: Mon Aug 15 19:27:02 2016 -0600 Branches: soc-2016-pbvh-painting https://developer.blender.org/rB996165ac9491a106bc3dda5e3458d8a141ffc4e8 Fixed spray mode in vertex paint. === M release/scripts/startup/bl_ui/space_view3d_toolbar.py M source/blender/blenkernel/intern/paint.c M source/blender/editors/sculpt_paint/paint_vertex.c === diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 6ff0364..5c394b0 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -1611,7 +1611,7 @@ class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel): class VIEW3D_PT_sculpt_symmetry(Panel, View3DPaintPanel): bl_category = "Tools" -bl_label = "Symmetry / Lock" +bl_label = "Symmetry/Lock" bl_options = {'DEFAULT_CLOSED'} @classmethod diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index bcb4ad9..736e7a2 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -772,6 +772,8 @@ void BKE_sculptsession_free(Object *ob) MEM_freeN(ob->sculpt->totalWeight); if (ob->sculpt->maxWeight) MEM_freeN(ob->sculpt->maxWeight); +if (ob->sculpt->maxColor) + MEM_freeN(ob->sculpt->maxColor); MEM_freeN(ss); diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index e656a16..782f1f6 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1016,8 +1016,6 @@ static float wpaint_blend(VPaint *wp, float weight, CLAMP(weight, 0.0f, 1.0f); - /* if no spray, clip result with orig weight & orig alpha */ - return weight; } @@ -1754,7 +1752,7 @@ static void vertex_paint_init_session_average_arrays(Object *ob){ ob->sculpt->totalAlpha = MEM_callocN(totNode * sizeof(unsigned long), "totalAlpha"); ob->sculpt->totalWeight = MEM_callocN(totNode * sizeof(double), "totalWeight"); ob->sculpt->totloopsHit = MEM_callocN(totNode * sizeof(unsigned int), "totloopsHit"); - ob->sculpt->maxWeight = MEM_callocN(me->totvert * sizeof(float), "previouslyPainted"); + ob->sculpt->maxWeight = MEM_callocN(me->totvert * sizeof(float), "maxWeight"); } /* *** set wpaint operator ** */ @@ -2624,15 +2622,9 @@ static void wpaint_paint_leaves(bContext *C, Object *ob, Sculpt *sd, VPaint *vp, /* threaded loop over nodes */ SculptThreadedTaskData data = { - .sd = sd, .ob = ob, .brush = brush, .nodes = nodes, + .sd = sd, .ob = ob, .brush = brush, .nodes = nodes, .vp = vp, .wpd = wpd, .wpi = wpi, .me = me, .C = C, }; - data.vp = vp; - data.wpd = wpd; - data.wpi = wpi; - data.lcol = (unsigned int*)me->mloopcol; - data.me = me; - data.C = C; switch (brush->vertexpaint_tool) { case PAINT_BLEND_AVERAGE: calculate_average_weight(&data, nodes, totnode); @@ -2677,7 +2669,8 @@ static void wpaint_do_paint( MEM_freeN(nodes); } -static void wpaint_do_radial_symmetry(bContext *C, Object *ob, VPaint *wp, Sculpt *sd, WPaintData *wpd, WeightPaintInfo *wpi, Mesh *me, Brush *brush, const char symm, const int axis) +static void wpaint_do_radial_symmetry(bContext *C, Object *ob, VPaint *wp, Sculpt *sd, WPaintData *wpd, WeightPaintInfo *wpi, Mesh *me, + Brush *brush, const char symm, const int axis) { for (int i = 1; i < wp->radial_symm[axis - 'X']; ++i) { const float angle = (2.0 * M_PI) * i / wp->radial_symm[axis - 'X']; @@ -3275,20 +3268,18 @@ static void do_vpaint_brush_calc_ave_color_cb_ex( data->ob->sculpt->totalAlpha[n] = blend[3]; } -static void handle_texture_brush(Brush *brush, SculptThreadedTaskData *data, PBVHVertexIter vd, float *alpha, unsigned int* actualColor){ - Scene *scene = CTX_data_scene(data->C); +static void handle_texture_brush(Scene *scene, Brush *brush, SculptThreadedTaskData *data, PBVHVertexIter vd, + float *alpha, unsigned int* actualColor, float size_pressure, float alpha_pressure) +{ SculptSession *ss = data->ob->sculpt; ViewContext *vc = &data->vpd->vc; int vertexIndex = vd.vert_indices[vd.i]; - const float brush_size_pressure = - BKE_brush_size_get(scene, brush) * (BKE_brush_use_size_pressure(scene, brush) ? ss->cache->pressure : 1.0f); - const float brush_alpha_value = BKE_brush_alpha_get(scene, brush); -
[Bf-blender-cvs] [d85b6d6] gsoc2016-improved_extrusion: Curves: Chamfer and offset operators
Commit: d85b6d6db03ea59b056cdf023aeed85c16848ac9 Author: João Araújo Date: Tue Aug 16 00:02:34 2016 +0100 Branches: gsoc2016-improved_extrusion https://developer.blender.org/rBd85b6d6db03ea59b056cdf023aeed85c16848ac9 Curves: Chamfer and offset operators Offset operator: Fixed it to work with vector and free handles. Chamfer: The operator now preserves all settings from the handles it is modifying (radius, tilt, weight, handle type, etc...). === M source/blender/editors/curve/editcurve.c === diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index d19cddf..0a5cbbb 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -7527,7 +7527,6 @@ void CURVE_OT_trim_curve(wmOperatorType *ot) static int get_offset_vecs(BezTriple *bezt1, BezTriple *bezt2, float *r_v1, float *r_v2) { - /* TODO: handle type free is fishy */ int dims = 3, ret = 1; float *coord_array, *vx, *vy, *helper; coord_array = MEM_callocN(dims * (12 + 1) * sizeof(float), "get_offset_vecs1"); @@ -7690,8 +7689,8 @@ static Nurb *offset_curve(Nurb *nu, ListBase *UNUSED(nubase), float distance) } /* offset direction correction */ - sub_v3_v3v3(v3, (bezt - 1)->vec[1], (bezt - 1)->vec[2]); - sub_v3_v3v3(v4, bezt->vec[1], bezt->vec[0]); + sub_v3_v3v3(v3, (bezt - 1)->vec[0], (bezt - 1)->vec[2]); + sub_v3_v3v3(v4, bezt->vec[2], bezt->vec[0]); normalize_v3(v3); normalize_v3(v4); /* a criteria is needed for dot == 0 */ @@ -7744,8 +7743,8 @@ static Nurb *offset_curve(Nurb *nu, ListBase *UNUSED(nubase), float distance) add_v3_v3(new_bezt->vec[2], v2); } else { - sub_v3_v3v3(v3, (bezt - 1)->vec[1], (bezt - 1)->vec[2]); - sub_v3_v3v3(v4, bezt->vec[1], bezt->vec[0]); + sub_v3_v3v3(v3, (bezt - 1)->vec[0], (bezt - 1)->vec[2]); + sub_v3_v3v3(v4, bezt->vec[2], bezt->vec[0]); normalize_v3(v3); normalize_v3(v4); /* a criteria is needed for dot == 0 */ @@ -8085,6 +8084,12 @@ void CURVE_OT_batch_extend(wmOperatorType *ot) static void chamfer_handle(BezTriple *bezt, BezTriple *r_new_bezt1, BezTriple *r_new_bezt2, float theta, float d) { + /* preserve all previous properties */ + memcpy(r_new_bezt1, bezt, sizeof(BezTriple)); + memcpy(r_new_bezt2, bezt, sizeof(BezTriple)); + BEZT_DESEL_ALL(r_new_bezt1); + BEZT_DESEL_ALL(r_new_bezt2); + /* first, get the plane defined by the handle */ float v1[3], v2[3], k[3], plane[4], vrot[3], helper[3]; copy_v3_v3(v1, bezt->vec[1]); @@ -8130,8 +8135,6 @@ static void chamfer_handle(BezTriple *bezt, BezTriple *r_new_bezt1, BezTriple *r /* intersect the segments and get the control point for the first handle */ result = isect_line_line_v3(bezt->vec[0], bezt->vec[1], p1, p2, ip1, ip1); copy_v3_v3(r_new_bezt1->vec[1], ip1); - - r_new_bezt1->h1 = r_new_bezt2->h1 = r_new_bezt1->h2 = r_new_bezt2->h2 = bezt->h1; } static int curve_chamfer_exec(bContext *C, wmOperator *op) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [2dc2dbe] soc-2016-layer_manager: Merge branch 'master' into soc-2016-layer_manager
Commit: 2dc2dbec0a20d25fc114d1792519749eee880632 Author: Julian Eisel Date: Mon Aug 15 23:59:42 2016 +0200 Branches: soc-2016-layer_manager https://developer.blender.org/rB2dc2dbec0a20d25fc114d1792519749eee880632 Merge branch 'master' into soc-2016-layer_manager === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ea7ed9d] fluid-mantaflow: refactored mantaflow scripts
Commit: ea7ed9dd1072e06d8d395060f7e4783a7d01d5ba Author: Sebastián Barschkis Date: Mon Aug 15 22:54:04 2016 +0200 Branches: fluid-mantaflow https://developer.blender.org/rBea7ed9dd1072e06d8d395060f7e4783a7d01d5ba refactored mantaflow scripts === M intern/mantaflow/intern/SMOKE.cpp M intern/mantaflow/intern/strings/liquid_script.h M intern/mantaflow/intern/strings/shared_script.h M intern/mantaflow/intern/strings/smoke_script.h === diff --git a/intern/mantaflow/intern/SMOKE.cpp b/intern/mantaflow/intern/SMOKE.cpp index e49b34f..b6a7b71 100644 --- a/intern/mantaflow/intern/SMOKE.cpp +++ b/intern/mantaflow/intern/SMOKE.cpp @@ -191,8 +191,8 @@ SMOKE::SMOKE(int *res, SmokeModifierData *smd) void SMOKE::initDomain(SmokeModifierData *smd) { std::string tmpString = manta_import - + solver_low - + adaptive_time_stepping_low; + + fluid_solver_low + + fluid_adaptive_time_stepping_low; std::string finalString = parseScript(tmpString, smd); mCommands.clear(); mCommands.push_back(finalString); @@ -202,8 +202,8 @@ void SMOKE::initDomain(SmokeModifierData *smd) void SMOKE::initDomainHigh(SmokeModifierData *smd) { - std::string tmpString = solver_high - + adaptive_time_stepping_high; + std::string tmpString = fluid_solver_high + + fluid_adaptive_time_stepping_high; std::string finalString = parseScript(tmpString, smd); mCommands.clear(); mCommands.push_back(finalString); @@ -213,11 +213,10 @@ void SMOKE::initDomainHigh(SmokeModifierData *smd) void SMOKE::initSmoke(SmokeModifierData *smd) { - std::string tmpString = alloc_base_grids_low - + fluid_variables + std::string tmpString = smoke_alloc_low + smoke_variables_low - + smoke_prep_domain_low - + manta_step + + smoke_bounds_low + + smoke_adaptive_step + smoke_step_low; std::string finalString = parseScript(tmpString, smd); mCommands.clear(); @@ -228,11 +227,11 @@ void SMOKE::initSmoke(SmokeModifierData *smd) void SMOKE::initSmokeHigh(SmokeModifierData *smd) { - std::string tmpString = alloc_base_grids_high + std::string tmpString = smoke_alloc_high + smoke_variables_high - + uv_setup - + smoke_prep_domain_high - + wavelet_turbulence_noise + + smoke_uv_setup + + smoke_bounds_high + + smoke_wavelet_turbulence_noise + smoke_step_high; std::string finalString = parseScript(tmpString, smd); mCommands.clear(); @@ -246,8 +245,8 @@ void SMOKE::initHeat(SmokeModifierData *smd) { if (!mHeat) { mCommands.clear(); - mCommands.push_back(alloc_heat_low); - mCommands.push_back(with_heat); + mCommands.push_back(smoke_alloc_heat_low); + mCommands.push_back(smoke_with_heat); runPythonString(mCommands); mUsingHeat = true; @@ -258,8 +257,8 @@ void SMOKE::initFire(SmokeModifierData *smd) { if (!mFuel) { mCommands.clear(); - mCommands.push_back(alloc_fire_low); - mCommands.push_back(with_fire); + mCommands.push_back(smoke_alloc_fire_low); + mCommands.push_back(smoke_with_fire); runPythonString(mCommands); mUsingFire = true; @@ -270,8 +269,8 @@ void SMOKE::initFireHigh(SmokeModifierData *smd) { if (!mFuelHigh) { mCommands.clear(); - mCommands.push_back(alloc_fire_high); - mCommands.push_back(with_fire); + mCommands.push_back(smoke_alloc_fire_high); + mCommands.push_back(smoke_with_fire); runPythonString(mCommands); mUsingFire = true; @@ -282,11 +281,11 @@ void SMOKE::initColors(SmokeModifierData *smd) { if (!mColorR) { mCommands.clear(); - std::string colorCodes = parseScript(set_color_codes, smd); + std::string colorCodes = parseScript(smoke_set_color_codes, smd); mCommands.push_back(colorCodes); - mCommands.push_back(alloc_colors_low); - mCommands.push_back(init_colors_low); - mCommands.push_back(with_colors); + mCommands.push_back(smoke_alloc_colors_low); + mCommands.push_back(smoke_init_colors_low); + mCommands.push_back(smoke_with_colors); runPythonString(mCommands); mUsingColors = true; @@ -297,11 +296,11 @@ void SMOKE::initColorsHigh(SmokeModifierData *smd) {
[Bf-blender-cvs] [89436dd] fluid-mantaflow: now using scene gravity in all mantaflow scripts (smoke and liquid)
Commit: 89436dd5194dfcd8071c3f4f0944bae7062e7ce9 Author: Sebastián Barschkis Date: Mon Aug 15 22:59:31 2016 +0200 Branches: fluid-mantaflow https://developer.blender.org/rB89436dd5194dfcd8071c3f4f0944bae7062e7ce9 now using scene gravity in all mantaflow scripts (smoke and liquid) === M intern/mantaflow/intern/SMOKE.cpp M intern/mantaflow/intern/strings/liquid_script.h M intern/mantaflow/intern/strings/shared_script.h M intern/mantaflow/intern/strings/smoke_script.h M source/blender/blenkernel/intern/smoke.c M source/blender/makesdna/DNA_smoke_types.h === diff --git a/intern/mantaflow/intern/SMOKE.cpp b/intern/mantaflow/intern/SMOKE.cpp index b6a7b71..15c81bb 100644 --- a/intern/mantaflow/intern/SMOKE.cpp +++ b/intern/mantaflow/intern/SMOKE.cpp @@ -581,6 +581,12 @@ std::string SMOKE::getRealValue(const std::string& varName, SmokeModifierData * ss << md->scene->r.cfra; else if (varName == "RANDOMNESS") ss << smd->domain->particle_randomness; + else if (varName == "GRAVITY_X") + ss << smd->domain->gravity[0]; + else if (varName == "GRAVITY_Y") + ss << smd->domain->gravity[1]; + else if (varName == "GRAVITY_Z") + ss << smd->domain->gravity[2]; else if (varName == "MANTA_EXPORT_PATH") { char parent_dir[1024]; BLI_split_dir_part(smd->domain->manta_filepath, parent_dir, sizeof(parent_dir)); diff --git a/intern/mantaflow/intern/strings/liquid_script.h b/intern/mantaflow/intern/strings/liquid_script.h index afae08d..3841247 100644 --- a/intern/mantaflow/intern/strings/liquid_script.h +++ b/intern/mantaflow/intern/strings/liquid_script.h @@ -61,7 +61,6 @@ particleNumber = 2\n\ radiusFactor = 1.0\n\ randomness = $RANDOMNESS$\n\ \n\ -gravity = (0,0,-1)\n\ step= -1\n\ maxVel = 0\n\ \n\ diff --git a/intern/mantaflow/intern/strings/shared_script.h b/intern/mantaflow/intern/strings/shared_script.h index 8acae58..d7ad241 100644 --- a/intern/mantaflow/intern/strings/shared_script.h +++ b/intern/mantaflow/intern/strings/shared_script.h @@ -45,10 +45,12 @@ const std::string fluid_solver_low = "\n\ mantaMsg('Solver low')\n\ dim = $SOLVER_DIM$\n\ res = $RES$\n\ +gravity = vec3($GRAVITY_X$, $GRAVITY_Y$, $GRAVITY_Z$)\n\ gs = vec3($RESX$, $RESY$, $RESZ$)\n\ \n\ if dim == 2:\n\ gs.z= 1\n\ +gravity = vec3($GRAVITY_X$,$GRAVITY_Z$,0)\n\ \n\ doOpen = $DO_OPEN$\n\ boundConditions = '$BOUNDCONDITIONS$'\n\ diff --git a/intern/mantaflow/intern/strings/smoke_script.h b/intern/mantaflow/intern/strings/smoke_script.h index 5876ebc..7cba85b 100644 --- a/intern/mantaflow/intern/strings/smoke_script.h +++ b/intern/mantaflow/intern/strings/smoke_script.h @@ -246,12 +246,10 @@ def step_low():\n\ \n\ if using_heat:\n\ mantaMsg('Adding heat buoyancy')\n\ -gravity=vec3(0,0,-1) if dim==3 else vec3(0,-1,0)\n\ addBuoyancy(flags=flags, density=density, vel=vel, gravity=gravity, coefficient=$ALPHA$)\n\ addBuoyancy(flags=flags, density=heat, vel=vel, gravity=gravity, coefficient=$BETA$)\n\ else:\n\ mantaMsg('Adding buoyancy')\n\ -gravity=vec3(0,0,-0.01 * $ALPHA$) if dim==3 else vec3(0,-0.01* $ALPHA$,0)\n\ addBuoyancy(density=density, vel=vel, gravity=gravity, flags=flags)\n\ \n\ copyRealToVec3(sourceX=x_force, sourceY=y_force, sourceZ=z_force, target=forces)\n\ diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 3417017..155eeb7 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -289,6 +289,29 @@ static void smoke_set_domain_from_derivedmesh(SmokeDomainSettings *sds, Object * sds->cell_size[2] /= (float)sds->base_res[2]; } +static void smoke_set_domain_gravity(Scene *scene, SmokeDomainSettings *sds) +{ + float gravity[3] = {0.0f, 0.0f, -1.0f}; + float gravity_mag; + + /* use global gravity if enabled */ + if (scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) { + copy_v3_v3(gravity, scene->physics_settings.gravity); + /* map default value to 1.0 */ + mul_v3_fl(gravity, 1.0f / 9.810f); + } + + /* convert gravity to domain space */ + gravity_mag = len_v3(gravity); + mul_mat3_m4_v3(sds->imat, gravity); + normalize_v3(gravity); + mul_v3_fl(gravity, gravity_mag); + + sds->gravity[0] = gravity[0]; + sds->gravity[1] = gravity[1]; + sds->gravity[2] = gravity[2]; +} + static int smokeModifier_init(SmokeModifierData *smd, Object *ob, Scene *scene, DerivedMesh *dm) { if ((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain && !smd->domain->fluid) @@
[Bf-blender-cvs] [c00b2d8] master: OpenGL: ignore deprecated API warnings
Commit: c00b2d89911e20c8ace12a9256c689e9f43cc63b Author: Mike Erwin Date: Mon Aug 15 14:55:09 2016 -0400 Branches: master https://developer.blender.org/rBc00b2d89911e20c8ace12a9256c689e9f43cc63b OpenGL: ignore deprecated API warnings Reduces noise from --debug-gpu so we can spot serious errors. Blender 2.7x uses OpenGL 2.1, we don't care if features are deprecated. I'll re-enable these warnings for blender2.8 after next merge. === M source/blender/gpu/intern/gpu_debug.c === diff --git a/source/blender/gpu/intern/gpu_debug.c b/source/blender/gpu/intern/gpu_debug.c index af69c2f..5ed5124 100644 --- a/source/blender/gpu/intern/gpu_debug.c +++ b/source/blender/gpu/intern/gpu_debug.c @@ -208,6 +208,11 @@ static void APIENTRY gpu_debug_proc( GLenum severity, GLsizei UNUSED(length), const GLchar *message, const GLvoid *UNUSED(userParm)) { + if (type == GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR) { + /* Blender 2.7x uses OpenGL 2.1, we don't care if features are deprecated */ + return; + } + bool backtrace = false; switch (severity) { @@ -233,6 +238,11 @@ static void APIENTRY gpu_debug_proc_amd( GLenum severity, GLsizei UNUSED(length), const GLchar *message, GLvoid *UNUSED(userParm)) { + if (category == GL_DEBUG_CATEGORY_DEPRECATION_AMD) { + /* Blender 2.7x uses OpenGL 2.1, we don't care if features are deprecated */ + return; + } + bool backtrace = false; switch (severity) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b7224e1] soc-2016-uv_tools: Quick fix for Select Overlapping UVs operator
Commit: b7224e1392f9acf8bc6aaecee3cca6c8c1dfacca Author: Phil Gosch Date: Mon Aug 15 18:15:26 2016 +0200 Branches: soc-2016-uv_tools https://developer.blender.org/rBb7224e1392f9acf8bc6aaecee3cca6c8c1dfacca Quick fix for Select Overlapping UVs operator === M source/blender/editors/uvedit/uvedit_unwrap_ops.c === diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 22d047e..67a180f 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -758,7 +758,7 @@ void ED_uvedit_overlapping_select(Scene *scene, Object *ob, BMesh *bm, const boo int hparams = set_handle_params(true, false, false, true, true); handle = construct_param_handle(scene, ob, bm, hparams); param_select_overlapping(handle, extend); - param_flush(handle); + param_flush_sel(handle); param_delete(handle); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [76b6c77] master: Cycles microdisplacement: Allow kernels to be built without patch evaluation
Commit: 76b6c77f2cba22a6760f0ff4e446b6ee4a7ad718 Author: Mai Lavelle Date: Mon Aug 15 09:08:38 2016 -0400 Branches: master https://developer.blender.org/rB76b6c77f2cba22a6760f0ff4e446b6ee4a7ad718 Cycles microdisplacement: Allow kernels to be built without patch evaluation Kernels can now be built without patch evaluation when not needed by the scene (Catmull-Clark subdivision not in use), giving a performance boost for some devices. === M intern/cycles/device/device.cpp M intern/cycles/device/device.h M intern/cycles/kernel/geom/geom.h M intern/cycles/kernel/geom/geom_subd_triangle.h M intern/cycles/kernel/kernel_types.h M intern/cycles/render/session.cpp === diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp index df01215..85e736a 100644 --- a/intern/cycles/device/device.cpp +++ b/intern/cycles/device/device.cpp @@ -56,8 +56,14 @@ std::ostream& operator <<(std::ostream &os, << string_from_bool(requested_features.use_camera_motion) << std::endl; os << "Use Baking: " << string_from_bool(requested_features.use_baking) << std::endl; + os << "Use Subsurface: " + << string_from_bool(requested_features.use_subsurface) << std::endl; os << "Use Volume: " << string_from_bool(requested_features.use_volume) << std::endl; + os << "Use Branched Integrator: " + << string_from_bool(requested_features.use_integrator_branched) << std::endl; + os << "Use Patch Evaluation: " + << string_from_bool(requested_features.use_patch_evaluation) << std::endl; return os; } diff --git a/intern/cycles/device/device.h b/intern/cycles/device/device.h index e11bb7f..77dc1fa 100644 --- a/intern/cycles/device/device.h +++ b/intern/cycles/device/device.h @@ -109,6 +109,9 @@ public: /* Use branched integrator. */ bool use_integrator_branched; + /* Use OpenSubdiv patch evaluation */ + bool use_patch_evaluation; + DeviceRequestedFeatures() { /* TODO(sergey): Find more meaningful defaults. */ @@ -123,6 +126,7 @@ public: use_subsurface = false; use_volume = false; use_integrator_branched = false; + use_patch_evaluation = false; } bool modified(const DeviceRequestedFeatures& requested_features) @@ -137,7 +141,8 @@ public: use_baking == requested_features.use_baking && use_subsurface == requested_features.use_subsurface && use_volume == requested_features.use_volume && -use_integrator_branched == requested_features.use_integrator_branched); +use_integrator_branched == requested_features.use_integrator_branched && +use_patch_evaluation == requested_features.use_patch_evaluation); } /* Convert the requested features structure to a build options, @@ -175,6 +180,9 @@ public: if(!use_integrator_branched) { build_options += " -D__NO_BRANCHED_PATH__"; } + if(!use_patch_evaluation) { + build_options += " -D__NO_PATCH_EVAL__"; + } return build_options; } }; diff --git a/intern/cycles/kernel/geom/geom.h b/intern/cycles/kernel/geom/geom.h index 1154832..3605394 100644 --- a/intern/cycles/kernel/geom/geom.h +++ b/intern/cycles/kernel/geom/geom.h @@ -17,7 +17,9 @@ #include "geom_attribute.h" #include "geom_object.h" -#include "geom_patch.h" +#ifdef __PATCH_EVAL__ +# include "geom_patch.h" +#endif #include "geom_triangle.h" #include "geom_subd_triangle.h" #include "geom_triangle_intersect.h" diff --git a/intern/cycles/kernel/geom/geom_subd_triangle.h b/intern/cycles/kernel/geom/geom_subd_triangle.h index fccacf4..647840d 100644 --- a/intern/cycles/kernel/geom/geom_subd_triangle.h +++ b/intern/cycles/kernel/geom/geom_subd_triangle.h @@ -101,6 +101,7 @@ ccl_device_noinline float subd_triangle_attribute_float(KernelGlobals *kg, const { int patch = subd_triangle_patch(kg, sd); +#ifdef __PATCH_EVAL__ if(desc.flags & ATTR_SUBDIVIDED) { float2 uv[3]; subd_triangle_patch_uv(kg, sd, uv); @@ -144,7 +145,9 @@ ccl_device_noinline float subd_triangle_attribute_float(KernelGlobals *kg, const return a; } - else if(desc.element == ATTR_ELEMENT_FACE) { + else +#endif /* __PATCH_EVAL__ */ + if(desc.element == ATTR_ELEMENT_FACE) { if(dx) *dx = 0.0f; if(dy) *dy = 0.0f; @@ -217,6 +220,7 @@ ccl_device_noinline float3 subd_triangle_attribute_float3(KernelGlobals *kg, con { int patch = subd_triangle_pa
[Bf-blender-cvs] [33c83a2] master: Fix Cycles OpenCL textures after recent CUDA fix.
Commit: 33c83a289d269986678caaf7e90ec6d5b729099a Author: Brecht Van Lommel Date: Mon Aug 15 16:17:47 2016 +0200 Branches: master https://developer.blender.org/rB33c83a289d269986678caaf7e90ec6d5b729099a Fix Cycles OpenCL textures after recent CUDA fix. kernel_textures.h is included in device_opencl.cpp, so we can't check __KERNEL_OPENCL__ there. === M intern/cycles/kernel/kernel_compat_cuda.h M intern/cycles/kernel/kernel_textures.h === diff --git a/intern/cycles/kernel/kernel_compat_cuda.h b/intern/cycles/kernel/kernel_compat_cuda.h index d656fac..9a96cb9 100644 --- a/intern/cycles/kernel/kernel_compat_cuda.h +++ b/intern/cycles/kernel/kernel_compat_cuda.h @@ -67,6 +67,7 @@ typedef texture texture_float; typedef texture texture_uint; typedef texture texture_int; typedef texture texture_uint4; +typedef texture texture_uchar; typedef texture texture_uchar4; typedef texture texture_image_float4; typedef texture texture_image3d_float4; diff --git a/intern/cycles/kernel/kernel_textures.h b/intern/cycles/kernel/kernel_textures.h index f45da39..8d5bb75 100644 --- a/intern/cycles/kernel/kernel_textures.h +++ b/intern/cycles/kernel/kernel_textures.h @@ -186,13 +186,11 @@ KERNEL_TEX(uint, texture_uint, __bindless_mapping) #endif /* packed image (opencl) */ -#ifdef __KERNEL_OPENCL__ KERNEL_TEX(uchar4, texture_uchar4, __tex_image_byte4_packed) KERNEL_TEX(float4, texture_float4, __tex_image_float4_packed) KERNEL_TEX(uchar, texture_uchar, __tex_image_byte_packed) KERNEL_TEX(float, texture_float, __tex_image_float_packed) KERNEL_TEX(uint4, texture_uint4, __tex_image_packed_info) -#endif #undef KERNEL_TEX #undef KERNEL_IMAGE_TEX ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [87f5e0c] gsoc2016-improved_extrusion: Curves: Offset operator
Commit: 87f5e0cb95785960edea2663df2c865ea7866718 Author: João Araújo Date: Mon Aug 15 14:54:45 2016 +0100 Branches: gsoc2016-improved_extrusion https://developer.blender.org/rB87f5e0cb95785960edea2663df2c865ea7866718 Curves: Offset operator Offset now works with auto, align and vector type handles. === M source/blender/editors/curve/editcurve.c === diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 35c0e09..d19cddf 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -7527,8 +7527,7 @@ void CURVE_OT_trim_curve(wmOperatorType *ot) static int get_offset_vecs(BezTriple *bezt1, BezTriple *bezt2, float *r_v1, float *r_v2) { - /* TODO: when bezt1 and bezt2 are collinear, things go wrong. Extending and the offseting exposes -* the problem */ + /* TODO: handle type free is fishy */ int dims = 3, ret = 1; float *coord_array, *vx, *vy, *helper; coord_array = MEM_callocN(dims * (12 + 1) * sizeof(float), "get_offset_vecs1"); @@ -7544,14 +7543,17 @@ static int get_offset_vecs(BezTriple *bezt1, BezTriple *bezt2, float *r_v1, floa coord_array + j, 12, sizeof(float) * dims); } + /* first interpolated segment */ sub_v3_v3v3(vx, coord_array + 3, coord_array); + /* last interpolated segment */ sub_v3_v3v3(vy, coord_array + 3 * 12, coord_array + 3 * 11); float plane_b_no[3]; float plane_a[4], plane_b[4]; float isect_co[3]; float isect_no[3]; - sub_v3_v3v3(helper, bezt1->vec[2], bezt1->vec[1]); + /* vector that generates the normal plane to the handle */ + sub_v3_v3v3(helper, bezt1->vec[2], bezt1->vec[0]); cross_v3_v3v3(plane_b_no, helper, vx); plane_from_point_normal_v3(plane_a, bezt1->vec[1], helper); plane_from_point_normal_v3(plane_b, bezt1->vec[1], plane_b_no); @@ -7568,7 +7570,7 @@ static int get_offset_vecs(BezTriple *bezt1, BezTriple *bezt2, float *r_v1, floa copy_v3_v3(r_v1, isect_no); } - sub_v3_v3v3(helper, bezt2->vec[1], bezt2->vec[0]); + sub_v3_v3v3(helper, bezt2->vec[2], bezt2->vec[0]); cross_v3_v3v3(plane_b_no, vy, helper); mul_v3_fl(plane_b_no, -1); plane_from_point_normal_v3(plane_a, bezt2->vec[1], helper); @@ -7794,9 +7796,10 @@ static Nurb *offset_curve(Nurb *nu, ListBase *UNUSED(nubase), float distance) if (result != 0 && res) { copy_v3_v3(new_bezt->vec[0], v1); } - } + BKE_nurb_handles_calc(new_nu); + MEM_freeN(v0); MEM_freeN(v1); MEM_freeN(v2); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b5a77c6] gsoc2016-improved_extrusion: Curves: fillet and chamfer
Commit: b5a77c60a01220f6206b3a6942ce6325380c9301 Author: João Araújo Date: Mon Aug 15 13:10:06 2016 +0100 Branches: gsoc2016-improved_extrusion https://developer.blender.org/rBb5a77c60a01220f6206b3a6942ce6325380c9301 Curves: fillet and chamfer Added support to fillet and chamfer cyclic splines. Occasionaly, with no apparent reason, the following assertion fails blender-build/blender/source/blender/blenlib/intern/BLI_ghash.c:458, ghash_insert_ex(), at '(gh->flag & GHASH_FLAG_ALLOW_DUPES) || (BLI_ghash_haskey(gh, key) == 0) === M source/blender/editors/curve/editcurve.c === diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 3a5f2f8..35c0e09 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -8152,7 +8152,7 @@ static int curve_chamfer_exec(bContext *C, wmOperator *op) /* check if handles are vector type! */ BezTriple *bezt = nu->bezt, *bezt1, *bezt2, *helper; int selected_point = 0; - for (int i = 1; i < nu->pntsu - 1; i++) { + for (int i = 1 - nu->flagu; i < nu->pntsu - 1 + nu->flagu; i++) { bezt = &nu->bezt[i]; if (BEZT_ISSEL_ANY(bezt) && bezt->h1 == 2 && bezt->h2 == 2) { bezt1 = MEM_callocN(sizeof(BezTriple), "curve_chamfer1"); @@ -8161,9 +8161,14 @@ static int curve_chamfer_exec(bContext *C, wmOperator *op) selected_point = i; BKE_nurb_bezierPoints_add(nu, 1); - ED_curve_beztcpy(editnurb, &nu->bezt[selected_point + 1], &nu->bezt[selected_point], nu->pntsu - selected_point - 1); - ED_curve_beztcpy(editnurb, &nu->bezt[selected_point], bezt1, 1); - ED_curve_beztcpy(editnurb, &nu->bezt[selected_point + 1], bezt2, 1); + if (i != nu->pntsu - 1) { + ED_curve_beztcpy(editnurb, &nu->bezt[selected_point + 1], &nu->bezt[selected_point], nu->pntsu - selected_point - 1); + } + /* for these two a keyIndex_addBezt would be useful */ + //ED_curve_beztcpy(editnurb, &nu->bezt[selected_point], bezt1, 1); + //ED_curve_beztcpy(editnurb, &nu->bezt[selected_point + 1], bezt2, 1); + memcpy(&nu->bezt[selected_point], bezt1, sizeof(BezTriple)); + memcpy(&nu->bezt[selected_point + 1], bezt2, sizeof(BezTriple)); MEM_freeN(bezt1); MEM_freeN(bezt2); @@ -8171,28 +8176,28 @@ static int curve_chamfer_exec(bContext *C, wmOperator *op) /* set the handles for the first chamfered triple */ float v[3]; bezt1 = &nu->bezt[selected_point]; - helper = &nu->bezt[selected_point - 1]; + helper = &nu->bezt[(nu->pntsu + selected_point - 1) % nu->pntsu]; /* left handle */ sub_v3_v3v3(v, helper->vec[2], bezt1->vec[1]); mul_v3_fl(v, 0.4 * len_v3(v)); copy_v3_v3(bezt1->vec[0], bezt1->vec[1]); add_v3_v3(bezt1->vec[0], v); /* right handle */ - bezt2 = &nu->bezt[selected_point + 1]; + bezt2 = &nu->bezt[(nu->pntsu + selected_point + 1) % nu->pntsu]; sub_v3_v3v3(v, bezt2->vec[1], bezt1->vec[1]); mul_v3_fl(v, 0.4 * len_v3(v)); copy_v3_v3(bezt1->vec[2], bezt1->vec[1]); add_v3_v3(bezt1->vec[2], v); /* second chamfered triple */ - helper = &nu->bezt[selected_point + 2]; + helper = &nu->bezt[(nu->pntsu + selected_point + 2) % nu->pntsu]; /* left handle */ sub_v3_v3v3(v, bezt1->vec[1], bezt2->vec[1]); mul_v3_fl(v, 0.4 * len_v3(v)); copy_v3_v3(bezt2->vec[0], bezt2->vec[1]); add_v3_v3(bezt2->vec[0], v); /* right handle */ - bezt2 = &nu->bezt[selected_point + 1]; + bezt2 = &nu->bezt[(nu->pntsu + selected_point + 1) % nu->pntsu]; sub_v3_v3v3(v, helper->vec[0], bezt2->vec[1]); mul_v3_fl(v, 0.4 * len_v3(v)); copy_v3_v3(bezt2->vec[2], bezt2->vec[1]); @@ -8437,17 +8442,19 @@ static int curve_fillet_exec(bContext *C, wmOperator *op) BezTriple *bezt = nu->bezt, *bezt1, *bezt2, *helper; int selected_point = 0; - for (int i = 0; i < nu->pntsu
[Bf-blender-cvs] [ad4a01e] master: Fix OpenGL backtrace build errors, without disabling warnings.
Commit: ad4a01ec0fa72ab4626922e9d5d3dda1a46ca01b Author: Brecht Van Lommel Date: Mon Aug 15 15:34:41 2016 +0200 Branches: master https://developer.blender.org/rBad4a01ec0fa72ab4626922e9d5d3dda1a46ca01b Fix OpenGL backtrace build errors, without disabling warnings. === M source/blender/blenlib/BLI_system.h M source/blender/gpu/intern/gpu_debug.c === diff --git a/source/blender/blenlib/BLI_system.h b/source/blender/blenlib/BLI_system.h index cb8cb6f..92403eb 100644 --- a/source/blender/blenlib/BLI_system.h +++ b/source/blender/blenlib/BLI_system.h @@ -28,6 +28,7 @@ int BLI_cpu_support_sse2(void); #if defined(NDEBUG) || !defined(__BLI_UTILDEFINES_H__) +#include void BLI_system_backtrace(FILE *fp); #endif diff --git a/source/blender/gpu/intern/gpu_debug.c b/source/blender/gpu/intern/gpu_debug.c index 8d1ab43..af69c2f 100644 --- a/source/blender/gpu/intern/gpu_debug.c +++ b/source/blender/gpu/intern/gpu_debug.c @@ -30,6 +30,7 @@ */ #include "BLI_sys_types.h" +#include "BLI_system.h" #include "BKE_global.h" @@ -43,10 +44,6 @@ #define CASE_CODE_RETURN_STR(code) case code: return #code; -#if (defined(__GNUC__) && !defined(__clang__)) && defined(NDEBUG) -# pragma GCC diagnostic ignored "-Wimplicit-function-declaration" -#endif - static const char *gpu_gl_error_symbol(GLenum err) { switch (err) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a36a49c] soc-2016-uv_tools: Add new packing to keymap and UV menu
Commit: a36a49c4e84e0c117a1ae77581a617f6898ab2ac Author: Phil Gosch Date: Mon Aug 15 15:05:55 2016 +0200 Branches: soc-2016-uv_tools https://developer.blender.org/rBa36a49c4e84e0c117a1ae77581a617f6898ab2ac Add new packing to keymap and UV menu === M release/scripts/startup/bl_ui/space_image.py M source/blender/editors/uvedit/uvedit_ops.c === diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 4fce21a..5cfa702 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -361,6 +361,7 @@ class IMAGE_MT_uvs(Menu): layout.separator() +layout.operator("uv.irregular_pack_islands") layout.operator("uv.pack_islands") layout.operator("uv.average_islands_scale") layout.operator("uv.minimize_stretch") diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index b499f70..7334ce8 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -4780,6 +4780,7 @@ void ED_keymap_uvedit(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "UV_OT_unwrap", EKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "UV_OT_minimize_stretch", VKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "UV_OT_pack_islands", PKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "UV_OT_irregular_pack_islands", PKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0); WM_keymap_add_item(keymap, "UV_OT_average_islands_scale", AKEY, KM_PRESS, KM_CTRL, 0); /* hide */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [988b4e2] master: Tentative compile fix after recent gpu debug changes
Commit: 988b4e2c80d85cdacc165a1ab660c5f481485c6a Author: Jens Verwiebe Date: Mon Aug 15 13:46:38 2016 +0200 Branches: master https://developer.blender.org/rB988b4e2c80d85cdacc165a1ab660c5f481485c6a Tentative compile fix after recent gpu debug changes === M source/blender/gpu/intern/gpu_debug.c === diff --git a/source/blender/gpu/intern/gpu_debug.c b/source/blender/gpu/intern/gpu_debug.c index 21458a2..8d1ab43 100644 --- a/source/blender/gpu/intern/gpu_debug.c +++ b/source/blender/gpu/intern/gpu_debug.c @@ -43,6 +43,10 @@ #define CASE_CODE_RETURN_STR(code) case code: return #code; +#if (defined(__GNUC__) && !defined(__clang__)) && defined(NDEBUG) +# pragma GCC diagnostic ignored "-Wimplicit-function-declaration" +#endif + static const char *gpu_gl_error_symbol(GLenum err) { switch (err) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ad6e7a0] master: OpenGL: backtrace on errors (--debug-gpu)
Commit: ad6e7a0be15cf6c47635987a04cd5824fb5de054 Author: Mike Erwin Date: Mon Aug 15 04:00:59 2016 -0400 Branches: master https://developer.blender.org/rBad6e7a0be15cf6c47635987a04cd5824fb5de054 OpenGL: backtrace on errors (--debug-gpu) Backtrace so we can pinpoint where the GL error came from. Then fflush on severe errors in case it's severe enough to crash Blender. === M source/blender/gpu/intern/gpu_debug.c === diff --git a/source/blender/gpu/intern/gpu_debug.c b/source/blender/gpu/intern/gpu_debug.c index 555af8b..21458a2 100644 --- a/source/blender/gpu/intern/gpu_debug.c +++ b/source/blender/gpu/intern/gpu_debug.c @@ -207,13 +207,21 @@ static void APIENTRY gpu_debug_proc( GLenum severity, GLsizei UNUSED(length), const GLchar *message, const GLvoid *UNUSED(userParm)) { + bool backtrace = false; + switch (severity) { case GL_DEBUG_SEVERITY_HIGH: + backtrace = true; + /* fall through */ case GL_DEBUG_SEVERITY_MEDIUM: case GL_DEBUG_SEVERITY_LOW: case GL_DEBUG_SEVERITY_NOTIFICATION: /* KHR has this, ARB does not */ fprintf(stderr, "GL %s %s: %s\n", source_name(source), message_type_name(type), message); - fflush(stderr); + } + + if (backtrace) { + BLI_system_backtrace(stderr); + fflush(stderr); } } @@ -224,12 +232,20 @@ static void APIENTRY gpu_debug_proc_amd( GLenum severity, GLsizei UNUSED(length), const GLchar *message, GLvoid *UNUSED(userParm)) { + bool backtrace = false; + switch (severity) { case GL_DEBUG_SEVERITY_HIGH: + backtrace = true; + /* fall through */ case GL_DEBUG_SEVERITY_MEDIUM: case GL_DEBUG_SEVERITY_LOW: fprintf(stderr, "GL %s: %s\n", category_name_amd(category), message); - fflush(stderr); + } + + if (backtrace) { + BLI_system_backtrace(stderr); + fflush(stderr); } } #endif ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [2c03d01] master: OpenGL: debug context on Windows
Commit: 2c03d0186a014e4478aecb8e2a000bf2d530db10 Author: Mike Erwin Date: Mon Aug 15 04:49:07 2016 -0400 Branches: master https://developer.blender.org/rB2c03d0186a014e4478aecb8e2a000bf2d530db10 OpenGL: debug context on Windows Enable based on --debug-gpu at the command line. Linux already works this way. This commit in master (2.78 timeframe) is the smallest change that gets the desired result. I did a similar commit in blender2.8. Most ongoing GL debug work will go into 2.8, not 2.7x. In support of T49089 === M intern/ghost/intern/GHOST_WindowWin32.cpp === diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp index 6a27d7a..2aa950f8 100644 --- a/intern/ghost/intern/GHOST_WindowWin32.cpp +++ b/intern/ghost/intern/GHOST_WindowWin32.cpp @@ -649,7 +649,7 @@ GHOST_Context *GHOST_WindowWin32::newDrawingContext(GHOST_TDrawingContextType ty WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB, 3, 2, #endif - GHOST_OPENGL_WGL_CONTEXT_FLAGS, + (m_debug_context ? WGL_CONTEXT_DEBUG_BIT_ARB : 0), GHOST_OPENGL_WGL_RESET_NOTIFICATION_STRATEGY); #else # error ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [55eb8ce] master: OpenGL: enhance debug output
Commit: 55eb8ce87361e968b153a3e728e6842e3069d093 Author: Mike Erwin Date: Tue Aug 9 01:29:58 2016 -0400 Branches: master https://developer.blender.org/rB55eb8ce87361e968b153a3e728e6842e3069d093 OpenGL: enhance debug output When running blender --debug-gpu Display which debug facilities are available. One of these, in order of preference: - OpenGL 4.3 - KHR_debug - ARB_debug_output - AMD_debug_output All messages are logged now, not just errors. Will probably turn some of these off later. GL_DEBUG_OUTPUT_SYNCHRONOUS lets us break on errors and backtrace to the exact trouble spot. Callers of GPU_string_marker no longer pass in a message length, just the message itself (null terminated). Apple provides no GL debug logging features. === M source/blender/gpu/GPU_debug.h M source/blender/gpu/intern/gpu_debug.c === diff --git a/source/blender/gpu/GPU_debug.h b/source/blender/gpu/GPU_debug.h index 2c1728b..ec0db43 100644 --- a/source/blender/gpu/GPU_debug.h +++ b/source/blender/gpu/GPU_debug.h @@ -62,7 +62,7 @@ void GPU_assert_no_gl_errors(const char *file, int line, const char *str); /* inserts a debug marker message for the debug context messaging system */ -void GPU_string_marker(size_t size, const char *str); +void GPU_string_marker(const char *str); #ifdef __cplusplus } diff --git a/source/blender/gpu/intern/gpu_debug.c b/source/blender/gpu/intern/gpu_debug.c index be92857..555af8b 100644 --- a/source/blender/gpu/intern/gpu_debug.c +++ b/source/blender/gpu/intern/gpu_debug.c @@ -159,29 +159,78 @@ const char *gpuErrorString(GLenum err) #endif +static const char* source_name(GLenum source) +{ + switch (source) { + case GL_DEBUG_SOURCE_API: return "API"; + case GL_DEBUG_SOURCE_WINDOW_SYSTEM: return "window system"; + case GL_DEBUG_SOURCE_SHADER_COMPILER: return "shader compiler"; + case GL_DEBUG_SOURCE_THIRD_PARTY: return "3rd party"; + case GL_DEBUG_SOURCE_APPLICATION: return "application"; + case GL_DEBUG_SOURCE_OTHER: return "other"; + default: return "???"; + } +} + +static const char* message_type_name(GLenum message) +{ + switch (message) { + case GL_DEBUG_TYPE_ERROR: return "error"; + case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: return "deprecated behavior"; + case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR: return "undefined behavior"; + case GL_DEBUG_TYPE_PORTABILITY: return "portability"; + case GL_DEBUG_TYPE_PERFORMANCE: return "performance"; + case GL_DEBUG_TYPE_OTHER: return "other"; + case GL_DEBUG_TYPE_MARKER: return "marker"; /* KHR has this, ARB does not */ + default: return "???"; + } +} + +static const char* category_name_amd(GLenum category) +{ + switch (category) { + case GL_DEBUG_CATEGORY_API_ERROR_AMD: return "API error"; + case GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD: return "window system"; + case GL_DEBUG_CATEGORY_DEPRECATION_AMD: return "deprecated behavior"; + case GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD: return "undefined behavior"; + case GL_DEBUG_CATEGORY_PERFORMANCE_AMD: return "performance"; + case GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD: return "shader compiler"; + case GL_DEBUG_CATEGORY_APPLICATION_AMD: return "application"; + case GL_DEBUG_CATEGORY_OTHER_AMD: return "other"; + default: return "???"; + } +} + + static void APIENTRY gpu_debug_proc( GLenum source, GLenum type, GLuint UNUSED(id), -GLenum UNUSED(severity), GLsizei UNUSED(length), +GLenum severity, GLsizei UNUSED(length), const GLchar *message, const GLvoid *UNUSED(userParm)) { - if (source == GL_DEBUG_SOURCE_API && type == GL_DEBUG_TYPE_ERROR) { - fprintf(stderr, "GL: %s\n", message); - fflush(stderr); - } - else if (G.debug_value == 20) { - fprintf(stderr, "GL: %s\n", message); - fflush(stderr); + switch (severity) { + case GL_DEBUG_SEVERITY_HIGH: + case GL_DEBUG_SEVERITY_MEDIUM: + case GL_DEBUG_SEVERITY_LOW: + case GL_DEBUG_SEVERITY_NOTIFICATION: /* KHR has this, ARB does not */ + fprintf(stderr, "GL %s %s: %s\n", source_name(source), message_type_name(type), message); + fflush(stderr); } } #ifndef GLEW_ES_ONLY static void APIENTRY gpu_debug_proc_amd( -GLuint UNUSED(id), GLenum UNUSED(category), -GLenum UNUSED(severity), GLsizei UNUSED(length), +GLuint UNUSED(id), GLenum category, +GLenum severity, GLsizei UNUSED(length),
[Bf-blender-cvs] [23d7ae1] blender2.8: OpenGL: backtrace on errors (--debug-gpu)
Commit: 23d7ae184397dc6fa94af3a8d93ffc9d0d4b0393 Author: Mike Erwin Date: Mon Aug 15 04:00:59 2016 -0400 Branches: blender2.8 https://developer.blender.org/rB23d7ae184397dc6fa94af3a8d93ffc9d0d4b0393 OpenGL: backtrace on errors (--debug-gpu) Backtrace so we can pinpoint where the GL error came from. Then fflush on severe errors in case it's severe enough to crash Blender. === M source/blender/gpu/intern/gpu_debug.c === diff --git a/source/blender/gpu/intern/gpu_debug.c b/source/blender/gpu/intern/gpu_debug.c index 555af8b..21458a2 100644 --- a/source/blender/gpu/intern/gpu_debug.c +++ b/source/blender/gpu/intern/gpu_debug.c @@ -207,13 +207,21 @@ static void APIENTRY gpu_debug_proc( GLenum severity, GLsizei UNUSED(length), const GLchar *message, const GLvoid *UNUSED(userParm)) { + bool backtrace = false; + switch (severity) { case GL_DEBUG_SEVERITY_HIGH: + backtrace = true; + /* fall through */ case GL_DEBUG_SEVERITY_MEDIUM: case GL_DEBUG_SEVERITY_LOW: case GL_DEBUG_SEVERITY_NOTIFICATION: /* KHR has this, ARB does not */ fprintf(stderr, "GL %s %s: %s\n", source_name(source), message_type_name(type), message); - fflush(stderr); + } + + if (backtrace) { + BLI_system_backtrace(stderr); + fflush(stderr); } } @@ -224,12 +232,20 @@ static void APIENTRY gpu_debug_proc_amd( GLenum severity, GLsizei UNUSED(length), const GLchar *message, GLvoid *UNUSED(userParm)) { + bool backtrace = false; + switch (severity) { case GL_DEBUG_SEVERITY_HIGH: + backtrace = true; + /* fall through */ case GL_DEBUG_SEVERITY_MEDIUM: case GL_DEBUG_SEVERITY_LOW: fprintf(stderr, "GL %s: %s\n", category_name_amd(category), message); - fflush(stderr); + } + + if (backtrace) { + BLI_system_backtrace(stderr); + fflush(stderr); } } #endif ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs