Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_manager_texture.c
| Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | switch (format) { | ||||
| default: | default: | ||||
| return false; | return false; | ||||
| } | } | ||||
| } | } | ||||
| #endif | #endif | ||||
| void drw_texture_set_parameters(GPUTexture *tex, DRWTextureFlag flags) | void drw_texture_set_parameters(GPUTexture *tex, DRWTextureFlag flags) | ||||
| { | { | ||||
| GPU_texture_bind(tex, 0); | |||||
| if (flags & DRW_TEX_MIPMAP) { | if (flags & DRW_TEX_MIPMAP) { | ||||
| GPU_texture_mipmap_mode(tex, true, flags & DRW_TEX_FILTER); | GPU_texture_mipmap_mode(tex, true, flags & DRW_TEX_FILTER); | ||||
| GPU_texture_generate_mipmap(tex); | GPU_texture_generate_mipmap(tex); | ||||
| } | } | ||||
| else { | else { | ||||
| GPU_texture_filter_mode(tex, flags & DRW_TEX_FILTER); | GPU_texture_filter_mode(tex, flags & DRW_TEX_FILTER); | ||||
| } | } | ||||
| GPU_texture_wrap_mode(tex, flags & DRW_TEX_WRAP, true); | GPU_texture_wrap_mode(tex, flags & DRW_TEX_WRAP, true); | ||||
| GPU_texture_compare_mode(tex, flags & DRW_TEX_COMPARE); | GPU_texture_compare_mode(tex, flags & DRW_TEX_COMPARE); | ||||
| GPU_texture_unbind(tex); | |||||
| } | } | ||||
| GPUTexture *DRW_texture_create_1d(int w, | GPUTexture *DRW_texture_create_1d(int w, | ||||
| eGPUTextureFormat format, | eGPUTextureFormat format, | ||||
| DRWTextureFlag flags, | DRWTextureFlag flags, | ||||
| const float *fpixels) | const float *fpixels) | ||||
| { | { | ||||
| GPUTexture *tex = GPU_texture_create_1d(w, format, fpixels, NULL); | GPUTexture *tex = GPU_texture_create_1d(w, format, fpixels, NULL); | ||||
| ▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines | |||||