diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-09-04 23:56:30 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-09-05 18:49:14 +0300 |
commit | bac4606937514405641659d91a30bf3e6832cdf7 (patch) | |
tree | 740db8bff5e694c2e9f943f928e08030925d0fcf /source/blender/draw/engines/eevee | |
parent | 7d4adbdfaba4f23b2adbf96f97ce18806aca31c8 (diff) |
Cleanup: GPUTexture: Remove use of GPU_texture_create_nD
Use creation + update function instead.
Diffstat (limited to 'source/blender/draw/engines/eevee')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_lightcache.c | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.c b/source/blender/draw/engines/eevee/eevee_lightcache.c index 088a08fb51a..2d846ccd1d6 100644 --- a/source/blender/draw/engines/eevee/eevee_lightcache.c +++ b/source/blender/draw/engines/eevee/eevee_lightcache.c @@ -401,16 +401,9 @@ static bool eevee_lightcache_static_load(LightCache *lcache) } if (lcache->grid_tx.tex == NULL) { - lcache->grid_tx.tex = GPU_texture_create_nD(lcache->grid_tx.tex_size[0], - lcache->grid_tx.tex_size[1], - lcache->grid_tx.tex_size[2], - 2, - lcache->grid_tx.data, - IRRADIANCE_FORMAT, - GPU_DATA_UNSIGNED_BYTE, - 0, - false, - NULL); + lcache->grid_tx.tex = GPU_texture_create_2d_array( + UNPACK3(lcache->grid_tx.tex_size), IRRADIANCE_FORMAT, NULL, NULL); + GPU_texture_update(lcache->grid_tx.tex, GPU_DATA_UNSIGNED_BYTE, lcache->grid_tx.data); if (lcache->grid_tx.tex == NULL) { lcache->flag |= LIGHTCACHE_NOT_USABLE; @@ -422,24 +415,17 @@ static bool eevee_lightcache_static_load(LightCache *lcache) if (lcache->cube_tx.tex == NULL) { if (GPU_arb_texture_cube_map_array_is_supported()) { - lcache->cube_tx.tex = GPU_texture_cube_create(lcache->cube_tx.tex_size[0], - lcache->cube_tx.tex_size[2] / 6, - lcache->cube_tx.data, - GPU_R11F_G11F_B10F, - GPU_DATA_10_11_11_REV, - NULL); + lcache->cube_tx.tex = GPU_texture_create_cube_array(lcache->cube_tx.tex_size[0], + lcache->cube_tx.tex_size[2] / 6, + GPU_R11F_G11F_B10F, + NULL, + NULL); + GPU_texture_update(lcache->cube_tx.tex, GPU_DATA_10_11_11_REV, lcache->cube_tx.data); } else { - lcache->cube_tx.tex = GPU_texture_create_nD(lcache->cube_tx.tex_size[0], - lcache->cube_tx.tex_size[1], - lcache->cube_tx.tex_size[2], - 2, - lcache->cube_tx.data, - GPU_R11F_G11F_B10F, - GPU_DATA_10_11_11_REV, - 0, - false, - NULL); + lcache->cube_tx.tex = GPU_texture_create_2d_array( + UNPACK3(lcache->cube_tx.tex_size), GPU_R11F_G11F_B10F, NULL, NULL); + GPU_texture_update(lcache->cube_tx.tex, GPU_DATA_10_11_11_REV, lcache->cube_tx.data); } if (lcache->cube_tx.tex == NULL) { |