Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastián Barschkis <sebbas@sebbas.org>2020-04-22 18:05:04 +0300
committerSebastián Barschkis <sebbas@sebbas.org>2020-04-22 18:05:04 +0300
commitcdc399a05537506f7afe977554d774d84b140e77 (patch)
treefc44817c414599d68e143efae93f87a9448d78b2
parent912ac457a68ff9ee919a5ff67acc9a11a78b368e (diff)
parent45f8d1783ba8b4adc32f5c39d95d1bc39c37aa5d (diff)
Merge branch 'blender-v2.83-release'
-rw-r--r--intern/cycles/kernel/kernel_jitter.h39
-rw-r--r--intern/cycles/kernel/kernel_random.h4
-rw-r--r--release/scripts/startup/bl_ui/properties_paint_common.py2
-rw-r--r--source/blender/blenkernel/BKE_subdiv_ccg.h2
-rw-r--r--source/blender/blenkernel/intern/pbvh.c2
-rw-r--r--source/blender/blenkernel/intern/subdiv_ccg.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c10
-rw-r--r--source/blender/gpu/intern/gpu_buffers.c2
8 files changed, 33 insertions, 30 deletions
diff --git a/intern/cycles/kernel/kernel_jitter.h b/intern/cycles/kernel/kernel_jitter.h
index 5b6e3bbf501..b9c48b86a5d 100644
--- a/intern/cycles/kernel/kernel_jitter.h
+++ b/intern/cycles/kernel/kernel_jitter.h
@@ -199,32 +199,33 @@ ccl_device float pmj_sample_1D(KernelGlobals *kg, int sample, int rng_hash, int
{
/* Fallback to random */
if (sample >= NUM_PMJ_SAMPLES) {
- int p = rng_hash + dimension;
+ const int p = rng_hash + dimension;
return cmj_randfloat(sample, p);
}
- uint tmp_rng = cmj_hash_simple(dimension, rng_hash);
- int index = ((dimension % NUM_PMJ_PATTERNS) * NUM_PMJ_SAMPLES + sample) * 2;
- return __uint_as_float(kernel_tex_fetch(__sample_pattern_lut, index) ^ (tmp_rng & 0x007fffff)) -
- 1.0f;
+ else {
+ const uint mask = cmj_hash_simple(dimension, rng_hash) & 0x007fffff;
+ const int index = ((dimension % NUM_PMJ_PATTERNS) * NUM_PMJ_SAMPLES + sample) * 2;
+ return __uint_as_float(kernel_tex_fetch(__sample_pattern_lut, index) ^ mask) - 1.0f;
+ }
}
-ccl_device void pmj_sample_2D(
- KernelGlobals *kg, int sample, int rng_hash, int dimension, float *fx, float *fy)
+ccl_device float2 pmj_sample_2D(KernelGlobals *kg, int sample, int rng_hash, int dimension)
{
if (sample >= NUM_PMJ_SAMPLES) {
- int p = rng_hash + dimension;
- *fx = cmj_randfloat(sample, p);
- *fy = cmj_randfloat(sample, p + 1);
- return;
+ const int p = rng_hash + dimension;
+ const float fx = cmj_randfloat(sample, p);
+ const float fy = cmj_randfloat(sample, p + 1);
+ return make_float2(fx, fy);
+ }
+ else {
+ const int index = ((dimension % NUM_PMJ_PATTERNS) * NUM_PMJ_SAMPLES + sample) * 2;
+ const uint maskx = cmj_hash_simple(dimension, rng_hash) & 0x007fffff;
+ const uint masky = cmj_hash_simple(dimension + 1, rng_hash) & 0x007fffff;
+ const float fx = __uint_as_float(kernel_tex_fetch(__sample_pattern_lut, index) ^ maskx) - 1.0f;
+ const float fy = __uint_as_float(kernel_tex_fetch(__sample_pattern_lut, index + 1) ^ masky) -
+ 1.0f;
+ return make_float2(fx, fy);
}
- uint tmp_rng = cmj_hash_simple(dimension, rng_hash);
- int index = ((dimension % NUM_PMJ_PATTERNS) * NUM_PMJ_SAMPLES + sample) * 2;
- *fx = __uint_as_float(kernel_tex_fetch(__sample_pattern_lut, index) ^ (tmp_rng & 0x007fffff)) -
- 1.0f;
- tmp_rng = cmj_hash_simple(dimension + 1, rng_hash);
- *fy = __uint_as_float(kernel_tex_fetch(__sample_pattern_lut, index + 1) ^
- (tmp_rng & 0x007fffff)) -
- 1.0f;
}
CCL_NAMESPACE_END
diff --git a/intern/cycles/kernel/kernel_random.h b/intern/cycles/kernel/kernel_random.h
index f4c3b36e778..a9b17854f25 100644
--- a/intern/cycles/kernel/kernel_random.h
+++ b/intern/cycles/kernel/kernel_random.h
@@ -102,7 +102,9 @@ ccl_device_forceinline void path_rng_2D(KernelGlobals *kg,
return;
#endif
if (kernel_data.integrator.sampling_pattern == SAMPLING_PATTERN_PMJ) {
- pmj_sample_2D(kg, sample, rng_hash, dimension, fx, fy);
+ const float2 f = pmj_sample_2D(kg, sample, rng_hash, dimension);
+ *fx = f.x;
+ *fy = f.y;
return;
}
#ifdef __CMJ__
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index bc467c4f42f..6de1b38a615 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -1095,7 +1095,7 @@ def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False)
settings = context.tool_settings.gpencil_sculpt
if compact:
row = layout.row(align=True)
- row.prop(settings, "use_thickness_curve", text="", icon='CURVE_DATA')
+ row.prop(settings, "use_thickness_curve", text="", icon='SPHERECURVE')
sub = row.row(align=True)
sub.active = settings.use_thickness_curve
sub.popover(
diff --git a/source/blender/blenkernel/BKE_subdiv_ccg.h b/source/blender/blenkernel/BKE_subdiv_ccg.h
index 6f886a4b850..7c7638e65d2 100644
--- a/source/blender/blenkernel/BKE_subdiv_ccg.h
+++ b/source/blender/blenkernel/BKE_subdiv_ccg.h
@@ -305,7 +305,7 @@ void BKE_subdiv_ccg_neighbor_coords_get(const SubdivCCG *subdiv_ccg,
const bool include_duplicates,
SubdivCCGNeighbors *r_neighbors);
-int BKE_subdiv_cgg_grid_to_face_index(const SubdivCCG *subdiv_ccg, const int grid_index);
+int BKE_subdiv_ccg_grid_to_face_index(const SubdivCCG *subdiv_ccg, const int grid_index);
#ifdef __cplusplus
}
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index 33aa20fa1e4..e6d672ad9d9 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -388,7 +388,7 @@ void BKE_pbvh_sync_face_sets_to_grids(PBVH *bvh)
const int gridsize = bvh->gridkey.grid_size;
for (int i = 0; i < bvh->totgrid; i++) {
BLI_bitmap *gh = bvh->grid_hidden[i];
- const int face_index = BKE_subdiv_cgg_grid_to_face_index(bvh->subdiv_ccg, i);
+ const int face_index = BKE_subdiv_ccg_grid_to_face_index(bvh->subdiv_ccg, i);
if (!gh && bvh->face_sets[face_index] < 0) {
gh = bvh->grid_hidden[i] = BLI_BITMAP_NEW(bvh->gridkey.grid_area, "partialvis_update_grids");
}
diff --git a/source/blender/blenkernel/intern/subdiv_ccg.c b/source/blender/blenkernel/intern/subdiv_ccg.c
index d99c41eaa3e..6637b3e9b69 100644
--- a/source/blender/blenkernel/intern/subdiv_ccg.c
+++ b/source/blender/blenkernel/intern/subdiv_ccg.c
@@ -1781,7 +1781,7 @@ void BKE_subdiv_ccg_neighbor_coords_get(const SubdivCCG *subdiv_ccg,
#endif
}
-int BKE_subdiv_cgg_grid_to_face_index(const SubdivCCG *subdiv_ccg, const int grid_index)
+int BKE_subdiv_ccg_grid_to_face_index(const SubdivCCG *subdiv_ccg, const int grid_index)
{
// Subdiv *subdiv = subdiv_ccg->subdiv; /* UNUSED */
// OpenSubdiv_TopologyRefiner *topology_refiner = subdiv->topology_refiner; /* UNUSED */
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 66f66bfceb8..9b00feb1cf8 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -222,7 +222,7 @@ int SCULPT_active_face_set_get(SculptSession *ss)
case PBVH_FACES:
return ss->face_sets[ss->active_face_index];
case PBVH_GRIDS: {
- const int face_index = BKE_subdiv_cgg_grid_to_face_index(ss->subdiv_ccg,
+ const int face_index = BKE_subdiv_ccg_grid_to_face_index(ss->subdiv_ccg,
ss->active_grid_index);
return ss->face_sets[face_index];
}
@@ -359,7 +359,7 @@ bool SCULPT_vertex_all_face_sets_visible_get(SculptSession *ss, int index)
case PBVH_GRIDS: {
const CCGKey *key = BKE_pbvh_get_grid_key(ss->pbvh);
const int grid_index = index / key->grid_area;
- const int face_index = BKE_subdiv_cgg_grid_to_face_index(ss->subdiv_ccg, grid_index);
+ const int face_index = BKE_subdiv_ccg_grid_to_face_index(ss->subdiv_ccg, grid_index);
return ss->face_sets[face_index] > 0;
}
}
@@ -382,7 +382,7 @@ void SCULPT_vertex_face_set_set(SculptSession *ss, int index, int face_set)
case PBVH_GRIDS: {
const CCGKey *key = BKE_pbvh_get_grid_key(ss->pbvh);
const int grid_index = index / key->grid_area;
- const int face_index = BKE_subdiv_cgg_grid_to_face_index(ss->subdiv_ccg, grid_index);
+ const int face_index = BKE_subdiv_ccg_grid_to_face_index(ss->subdiv_ccg, grid_index);
if (ss->face_sets[face_index] > 0) {
ss->face_sets[face_index] = abs(face_set);
}
@@ -409,7 +409,7 @@ int SCULPT_vertex_face_set_get(SculptSession *ss, int index)
case PBVH_GRIDS: {
const CCGKey *key = BKE_pbvh_get_grid_key(ss->pbvh);
const int grid_index = index / key->grid_area;
- const int face_index = BKE_subdiv_cgg_grid_to_face_index(ss->subdiv_ccg, grid_index);
+ const int face_index = BKE_subdiv_ccg_grid_to_face_index(ss->subdiv_ccg, grid_index);
return ss->face_sets[face_index];
}
}
@@ -433,7 +433,7 @@ bool SCULPT_vertex_has_face_set(SculptSession *ss, int index, int face_set)
case PBVH_GRIDS: {
const CCGKey *key = BKE_pbvh_get_grid_key(ss->pbvh);
const int grid_index = index / key->grid_area;
- const int face_index = BKE_subdiv_cgg_grid_to_face_index(ss->subdiv_ccg, grid_index);
+ const int face_index = BKE_subdiv_ccg_grid_to_face_index(ss->subdiv_ccg, grid_index);
return ss->face_sets[face_index] == face_set;
}
}
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index 8b562413ce8..03e0d1829c5 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -741,7 +741,7 @@ void GPU_pbvh_grid_buffers_update(GPU_PBVH_Buffers *buffers,
uchar face_set_color[4] = {UCHAR_MAX, UCHAR_MAX, UCHAR_MAX, UCHAR_MAX};
if (show_face_sets && subdiv_ccg && sculpt_face_sets) {
- const int face_index = BKE_subdiv_cgg_grid_to_face_index(subdiv_ccg, grid_index);
+ const int face_index = BKE_subdiv_ccg_grid_to_face_index(subdiv_ccg, grid_index);
const int fset = abs(sculpt_face_sets[face_index]);
/* Skip for the default color Face Set to render it white. */