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:
authorCampbell Barton <ideasman42@gmail.com>2017-03-11 19:00:06 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-03-11 19:00:06 +0300
commitfbb1b311ea189b4d215cdfca3f507acb29ad2f3f (patch)
treeda426f375bb7ffc5cad6227931fa99ee8a5e9919 /source/blender/gpu
parentcdb7498f663e539f05bc314c4e80c55ba45cdc02 (diff)
parentbcc8c04db4a111b692660a7706757290a5f03465 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/intern/gpu_debug.c36
-rw-r--r--source/blender/gpu/intern/gpu_select_pick.c24
-rw-r--r--source/blender/gpu/intern/gpu_select_private.h5
-rw-r--r--source/blender/gpu/intern/gpu_select_sample_query.c2
4 files changed, 37 insertions, 30 deletions
diff --git a/source/blender/gpu/intern/gpu_debug.c b/source/blender/gpu/intern/gpu_debug.c
index bfda589b452..eeeb6e0ab33 100644
--- a/source/blender/gpu/intern/gpu_debug.c
+++ b/source/blender/gpu/intern/gpu_debug.c
@@ -47,17 +47,17 @@
/* control whether we use older AMD_debug_output extension
* some supported GPU + OS combos do not have the newer extensions */
- #define LEGACY_DEBUG 1
+# define LEGACY_DEBUG 1
/* Debug callbacks need the same calling convention as OpenGL functions. */
- #if defined(_WIN32)
- #define APIENTRY __stdcall
- #else
- #define APIENTRY
- #endif
+# if defined(_WIN32)
+# define APIENTRY __stdcall
+# else
+# define APIENTRY
+# endif
-static const char* source_name(GLenum source)
+static const char *source_name(GLenum source)
{
switch (source) {
case GL_DEBUG_SOURCE_API: return "API";
@@ -70,7 +70,7 @@ static const char* source_name(GLenum source)
}
}
-static const char* message_type_name(GLenum message)
+static const char *message_type_name(GLenum message)
{
switch (message) {
case GL_DEBUG_TYPE_ERROR: return "error";
@@ -107,9 +107,9 @@ static void APIENTRY gpu_debug_proc(
}
}
- #if LEGACY_DEBUG
+# if LEGACY_DEBUG
-static const char* category_name_amd(GLenum category)
+static const char *category_name_amd(GLenum category)
{
switch (category) {
case GL_DEBUG_CATEGORY_API_ERROR_AMD: return "API error";
@@ -145,9 +145,9 @@ static void APIENTRY gpu_debug_proc_amd(
fflush(stderr);
}
}
- #endif /* LEGACY_DEBUG */
+# endif /* LEGACY_DEBUG */
- #undef APIENTRY
+# undef APIENTRY
#endif /* not Apple */
void gpu_debug_init(void)
@@ -172,14 +172,14 @@ void gpu_debug_init(void)
glDebugMessageControlARB(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, NULL, GL_TRUE);
GPU_string_marker(success);
}
- #if LEGACY_DEBUG
+# if LEGACY_DEBUG
else if (GLEW_AMD_debug_output) {
fprintf(stderr, "Using AMD_debug_output extension\n");
glDebugMessageCallbackAMD(gpu_debug_proc_amd, mxGetCurrentContext());
glDebugMessageEnableAMD(GL_DONT_CARE, GL_DONT_CARE, 0, NULL, GL_TRUE);
GPU_string_marker(success);
}
- #endif
+# endif
else {
fprintf(stderr, "Failed to hook OpenGL debug callback.\n");
}
@@ -196,11 +196,11 @@ void gpu_debug_exit(void)
else if (GLEW_ARB_debug_output) {
glDebugMessageCallbackARB(NULL, NULL);
}
- #if LEGACY_DEBUG
+# if LEGACY_DEBUG
else if (GLEW_AMD_debug_output) {
glDebugMessageCallbackAMD(NULL, NULL);
}
- #endif
+# endif
#endif
}
@@ -219,13 +219,13 @@ void GPU_string_marker(const char *buf)
GL_DEBUG_SOURCE_APPLICATION_ARB, GL_DEBUG_TYPE_OTHER_ARB, 0,
GL_DEBUG_SEVERITY_LOW_ARB, -1, buf);
}
- #if LEGACY_DEBUG
+# if LEGACY_DEBUG
else if (GLEW_AMD_debug_output) {
glDebugMessageInsertAMD(
GL_DEBUG_CATEGORY_APPLICATION_AMD, GL_DEBUG_SEVERITY_LOW_AMD, 0,
0, buf);
}
- #endif
+# endif
#endif /* not Apple */
}
diff --git a/source/blender/gpu/intern/gpu_select_pick.c b/source/blender/gpu/intern/gpu_select_pick.c
index 07521dfa060..0a77420fa25 100644
--- a/source/blender/gpu/intern/gpu_select_pick.c
+++ b/source/blender/gpu/intern/gpu_select_pick.c
@@ -44,6 +44,8 @@
#include "gpu_select_private.h"
+#include "BLI_strict_flags.h"
+
/* #define DEBUG_PRINT */
/* Alloc number for depths */
@@ -85,10 +87,10 @@ static void rect_subregion_stride_calc(const rcti *src, const rcti *dst, SubRect
src->ymax >= dst->ymax && src->ymax >= dst->ymax);
BLI_assert(x >= 0 && y >= 0);
- 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->start = (unsigned int)((src_x * y) + x);
+ r_sub->span = (unsigned int)dst_x;
+ r_sub->span_len = (unsigned int)dst_y;
+ r_sub->skip = (unsigned int)(src_x - dst_x);
}
/**
@@ -308,7 +310,7 @@ void gpu_select_pick_begin(
ps->buffer = buffer;
ps->mode = mode;
- const unsigned int rect_len = BLI_rcti_size_x(input) * BLI_rcti_size_y(input);
+ const unsigned int rect_len = (unsigned int)(BLI_rcti_size_x(input) * BLI_rcti_size_y(input));
ps->dst.clip_rect = *input;
ps->dst.rect_len = rect_len;
@@ -329,9 +331,9 @@ void gpu_select_pick_begin(
glDepthFunc(GL_LEQUAL);
}
- glPixelTransferi(GL_DEPTH_BIAS, 0.0);
- glPixelTransferi(GL_DEPTH_SCALE, 1.0);
-
+ /* set just in case */
+ glPixelTransferf(GL_DEPTH_BIAS, 0.0);
+ glPixelTransferf(GL_DEPTH_SCALE, 1.0);
float viewport[4];
glGetFloatv(GL_SCISSOR_BOX, viewport);
@@ -339,8 +341,8 @@ void gpu_select_pick_begin(
ps->src.clip_rect = *input;
ps->src.rect_len = rect_len;
- ps->gl.clip_readpixels[0] = viewport[0];
- ps->gl.clip_readpixels[1] = viewport[1];
+ ps->gl.clip_readpixels[0] = (int)viewport[0];
+ ps->gl.clip_readpixels[1] = (int)viewport[1];
ps->gl.clip_readpixels[2] = BLI_rcti_size_x(&ps->src.clip_rect);
ps->gl.clip_readpixels[3] = BLI_rcti_size_y(&ps->src.clip_rect);
@@ -643,7 +645,7 @@ unsigned int gpu_select_pick_end(void)
unsigned int hits = 0;
if (depth_data_len > maxhits) {
- hits = -1;
+ hits = (unsigned int)-1;
}
else {
/* leave sorting up to the caller */
diff --git a/source/blender/gpu/intern/gpu_select_private.h b/source/blender/gpu/intern/gpu_select_private.h
index 631b8806af9..8935bd7b253 100644
--- a/source/blender/gpu/intern/gpu_select_private.h
+++ b/source/blender/gpu/intern/gpu_select_private.h
@@ -29,6 +29,9 @@
* Selection implementations.
*/
+#ifndef __GPU_SELECT_PRIVATE_H__
+#define __GPU_SELECT_PRIVATE_H__
+
/* gpu_select_pick */
void gpu_select_pick_begin(unsigned int (*buffer)[4], unsigned int bufsize, const rcti *input, char mode);
bool gpu_select_pick_load_id(unsigned int id);
@@ -46,3 +49,5 @@ unsigned int gpu_select_query_end(void);
#define SELECT_ID_NONE ((unsigned int)0xffffffff)
+
+#endif /* __GPU_SELECT_PRIVATE_H__ */
diff --git a/source/blender/gpu/intern/gpu_select_sample_query.c b/source/blender/gpu/intern/gpu_select_sample_query.c
index 5576367edd9..ba5fefc5227 100644
--- a/source/blender/gpu/intern/gpu_select_sample_query.c
+++ b/source/blender/gpu/intern/gpu_select_sample_query.c
@@ -23,7 +23,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/gpu/intern/gpu_select.c
+/** \file blender/gpu/intern/gpu_select_sample_query.c
* \ingroup gpu
*
* Interface for accessing gpu-related methods for selection. The semantics will be