Merge branch 'master' into blender2.8

This commit is contained in:
2018-06-04 09:10:51 +02:00
13 changed files with 37 additions and 37 deletions

View File

@@ -40,7 +40,7 @@ struct Image;
struct ImageUser;
struct PreviewImage;
struct Gwn_VertBuf;
struct GPUFrameBuffer;
typedef struct GPUTexture GPUTexture;

View File

@@ -169,7 +169,7 @@ void GPU_basic_shaders_init(void)
void GPU_basic_shaders_exit(void)
{
int i;
for (i = 0; i < GPU_SHADER_OPTION_COMBINATIONS; i++)
if (GPU_MATERIAL_STATE.cached_shaders[i])
GPU_shader_free(GPU_MATERIAL_STATE.cached_shaders[i]);
@@ -238,7 +238,7 @@ static GPUShader *gpu_basic_shader(int options)
geom_glsl,
NULL,
defines);
if (shader) {
/* set texture map to first texture unit */
if (options & (GPU_SHADER_TEXTURE_2D | GPU_SHADER_TEXTURE_RECT)) {

View File

@@ -460,7 +460,7 @@ void GPU_pbvh_grid_buffers_update(
vbo_index += 1;
}
}
if (!buffers->smooth) {
for (j = 0; j < key->grid_size - 1; j++) {
for (k = 0; k < key->grid_size - 1; k++) {
@@ -865,7 +865,7 @@ void GPU_pbvh_bmesh_buffers_update(
fmask += BM_ELEM_CD_GET_FLOAT(v[i], cd_vert_mask_offset);
}
fmask /= 3.0f;
for (i = 0; i < 3; i++) {
gpu_bmesh_vert_to_buffer_copy__gwn(
v[i], buffers->vert_buf,

View File

@@ -159,7 +159,7 @@ static int gpu_str_prefix(const char *str, const char *prefix)
str++;
prefix++;
}
return (*prefix == '\0');
}
@@ -278,7 +278,7 @@ static char *gpu_generate_function_prototyps(GHash *hash)
GPUFunction *function;
char *name, *prototypes;
int a;
/* automatically generate function prototypes to add to the top of the
* generated code, to avoid have to add the actual code & recompile all */
ghi = BLI_ghashIterator_new(hash);
@@ -716,7 +716,7 @@ static void codegen_call_functions(DynStr *ds, ListBase *nodes, GPUOutput *final
for (node = nodes->first; node; node = node->next) {
BLI_dynstr_appendf(ds, "\t%s(", node->name);
for (input = node->inputs.first; input; input = input->next) {
if (input->source == GPU_SOURCE_TEX) {
BLI_dynstr_appendf(ds, "samp%d", input->texid);
@@ -1230,7 +1230,7 @@ void GPU_pass_unbind(GPUPass *pass, ListBase *inputs)
if (input->ima || input->prv)
input->tex = NULL;
}
GPU_shader_unbind();
}
@@ -1251,7 +1251,7 @@ static void gpu_node_link_free(GPUNodeLink *link)
if (link->users < 0)
fprintf(stderr, "GPU_node_link_free: negative refcount\n");
if (link->users == 0) {
if (link->output)
link->output->link = NULL;
@@ -1292,7 +1292,7 @@ static void gpu_node_input_link(GPUNode *node, GPUNodeLink *link, const GPUType
return;
}
}
input = MEM_callocN(sizeof(GPUInput), "GPUInput");
input->node = node;
@@ -1683,10 +1683,10 @@ GPUNodeLink *GPU_cube_map(Image *ima, ImageUser *iuser, bool is_data)
GPUNodeLink *GPU_image_preview(PreviewImage *prv)
{
GPUNodeLink *link = GPU_node_link_create();
link->image = GPU_NODE_LINK_IMAGE_PREVIEW;
link->ptr1 = prv;
return link;
}
@@ -1870,7 +1870,7 @@ static void gpu_nodes_tag(GPUNodeLink *link)
node = link->output->node;
if (node->tag)
return;
node->tag = true;
for (input = node->inputs.first; input; input = input->next)
if (input->link)

View File

@@ -680,7 +680,7 @@ GPUOffScreen *GPU_offscreen_create(int width, int height, int samples, bool dept
if (!GPU_framebuffer_check_valid(ofs->fb, err_out)) {
GPU_offscreen_free(ofs);
gpuPopAttrib();
return NULL;
return NULL;
}
GPU_framebuffer_restore();
@@ -698,7 +698,7 @@ void GPU_offscreen_free(GPUOffScreen *ofs)
GPU_texture_free(ofs->color);
if (ofs->depth)
GPU_texture_free(ofs->depth);
MEM_freeN(ofs);
}

View File

@@ -87,7 +87,7 @@ struct GPUMaterial {
const void *engine_type; /* attached engine type */
int options; /* to identify shader variations (shadow, probe, world background...) */
/* for creating the material */
ListBase nodes;
GPUNodeLink *outlink;
@@ -670,6 +670,6 @@ void GPU_materials_free(void)
for (wo = G.main->world.first; wo; wo = wo->id.next)
GPU_material_free(&wo->gpumaterial);
GPU_material_free(&defmaterial.gpumaterial);
}

View File

@@ -36,7 +36,7 @@
#include "GPU_select.h"
#include "GPU_extensions.h"
#include "GPU_glew.h"
#include "MEM_guardedalloc.h"
#include "BLI_rect.h"

View File

@@ -37,7 +37,7 @@
#include "GPU_select.h"
#include "GPU_extensions.h"
#include "GPU_glew.h"
#include "MEM_guardedalloc.h"
#include "BLI_rect.h"

View File

@@ -189,11 +189,11 @@ static void shader_print_errors(const char *task, const char *log, const char **
c = pos + 1;
line++;
}
fprintf(stderr, "%s", c);
}
}
fprintf(stderr, "%s\n", log);
}

View File

@@ -736,10 +736,10 @@ GPUTexture *GPU_texture_from_preview(PreviewImage *prv, int mipmap)
{
GPUTexture *tex = prv->gputexture[0];
GLuint bindcode = 0;
if (tex)
bindcode = tex->bindcode;
/* this binds a texture, so that's why we restore it to 0 */
if (bindcode == 0) {
GPU_create_gl_tex(&bindcode, prv->rect[0], NULL, prv->w[0], prv->h[0], GL_TEXTURE_2D, mipmap, 0, NULL);
@@ -758,9 +758,9 @@ GPUTexture *GPU_texture_from_preview(PreviewImage *prv, int mipmap)
tex->target_base = GL_TEXTURE_2D;
tex->format = -1;
tex->components = -1;
prv->gputexture[0] = tex;
if (!glIsTexture(tex->bindcode)) {
GPU_print_error_debug("Blender Texture Not Loaded");
}
@@ -770,13 +770,13 @@ GPUTexture *GPU_texture_from_preview(PreviewImage *prv, int mipmap)
glBindTexture(GL_TEXTURE_2D, tex->bindcode);
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w);
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &h);
tex->w = w;
tex->h = h;
}
glBindTexture(GL_TEXTURE_2D, 0);
return tex;
}
@@ -1104,7 +1104,7 @@ void GPU_texture_free(GPUTexture *tex)
if (tex->refcount < 0)
fprintf(stderr, "GPUTexture: negative refcount\n");
if (tex->refcount == 0) {
for (int i = 0; i < GPU_TEX_MAX_FBO_ATTACHED; ++i) {
if (tex->fb[i] != NULL) {
@@ -1116,7 +1116,7 @@ void GPU_texture_free(GPUTexture *tex)
if (BLI_thread_is_main()) {
gpu_texture_delete(tex);
}
else{
else {
BLI_mutex_lock(&g_orphan_lock);
BLI_addtail(&g_orphaned_tex, BLI_genericNodeN(tex));
BLI_mutex_unlock(&g_orphan_lock);
@@ -1133,7 +1133,7 @@ void GPU_texture_delete_orphans(void)
{
BLI_mutex_lock(&g_orphan_lock);
LinkData *link;
while((link = BLI_pophead(&g_orphaned_tex))) {
while ((link = BLI_pophead(&g_orphaned_tex))) {
gpu_texture_delete((GPUTexture *)link->data);
MEM_freeN(link);
}

View File

@@ -58,8 +58,8 @@ void main()
#elif !defined(GPU_ATI)
// Setting gl_ClipVertex is necessary to get glClipPlane working on NVIDIA
// graphic cards, while on ATI it can cause a software fallback.
gl_ClipVertex = co;
#endif
gl_ClipVertex = co;
#endif
#ifdef USE_COLOR
#ifdef DRAW_LINE

View File

@@ -59,4 +59,4 @@ void main()
#else
vert_dof_final();
#endif
}
}

View File

@@ -103,8 +103,8 @@ void main()
#elif !defined(GPU_ATI)
// Setting gl_ClipVertex is necessary to get glClipPlane working on NVIDIA
// graphic cards, while on ATI it can cause a software fallback.
gl_ClipVertex = co;
#endif
gl_ClipVertex = co;
#endif
#ifdef USE_OPENSUBDIV
outpt.v.position = co;