Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/eevee_lightcache.c
| Show First 20 Lines • Show All 389 Lines • ▼ Show 20 Lines | if ((!lcache->grid_tx.tex && !lcache->grid_tx.data) || !lcache->grid_data || | ||||
| return false; | return false; | ||||
| } | } | ||||
| /* If cache is too big for this GPU. */ | /* If cache is too big for this GPU. */ | ||||
| if (lcache->cube_tx.tex_size[2] > GPU_max_texture_layers()) { | if (lcache->cube_tx.tex_size[2] > GPU_max_texture_layers()) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| if (lcache->grid_tx.tex == NULL) { | if (lcache->grid_tx.tex == NULL) { | ||||
| eGPUTextureUsage usage = GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT; | eGPUTextureUsage usage = GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT | | ||||
| GPU_TEXTURE_USAGE_HOST_READ; | |||||
| lcache->grid_tx.tex = GPU_texture_create_2d_array_ex("lightcache_irradiance", | lcache->grid_tx.tex = GPU_texture_create_2d_array_ex("lightcache_irradiance", | ||||
| UNPACK3(lcache->grid_tx.tex_size), | UNPACK3(lcache->grid_tx.tex_size), | ||||
| 1, | 1, | ||||
| IRRADIANCE_FORMAT, | IRRADIANCE_FORMAT, | ||||
| usage, | usage, | ||||
| NULL); | NULL); | ||||
| GPU_texture_update(lcache->grid_tx.tex, GPU_DATA_UBYTE, lcache->grid_tx.data); | GPU_texture_update(lcache->grid_tx.tex, GPU_DATA_UBYTE, lcache->grid_tx.data); | ||||
| ▲ Show 20 Lines • Show All 1,139 Lines • Show Last 20 Lines | |||||