Blender V2.61 - r43446
|
#include "GL/glew.h"
#include "DNA_image_types.h"
#include "MEM_guardedalloc.h"
#include "BKE_global.h"
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
#include "BLI_math_base.h"
#include "GPU_draw.h"
#include "GPU_extensions.h"
#include "gpu_codegen.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "BLI_winstuff.h"
Go to the source code of this file.
Definition in file gpu_extensions.c.
int GPU_color_depth | ( | void | ) |
Definition at line 216 of file gpu_extensions.c.
References GPUGlobal::colordepth, and GG.
Referenced by index_to_framebuffer(), wm_automatic_draw_method(), and WM_framebuffer_to_index().
void GPU_extensions_disable | ( | void | ) |
Definition at line 91 of file gpu_extensions.c.
References GPUGlobal::extdisabled, and GG.
Referenced by no_glsl().
void GPU_extensions_exit | ( | void | ) |
Definition at line 192 of file gpu_extensions.c.
References GPU_codegen_exit(), and gpu_extensions_init.
Referenced by GPG_Application::exitEngine(), and WM_exit_ext().
void GPU_extensions_init | ( | void | ) |
Definition at line 96 of file gpu_extensions.c.
References GPUGlobal::colordepth, GPUGlobal::device, GPUGlobal::driver, g, GG, GPUGlobal::glslsupport, GPU_codegen_init(), GPU_DEVICE_ANY, GPU_DEVICE_ATI, GPU_DEVICE_INTEL, GPU_DEVICE_NVIDIA, GPU_DEVICE_SOFTWARE, GPU_DRIVER_ANY, GPU_DRIVER_OFFICIAL, GPU_DRIVER_OPENSOURCE, GPU_DRIVER_SOFTWARE, gpu_extensions_init, GPU_OS_MAC, GPU_OS_UNIX, GPU_OS_WIN, GPUGlobal::maxtextures, GPUGlobal::npotdisabled, and GPUGlobal::os.
Referenced by GPG_Application::initEngine(), WM_init(), and wm_window_add_ghostwindow().
GPUFrameBuffer* GPU_framebuffer_create | ( | void | ) |
Definition at line 694 of file gpu_extensions.c.
References fb(), GPU_framebuffer_free(), MEM_callocN(), NULL, and GPUFrameBuffer::object.
Referenced by GPU_lamp_from_blender(), and GPU_offscreen_create().
void GPU_framebuffer_free | ( | GPUFrameBuffer * | fb | ) |
Definition at line 820 of file gpu_extensions.c.
References GPUFrameBuffer::colortex, GPUGlobal::currentfb, GPUFrameBuffer::depthtex, GG, GPU_framebuffer_texture_detach(), MEM_freeN(), and GPUFrameBuffer::object.
Referenced by GPU_framebuffer_create(), gpu_lamp_shadow_free(), and GPU_offscreen_free().
void GPU_framebuffer_restore | ( | void | ) |
Definition at line 839 of file gpu_extensions.c.
References GPUGlobal::currentfb, and GG.
Referenced by GPU_framebuffer_texture_attach(), GPU_lamp_from_blender(), GPU_lamp_shadow_buffer_unbind(), GPU_offscreen_create(), and GPU_offscreen_unbind().
int GPU_framebuffer_texture_attach | ( | GPUFrameBuffer * | fb, |
GPUTexture * | tex, | ||
char | err_out[256] | ||
) |
Definition at line 714 of file gpu_extensions.c.
References GPUTexture::bindcode, GPUFrameBuffer::colortex, GPUGlobal::currentfb, GPUTexture::depth, GPUFrameBuffer::depthtex, fb(), GPUTexture::fb, GG, GPU_framebuffer_restore(), GPU_print_framebuffer_error(), GPUFrameBuffer::object, and GPUTexture::target.
Referenced by GPU_lamp_from_blender(), and GPU_offscreen_create().
void GPU_framebuffer_texture_bind | ( | GPUFrameBuffer * | UNUSEDfb, |
GPUTexture * | tex, | ||
int | w, | ||
int | h | ||
) |
Definition at line 784 of file gpu_extensions.c.
References GPUGlobal::currentfb, GPUTexture::fb, GG, and GPUFrameBuffer::object.
void GPU_framebuffer_texture_detach | ( | GPUFrameBuffer * | fb, |
GPUTexture * | tex | ||
) |
Definition at line 757 of file gpu_extensions.c.
References GPUFrameBuffer::colortex, GPUGlobal::currentfb, GPUTexture::depth, GPUFrameBuffer::depthtex, GPUTexture::fb, GG, NULL, GPUFrameBuffer::object, and GPUTexture::target.
Referenced by GPU_framebuffer_free(), and GPU_texture_free().
void GPU_framebuffer_texture_unbind | ( | GPUFrameBuffer * | UNUSEDfb, |
GPUTexture * | UNUSEDtex | ||
) |
Definition at line 806 of file gpu_extensions.c.
int GPU_glsl_support | ( | void | ) |
Definition at line 198 of file gpu_extensions.c.
References GPUGlobal::extdisabled, GG, and GPUGlobal::glslsupport.
Referenced by draw_glsl_material(), draw_mesh_textured(), GPU_shader_export(), GPG_Application::initEngine(), and StartKetsjiShell().
static void GPU_glTexSubImageEmpty | ( | GLenum | target, |
GLenum | format, | ||
int | x, | ||
int | y, | ||
int | w, | ||
int | h | ||
) | [static] |
Definition at line 305 of file gpu_extensions.c.
References MEM_callocN(), and MEM_freeN().
Referenced by GPU_texture_create_nD().
int GPU_non_power_of_two_support | ( | void | ) |
Definition at line 203 of file gpu_extensions.c.
References GG, GPU_DEVICE_ATI, GPU_DRIVER_OFFICIAL, GPU_OS_MAC, GPU_type_matches(), and GPUGlobal::npotdisabled.
Referenced by draw_volume(), GPU_texture_create_3D(), GPU_texture_create_nD(), init_internal_icons(), and wm_triple_gen_textures().
void GPU_offscreen_bind | ( | GPUOffScreen * | ofs | ) |
Definition at line 912 of file gpu_extensions.c.
References GPUOffScreen::color, GPUOffScreen::fb, GPU_framebuffer_texture_bind(), GPUOffScreen::h, and GPUOffScreen::w.
Referenced by ED_view3d_draw_offscreen_imbuf(), and screen_opengl_render_apply().
GPUOffScreen* GPU_offscreen_create | ( | int | width, |
int | height, | ||
char | err_out[256] | ||
) |
Definition at line 859 of file gpu_extensions.c.
References GPUOffScreen::color, GPUOffScreen::depth, GPUOffScreen::fb, GPU_framebuffer_create(), GPU_framebuffer_restore(), GPU_framebuffer_texture_attach(), GPU_offscreen_free(), GPU_texture_create_2D(), GPU_texture_create_depth(), GPUOffScreen::h, MEM_callocN(), NULL, and GPUOffScreen::w.
Referenced by ED_view3d_draw_offscreen_imbuf(), and screen_opengl_render_init().
void GPU_offscreen_free | ( | GPUOffScreen * | ofs | ) |
Definition at line 900 of file gpu_extensions.c.
References GPUOffScreen::color, GPUOffScreen::depth, GPUOffScreen::fb, GPU_framebuffer_free(), GPU_texture_free(), and MEM_freeN().
Referenced by ED_view3d_draw_offscreen_imbuf(), GPU_offscreen_create(), and screen_opengl_render_end().
void GPU_offscreen_read_pixels | ( | GPUOffScreen * | ofs, |
int | type, | ||
void * | pixels | ||
) |
Definition at line 925 of file gpu_extensions.c.
References GPUOffScreen::h, and GPUOffScreen::w.
Referenced by ED_view3d_draw_offscreen_imbuf(), and screen_opengl_render_apply().
void GPU_offscreen_unbind | ( | GPUOffScreen * | ofs | ) |
Definition at line 918 of file gpu_extensions.c.
References GPUOffScreen::color, GPUOffScreen::fb, GPU_framebuffer_restore(), and GPU_framebuffer_texture_unbind().
Referenced by ED_view3d_draw_offscreen_imbuf(), and screen_opengl_render_apply().
int GPU_print_error | ( | const char * | str | ) |
Definition at line 221 of file gpu_extensions.c.
Referenced by drawfloor(), GPU_shader_bind(), GPU_shader_get_attribute(), GPU_shader_unbind(), GPU_shader_uniform_texture(), GPU_shader_uniform_vector(), GPU_texture_bind(), GPU_texture_create_3D(), GPU_texture_from_blender(), and GPU_texture_unbind().
static void GPU_print_framebuffer_error | ( | GLenum | status, |
char | err_out[256] | ||
) | [static] |
Definition at line 235 of file gpu_extensions.c.
References BLI_snprintf(), and err.
Referenced by GPU_framebuffer_texture_attach().
void GPU_shader_bind | ( | GPUShader * | shader | ) |
Definition at line 1082 of file gpu_extensions.c.
References GPU_print_error(), and GPUShader::object.
Referenced by GPU_nodes_extract_dynamic_inputs(), and GPU_pass_bind().
GPUShader* GPU_shader_create | ( | const char * | vertexcode, |
const char * | fragcode, | ||
const char * | libcode | ||
) |
Definition at line 962 of file gpu_extensions.c.
References GPUShader::fragment, GPU_shader_free(), length(), log(), MEM_callocN(), NULL, GPUShader::object, shader_print_errors(), and GPUShader::vertex.
Referenced by GPU_generate_pass().
void GPU_shader_free | ( | GPUShader * | shader | ) |
Definition at line 1096 of file gpu_extensions.c.
References GPUShader::fragment, GPUShader::lib, MEM_freeN(), GPUShader::object, and GPUShader::vertex.
Referenced by GPU_pass_free(), and GPU_shader_create().
int GPU_shader_get_attribute | ( | GPUShader * | shader, |
const char * | name | ||
) |
Definition at line 1159 of file gpu_extensions.c.
References GPU_print_error(), and GPUShader::object.
Referenced by gpu_material_set_attrib_id().
int GPU_shader_get_uniform | ( | GPUShader * | shader, |
const char * | name | ||
) |
Definition at line 1109 of file gpu_extensions.c.
References GPUShader::object.
Referenced by GPU_material_construct_end(), and GPU_nodes_extract_dynamic_inputs().
void GPU_shader_unbind | ( | GPUShader * | UNUSEDshader | ) |
Definition at line 1089 of file gpu_extensions.c.
References GPU_print_error().
void GPU_shader_uniform_texture | ( | GPUShader * | UNUSEDshader, |
int | location, | ||
GPUTexture * | tex | ||
) |
Definition at line 1131 of file gpu_extensions.c.
References GPUTexture::bindcode, GG, GPU_print_error(), GPUGlobal::maxtextures, GPUTexture::number, and GPUTexture::target.
void GPU_shader_uniform_vector | ( | GPUShader * | UNUSEDshader, |
int | location, | ||
int | length, | ||
int | arraysize, | ||
float * | value | ||
) |
Definition at line 1114 of file gpu_extensions.c.
References GPU_print_error().
void GPU_texture_bind | ( | GPUTexture * | tex, |
int | number | ||
) |
Definition at line 589 of file gpu_extensions.c.
References GPUTexture::bindcode, GG, GPU_print_error(), GPUGlobal::maxtextures, GPUTexture::number, and GPUTexture::target.
Referenced by draw_volume(), and GPU_pass_bind().
static unsigned char* GPU_texture_convert_pixels | ( | int | length, |
float * | fpixels | ||
) | [static] |
Definition at line 289 of file gpu_extensions.c.
References FTOCHAR, len(), length(), MEM_callocN(), and p.
Referenced by GPU_texture_create_nD().
GPUTexture* GPU_texture_create_1D | ( | int | w, |
float * | fpixels, | ||
char | err_out[256] | ||
) |
Definition at line 559 of file gpu_extensions.c.
References GPU_texture_create_nD(), and GPU_texture_unbind().
GPUTexture* GPU_texture_create_2D | ( | int | w, |
int | h, | ||
float * | fpixels, | ||
char | err_out[256] | ||
) |
Definition at line 569 of file gpu_extensions.c.
References GPU_texture_create_nD(), and GPU_texture_unbind().
Referenced by gpu_node_input_link(), and GPU_offscreen_create().
GPUTexture* GPU_texture_create_3D | ( | int | w, |
int | h, | ||
int | depth, | ||
float * | fpixels | ||
) |
Definition at line 431 of file gpu_extensions.c.
References GPUTexture::bindcode, GPUTexture::depth, GL_CLAMP_TO_EDGE, GPU_non_power_of_two_support(), GPU_print_error(), GPU_texture_free(), GPU_texture_unbind(), GPUTexture::h, MEM_callocN(), MEM_freeN(), NULL, GPUTexture::number, power_of_2_max_i(), GPUTexture::refcount, GPUTexture::target, GPUTexture::w, and simple_enum_gen::w.
Referenced by GPU_create_smoke().
GPUTexture* GPU_texture_create_depth | ( | int | w, |
int | h, | ||
char | err_out[256] | ||
) |
Definition at line 579 of file gpu_extensions.c.
References GPU_texture_create_nD(), GPU_texture_unbind(), and NULL.
Referenced by GPU_lamp_from_blender(), and GPU_offscreen_create().
static GPUTexture* GPU_texture_create_nD | ( | int | w, |
int | h, | ||
int | n, | ||
float * | fpixels, | ||
int | depth, | ||
char | err_out[256] | ||
) | [static] |
Definition at line 317 of file gpu_extensions.c.
References GPUTexture::bindcode, BLI_snprintf(), GPUTexture::depth, GL_CLAMP_TO_EDGE, GPU_glTexSubImageEmpty(), GPU_non_power_of_two_support(), GPU_texture_convert_pixels(), GPU_texture_free(), GPUTexture::h, MEM_callocN(), MEM_freeN(), NULL, GPUTexture::number, power_of_2_max_i(), GPUTexture::refcount, GPUTexture::target, GPUTexture::w, and simple_enum_gen::w.
Referenced by GPU_texture_create_1D(), GPU_texture_create_2D(), and GPU_texture_create_depth().
GPUFrameBuffer* GPU_texture_framebuffer | ( | GPUTexture * | tex | ) |
Definition at line 681 of file gpu_extensions.c.
References GPUTexture::fb.
void GPU_texture_free | ( | GPUTexture * | tex | ) |
Definition at line 639 of file gpu_extensions.c.
References GPUTexture::bindcode, GPUTexture::fb, GPUTexture::fromblender, GPU_framebuffer_texture_detach(), MEM_freeN(), and GPUTexture::refcount.
Referenced by GPU_free_image(), GPU_free_smoke(), GPU_inputs_free(), gpu_lamp_shadow_free(), GPU_offscreen_free(), GPU_texture_create_3D(), and GPU_texture_create_nD().
GPUTexture* GPU_texture_from_blender | ( | Image * | ima, |
ImageUser * | iuser, | ||
double | time, | ||
int | mipmap | ||
) |
Definition at line 511 of file gpu_extensions.c.
References GPUTexture::bindcode, GPUTexture::fromblender, GPU_print_error(), GPU_update_image_time(), GPU_verify_image(), Image::gputexture, GPUTexture::h, MEM_callocN(), NULL, GPUTexture::number, GPUTexture::refcount, GPUTexture::target, GPUTexture::w, and simple_enum_gen::w.
Referenced by GPU_pass_bind().
int GPU_texture_opengl_bindcode | ( | GPUTexture * | tex | ) |
Definition at line 676 of file gpu_extensions.c.
References GPUTexture::bindcode.
Referenced by GPU_shader_export().
int GPU_texture_opengl_height | ( | GPUTexture * | tex | ) |
Definition at line 671 of file gpu_extensions.c.
References GPUTexture::h.
Referenced by GPU_lamp_shadow_buffer_bind(), and GPU_shader_export().
int GPU_texture_opengl_width | ( | GPUTexture * | tex | ) |
Definition at line 666 of file gpu_extensions.c.
References GPUTexture::w.
Referenced by GPU_lamp_shadow_buffer_bind(), and GPU_shader_export().
void GPU_texture_ref | ( | GPUTexture * | tex | ) |
Definition at line 656 of file gpu_extensions.c.
References GPUTexture::refcount.
int GPU_texture_target | ( | GPUTexture * | tex | ) |
Definition at line 661 of file gpu_extensions.c.
References GPUTexture::target.
void GPU_texture_unbind | ( | GPUTexture * | tex | ) |
Definition at line 614 of file gpu_extensions.c.
References GG, GPU_print_error(), GPUGlobal::maxtextures, GPUTexture::number, and GPUTexture::target.
Referenced by draw_volume(), GPU_pass_unbind(), GPU_texture_create_1D(), GPU_texture_create_2D(), GPU_texture_create_3D(), and GPU_texture_create_depth().
int GPU_type_matches | ( | GPUDeviceType | device, |
GPUOSType | os, | ||
GPUDriverType | driver | ||
) |
Definition at line 82 of file gpu_extensions.c.
References GPUGlobal::device, GPUGlobal::driver, GG, and GPUGlobal::os.
Referenced by GPU_non_power_of_two_support(), wm_automatic_draw_method(), and wm_window_add_ghostwindow().
static void shader_print_errors | ( | const char * | task, |
char * | log, | ||
const char * | code | ||
) | [static] |
Definition at line 940 of file gpu_extensions.c.
References G, G_DEBUG, and strlen().
Referenced by GPU_shader_create().
Referenced by GPU_color_depth(), GPU_extensions_disable(), GPU_extensions_init(), GPU_framebuffer_free(), GPU_framebuffer_restore(), GPU_framebuffer_texture_attach(), GPU_framebuffer_texture_bind(), GPU_framebuffer_texture_detach(), GPU_glsl_support(), GPU_non_power_of_two_support(), GPU_shader_uniform_texture(), GPU_texture_bind(), GPU_texture_unbind(), and GPU_type_matches().
int gpu_extensions_init = 0 [static] |
Definition at line 89 of file gpu_extensions.c.
Referenced by GPU_extensions_exit(), and GPU_extensions_init().