Cleanup: use lowercase gpu prefix for static funcs
This was mostly followed already.
This commit is contained in:
@@ -407,7 +407,7 @@ static GPUShader *gpu_basic_shader(int options)
|
||||
return shader;
|
||||
}
|
||||
|
||||
static void GPU_basic_shader_uniform_autoset(GPUShader *shader, int options)
|
||||
static void gpu_basic_shader_uniform_autoset(GPUShader *shader, int options)
|
||||
{
|
||||
if (options & GPU_SHADER_LINE) {
|
||||
glGetIntegerv(GL_VIEWPORT, &GPU_MATERIAL_STATE.viewport[0]);
|
||||
@@ -443,7 +443,7 @@ void GPU_basic_shader_bind(int options)
|
||||
|
||||
if (shader) {
|
||||
GPU_shader_bind(shader);
|
||||
GPU_basic_shader_uniform_autoset(shader, options);
|
||||
gpu_basic_shader_uniform_autoset(shader, options);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@@ -743,7 +743,7 @@ void GPU_triangle_setup(struct DerivedMesh *dm)
|
||||
GLStates |= GPU_BUFFER_ELEMENT_STATE;
|
||||
}
|
||||
|
||||
static int GPU_typesize(int type)
|
||||
static int gpu_typesize(int type)
|
||||
{
|
||||
switch (type) {
|
||||
case GL_FLOAT:
|
||||
@@ -766,7 +766,7 @@ int GPU_attrib_element_size(GPUAttrib data[], int numdata)
|
||||
int i, elementsize = 0;
|
||||
|
||||
for (i = 0; i < numdata; i++) {
|
||||
int typesize = GPU_typesize(data[i].type);
|
||||
int typesize = gpu_typesize(data[i].type);
|
||||
if (typesize != 0)
|
||||
elementsize += typesize * data[i].size;
|
||||
}
|
||||
@@ -803,7 +803,7 @@ void GPU_interleaved_attrib_setup(GPUBuffer *buffer, GPUAttrib data[], int numda
|
||||
|
||||
glVertexAttribPointer(data[i].index, data[i].size, data[i].type,
|
||||
GL_TRUE, elementsize, BUFFER_OFFSET(offset));
|
||||
offset += data[i].size * GPU_typesize(data[i].type);
|
||||
offset += data[i].size * gpu_typesize(data[i].type);
|
||||
|
||||
attribData[i].index = data[i].index;
|
||||
attribData[i].size = data[i].size;
|
||||
|
@@ -1203,7 +1203,7 @@ void GPU_paint_set_mipmap(bool mipmap)
|
||||
|
||||
|
||||
/* check if image has been downscaled and do scaled partial update */
|
||||
static bool GPU_check_scaled_image(ImBuf *ibuf, Image *ima, float *frect, int x, int y, int w, int h)
|
||||
static bool gpu_check_scaled_image(ImBuf *ibuf, Image *ima, float *frect, int x, int y, int w, int h)
|
||||
{
|
||||
if ((!GPU_full_non_power_of_two_support() && !is_power_of_2_resolution(ibuf->x, ibuf->y)) ||
|
||||
is_over_resolution_limit(GL_TEXTURE_2D, ibuf->x, ibuf->y))
|
||||
@@ -1296,7 +1296,7 @@ void GPU_paint_update_image(Image *ima, ImageUser *iuser, int x, int y, int w, i
|
||||
bool is_data = (ima->tpageflag & IMA_GLBIND_IS_DATA) != 0;
|
||||
IMB_partial_rect_from_float(ibuf, buffer, x, y, w, h, is_data);
|
||||
|
||||
if (GPU_check_scaled_image(ibuf, ima, buffer, x, y, w, h)) {
|
||||
if (gpu_check_scaled_image(ibuf, ima, buffer, x, y, w, h)) {
|
||||
MEM_freeN(buffer);
|
||||
BKE_image_release_ibuf(ima, ibuf, NULL);
|
||||
return;
|
||||
@@ -1320,7 +1320,7 @@ void GPU_paint_update_image(Image *ima, ImageUser *iuser, int x, int y, int w, i
|
||||
return;
|
||||
}
|
||||
|
||||
if (GPU_check_scaled_image(ibuf, ima, NULL, x, y, w, h)) {
|
||||
if (gpu_check_scaled_image(ibuf, ima, NULL, x, y, w, h)) {
|
||||
BKE_image_release_ibuf(ima, ibuf, NULL);
|
||||
return;
|
||||
}
|
||||
@@ -1870,7 +1870,7 @@ void GPU_begin_object_materials(
|
||||
GPU_object_material_unbind();
|
||||
}
|
||||
|
||||
static int GPU_get_particle_info(GPUParticleInfo *pi)
|
||||
static int gpu_get_particle_info(GPUParticleInfo *pi)
|
||||
{
|
||||
DupliObject *dob = GMS.dob;
|
||||
if (dob->particle_system) {
|
||||
@@ -1964,8 +1964,9 @@ int GPU_object_material_bind(int nr, void *attribs)
|
||||
GPUMaterial *gpumat = GPU_material_from_blender(GMS.gscene, mat, GMS.is_opensubdiv);
|
||||
GPU_material_vertex_attributes(gpumat, gattribs);
|
||||
|
||||
if (GMS.dob)
|
||||
GPU_get_particle_info(&partile_info);
|
||||
if (GMS.dob) {
|
||||
gpu_get_particle_info(&partile_info);
|
||||
}
|
||||
|
||||
GPU_material_bind(
|
||||
gpumat, GMS.gob->lay, GMS.glay, 1.0, !(GMS.gob->mode & OB_MODE_TEXTURE_PAINT),
|
||||
|
@@ -52,7 +52,7 @@ struct GPUFrameBuffer {
|
||||
GPUTexture *depthtex;
|
||||
};
|
||||
|
||||
static void GPU_print_framebuffer_error(GLenum status, char err_out[256])
|
||||
static void gpu_print_framebuffer_error(GLenum status, char err_out[256])
|
||||
{
|
||||
const char *err = "unknown";
|
||||
|
||||
@@ -164,7 +164,7 @@ int GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex, int slot
|
||||
|
||||
if (error == GL_INVALID_OPERATION) {
|
||||
GPU_framebuffer_restore();
|
||||
GPU_print_framebuffer_error(error, err_out);
|
||||
gpu_print_framebuffer_error(error, err_out);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -331,7 +331,7 @@ bool GPU_framebuffer_check_valid(GPUFrameBuffer *fb, char err_out[256])
|
||||
|
||||
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
|
||||
GPU_framebuffer_restore();
|
||||
GPU_print_framebuffer_error(status, err_out);
|
||||
gpu_print_framebuffer_error(status, err_out);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -225,7 +225,7 @@ static void gpu_material_set_attrib_id(GPUMaterial *material)
|
||||
attribs->totlayer = b;
|
||||
}
|
||||
|
||||
static int GPU_material_construct_end(GPUMaterial *material, const char *passname)
|
||||
static int gpu_material_construct_end(GPUMaterial *material, const char *passname)
|
||||
{
|
||||
if (material->outlink) {
|
||||
GPUNodeLink *outlink = material->outlink;
|
||||
@@ -1891,7 +1891,7 @@ GPUMaterial *GPU_material_matcap(Scene *scene, Material *ma, bool use_opensubdiv
|
||||
|
||||
GPU_material_output_link(mat, outlink);
|
||||
|
||||
GPU_material_construct_end(mat, "matcap_pass");
|
||||
gpu_material_construct_end(mat, "matcap_pass");
|
||||
|
||||
/* note that even if building the shader fails in some way, we still keep
|
||||
* it to avoid trying to compile again and again, and simple do not use
|
||||
@@ -2044,7 +2044,7 @@ static void do_world_tex(GPUShadeInput *shi, struct World *wo, GPUNodeLink **hor
|
||||
}
|
||||
}
|
||||
|
||||
static void GPU_material_old_world(struct GPUMaterial *mat, struct World *wo)
|
||||
static void gpu_material_old_world(struct GPUMaterial *mat, struct World *wo)
|
||||
{
|
||||
GPUShadeInput shi;
|
||||
GPUShadeResult shr;
|
||||
@@ -2112,17 +2112,18 @@ GPUMaterial *GPU_material_world(struct Scene *scene, struct World *wo)
|
||||
mat->type = GPU_MATERIAL_TYPE_WORLD;
|
||||
|
||||
/* create nodes */
|
||||
if (BKE_scene_use_new_shading_nodes(scene) && wo->nodetree && wo->use_nodes)
|
||||
if (BKE_scene_use_new_shading_nodes(scene) && wo->nodetree && wo->use_nodes) {
|
||||
ntreeGPUMaterialNodes(wo->nodetree, mat, NODE_NEW_SHADING);
|
||||
}
|
||||
else {
|
||||
GPU_material_old_world(mat, wo);
|
||||
gpu_material_old_world(mat, wo);
|
||||
}
|
||||
|
||||
if (GPU_material_do_color_management(mat))
|
||||
if (mat->outlink)
|
||||
GPU_link(mat, "linearrgb_to_srgb", mat->outlink, &mat->outlink);
|
||||
|
||||
GPU_material_construct_end(mat, wo->id.name);
|
||||
gpu_material_construct_end(mat, wo->id.name);
|
||||
|
||||
/* note that even if building the shader fails in some way, we still keep
|
||||
* it to avoid trying to compile again and again, and simple do not use
|
||||
@@ -2188,7 +2189,7 @@ GPUMaterial *GPU_material_from_blender(Scene *scene, Material *ma, bool use_open
|
||||
if (mat->outlink)
|
||||
GPU_link(mat, "linearrgb_to_srgb", mat->outlink, &mat->outlink);
|
||||
|
||||
GPU_material_construct_end(mat, ma->id.name);
|
||||
gpu_material_construct_end(mat, ma->id.name);
|
||||
|
||||
/* note that even if building the shader fails in some way, we still keep
|
||||
* it to avoid trying to compile again and again, and simple do not use
|
||||
|
@@ -79,7 +79,7 @@ static unsigned char *GPU_texture_convert_pixels(int length, const float *fpixel
|
||||
return pixels;
|
||||
}
|
||||
|
||||
static void GPU_glTexSubImageEmpty(GLenum target, GLenum format, int x, int y, int w, int h)
|
||||
static void gpu_glTexSubImageEmpty(GLenum target, GLenum format, int x, int y, int w, int h)
|
||||
{
|
||||
void *pixels = MEM_callocN(sizeof(char) * 4 * w * h, "GPUTextureEmptyPixels");
|
||||
|
||||
@@ -193,7 +193,7 @@ static GPUTexture *GPU_texture_create_nD(
|
||||
pixels ? pixels : fpixels);
|
||||
|
||||
if (tex->w > w) {
|
||||
GPU_glTexSubImageEmpty(tex->target, format, w, 0, tex->w - w, 1);
|
||||
gpu_glTexSubImageEmpty(tex->target, format, w, 0, tex->w - w, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -210,10 +210,12 @@ static GPUTexture *GPU_texture_create_nD(
|
||||
glTexSubImage2D(tex->target, 0, 0, 0, w, h,
|
||||
format, type, pixels ? pixels : fpixels);
|
||||
|
||||
if (tex->w > w)
|
||||
GPU_glTexSubImageEmpty(tex->target, format, w, 0, tex->w - w, tex->h);
|
||||
if (tex->h > h)
|
||||
GPU_glTexSubImageEmpty(tex->target, format, 0, h, w, tex->h - h);
|
||||
if (tex->w > w) {
|
||||
gpu_glTexSubImageEmpty(tex->target, format, w, 0, tex->w - w, tex->h);
|
||||
}
|
||||
if (tex->h > h) {
|
||||
gpu_glTexSubImageEmpty(tex->target, format, 0, h, w, tex->h - h);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user