[Bf-blender-cvs] [f0687d46650] master: Cleanup: GPUTexture: Use UNPACK3 in texture_fluid

Clément Foucault noreply at git.blender.org
Wed Jul 29 15:55:05 CEST 2020


Commit: f0687d46650d1323778cf6d545c5cb9d25f558de
Author: Clément Foucault
Date:   Wed Jul 29 15:53:01 2020 +0200
Branches: master
https://developer.blender.org/rBf0687d46650d1323778cf6d545c5cb9d25f558de

Cleanup: GPUTexture: Use UNPACK3 in texture_fluid

===================================================================

M	source/blender/gpu/intern/gpu_texture_fluid.c

===================================================================

diff --git a/source/blender/gpu/intern/gpu_texture_fluid.c b/source/blender/gpu/intern/gpu_texture_fluid.c
index 13273dba444..ecbf46d0ad9 100644
--- a/source/blender/gpu/intern/gpu_texture_fluid.c
+++ b/source/blender/gpu/intern/gpu_texture_fluid.c
@@ -184,7 +184,7 @@ static GPUTexture *create_field_texture(FluidDomainSettings *fds)
   }
 
   GPUTexture *tex = GPU_texture_create_nD(
-      fds->res[0], fds->res[1], fds->res[2], 3, field, GPU_R8, GPU_DATA_FLOAT, 0, true, NULL);
+      UNPACK3(fds->res), 3, field, GPU_R8, GPU_DATA_FLOAT, 0, true, NULL);
 
   swizzle_texture_channel_single(tex);
   return tex;
@@ -203,7 +203,7 @@ static GPUTexture *create_density_texture(FluidDomainSettings *fds, int highres)
   }
 
   GPUTexture *tex = GPU_texture_create_nD(
-      dim[0], dim[1], dim[2], 3, data, GPU_R8, GPU_DATA_FLOAT, 0, true, NULL);
+      UNPACK3(dim), 3, data, GPU_R8, GPU_DATA_FLOAT, 0, true, NULL);
 
   swizzle_texture_channel_single(tex);
 
@@ -355,9 +355,7 @@ void GPU_create_smoke(FluidModifierData *fmd, int highres)
       fds->tex_flame_coba = create_transfer_function(TFUNC_FLAME_SPECTRUM, NULL);
     }
     if (!fds->tex_shadow) {
-      fds->tex_shadow = GPU_texture_create_nD(fds->res[0],
-                                              fds->res[1],
-                                              fds->res[2],
+      fds->tex_shadow = GPU_texture_create_nD(UNPACK3(fds->res),
                                               3,
                                               manta_smoke_get_shadow(fds->fluid),
                                               GPU_R8,
@@ -387,12 +385,9 @@ void GPU_create_smoke_velocity(FluidModifierData *fmd)
     }
 
     if (!fds->tex_velocity_x) {
-      fds->tex_velocity_x = GPU_texture_create_3d(
-          fds->res[0], fds->res[1], fds->res[2], GPU_R16F, vel_x, NULL);
-      fds->tex_velocity_y = GPU_texture_create_3d(
-          fds->res[0], fds->res[1], fds->res[2], GPU_R16F, vel_y, NULL);
-      fds->tex_velocity_z = GPU_texture_create_3d(
-          fds->res[0], fds->res[1], fds->res[2], GPU_R16F, vel_z, NULL);
+      fds->tex_velocity_x = GPU_texture_create_3d(UNPACK3(fds->res), GPU_R16F, vel_x, NULL);
+      fds->tex_velocity_y = GPU_texture_create_3d(UNPACK3(fds->res), GPU_R16F, vel_y, NULL);
+      fds->tex_velocity_z = GPU_texture_create_3d(UNPACK3(fds->res), GPU_R16F, vel_z, NULL);
     }
   }
 #endif /* WITH_FLUID */



More information about the Bf-blender-cvs mailing list