[Bf-blender-cvs] [57b538e062] temp-select-pick: Minor rename
Campbell Barton
noreply at git.blender.org
Wed Mar 8 12:50:47 CET 2017
Commit: 57b538e062f7d3b305b610163c9d1d7c463dccbd
Author: Campbell Barton
Date: Wed Mar 8 22:53:55 2017 +1100
Branches: temp-select-pick
https://developer.blender.org/rB57b538e062f7d3b305b610163c9d1d7c463dccbd
Minor rename
===================================================================
M source/blender/gpu/intern/gpu_select_pick.c
===================================================================
diff --git a/source/blender/gpu/intern/gpu_select_pick.c b/source/blender/gpu/intern/gpu_select_pick.c
index f72da4c5dd..0b333c2643 100644
--- a/source/blender/gpu/intern/gpu_select_pick.c
+++ b/source/blender/gpu/intern/gpu_select_pick.c
@@ -57,10 +57,10 @@
/* For looping over a sub-region of a rect, could be moved into 'rct.c'*/
typedef struct SubRectStride {
- unsigned int start; /* start here */
- unsigned int span; /* read these */
- unsigned int skip; /* skip those */
- unsigned int len; /* len times (read span 'len' times). */
+ unsigned int start; /* start here */
+ unsigned int span; /* read these */
+ unsigned int span_len; /* len times (read span 'len' times). */
+ unsigned int skip; /* skip those */
} SubRectStride;
/**
@@ -83,8 +83,8 @@ static void rect_subregion_stride_calc(const rcti *src, const rcti *dst, SubRect
r_sub->start = (src_x * y) + x;
r_sub->span = dst_x;
+ r_sub->span_len = dst_y;
r_sub->skip = src_x - dst_x;
- r_sub->len = dst_y;
}
/* store result of glReadPixels */
@@ -111,7 +111,7 @@ static bool depth_buf_subrect_equal(
/* same as above but different rect sizes */
const float *prev = rect_src->buf + sub_rect->start;
const float *curr = rect_dst->buf + sub_rect->start;
- for (unsigned int i = 0; i < sub_rect->len; i++) {
+ for (unsigned int i = 0; i < sub_rect->span_len; i++) {
const float *prev_end = prev + sub_rect->span;
for (; prev < prev_end; prev++, curr++) {
if (*prev != *curr) {
@@ -339,7 +339,7 @@ static void gpu_select_load_id_pass(const DepthBufCache *rect_depth, const Depth
/* same as above but different rect sizes */
const float *prev = rect_depth->buf + ps->cache.sub_rect.start;
const float *curr = rect_depth_test->buf + ps->cache.sub_rect.start;
- for (unsigned int i = 0; i < ps->cache.sub_rect.len; i++) {
+ for (unsigned int i = 0; i < ps->cache.sub_rect.span_len; i++) {
const float *prev_end = prev + ps->cache.sub_rect.span;
for (; prev < prev_end; prev++, curr++) {
EVAL_TEST();
@@ -383,7 +383,7 @@ static void gpu_select_load_id_pass(const DepthBufCache *rect_depth, const Depth
/* same as above but different rect sizes */
const float *prev = rect_depth->buf + ps->cache.sub_rect.start;
const float *curr = rect_depth_test->buf + ps->cache.sub_rect.start;
- for (unsigned int i = 0; i < ps->cache.sub_rect.len; i++) {
+ for (unsigned int i = 0; i < ps->cache.sub_rect.span_len; i++) {
const float *prev_end = prev + ps->cache.sub_rect.span;
for (; prev < prev_end; prev++, curr++, id_ptr++) {
EVAL_TEST();
@@ -511,7 +511,7 @@ unsigned int gpu_select_pick_end(void)
else {
/* same as above but different rect sizes */
unsigned int i_src = ps->cache.sub_rect.start, i_dst = 0;
- for (unsigned int j = 0; j < ps->cache.sub_rect.len; j++) {
+ for (unsigned int j = 0; j < ps->cache.sub_rect.span_len; j++) {
const unsigned int i_src_end = i_src + ps->cache.sub_rect.span;
for (; i_src < i_src_end; i_src++, i_dst++) {
EVAL_TEST(i_src, i_dst);
@@ -627,6 +627,8 @@ void gpu_select_pick_cache_load_id(void)
#endif
for (DepthBufCache *rect_depth = ps->cache.bufs.first; rect_depth; rect_depth = rect_depth->next) {
if (rect_depth->next != NULL) {
+ /* we know the buffers differ, but this sub-region may not.
+ * double check before adding an id-pass */
if (!depth_buf_subrect_equal(&ps->cache.sub_rect, rect_depth, rect_depth->next)) {
gpu_select_load_id_pass(rect_depth, rect_depth->next);
}
More information about the Bf-blender-cvs
mailing list