Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/opengl/gl_texture.cc
| Show First 20 Lines • Show All 588 Lines • ▼ Show 20 Lines | SNPRINTF(sampler_name, | ||||
| (state & GPU_SAMPLER_MIRROR_REPEAT) ? "-mirror" : "", | (state & GPU_SAMPLER_MIRROR_REPEAT) ? "-mirror" : "", | ||||
| (state & GPU_SAMPLER_CLAMP_BORDER) ? "_clamp_border" : "", | (state & GPU_SAMPLER_CLAMP_BORDER) ? "_clamp_border" : "", | ||||
| (state & GPU_SAMPLER_COMPARE) ? "_compare" : "", | (state & GPU_SAMPLER_COMPARE) ? "_compare" : "", | ||||
| (state & GPU_SAMPLER_ANISO) ? "_aniso" : ""); | (state & GPU_SAMPLER_ANISO) ? "_aniso" : ""); | ||||
| debug::object_label(GL_SAMPLER, samplers_[i], &sampler_name[1]); | debug::object_label(GL_SAMPLER, samplers_[i], &sampler_name[1]); | ||||
| } | } | ||||
| samplers_update(); | samplers_update(); | ||||
| /* Custom sampler for icons. */ | /* Custom sampler for icons. | ||||
| * NOTE: The icon texture is sampled within the shader using a -0.5f lod bias. */ | |||||
| GLuint icon_sampler = samplers_[GPU_SAMPLER_ICON]; | GLuint icon_sampler = samplers_[GPU_SAMPLER_ICON]; | ||||
| glSamplerParameteri(icon_sampler, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); | glSamplerParameteri(icon_sampler, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); | ||||
| glSamplerParameteri(icon_sampler, GL_TEXTURE_MAG_FILTER, GL_LINEAR); | glSamplerParameteri(icon_sampler, GL_TEXTURE_MAG_FILTER, GL_LINEAR); | ||||
| glSamplerParameterf(icon_sampler, GL_TEXTURE_LOD_BIAS, -0.5f); | |||||
| debug::object_label(GL_SAMPLER, icon_sampler, "icons"); | debug::object_label(GL_SAMPLER, icon_sampler, "icons"); | ||||
| } | } | ||||
| void GLTexture::samplers_update() | void GLTexture::samplers_update() | ||||
| { | { | ||||
| if (!GLContext::texture_filter_anisotropic_support) { | if (!GLContext::texture_filter_anisotropic_support) { | ||||
| return; | return; | ||||
| ▲ Show 20 Lines • Show All 230 Lines • Show Last 20 Lines | |||||