diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-04-30 17:02:24 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-04-30 17:39:26 +0300 |
commit | eb7188802daf5909351d8a3c01b68303b655c1bc (patch) | |
tree | 137c2c43be509c07efa96ba49c63b5632974cceb /source/blender/gpu/intern/gpu_draw.c | |
parent | 41431eacfa1afc66533f5d27cc21dfa58024e26c (diff) |
DRW: Remove DRWTextureFormat in favor or GPUTextureFormat.
Because:
- Less redundancy.
- Better suffixes.
Also a few modification to GPU_texture_create_* to simplify the API:
- make the format explicit to the texture creation process.
- remove the component count as it's specified in the GPUTextureFormat.
Diffstat (limited to 'source/blender/gpu/intern/gpu_draw.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_draw.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 8b23cf6f936..7bfebb702a1 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -914,12 +914,12 @@ void GPU_create_smoke(SmokeModifierData *smd, int highres) if (smoke_has_colors(sds->fluid)) { float *data = MEM_callocN(sizeof(float) * sds->total_cells * 4, "smokeColorTexture"); smoke_get_rgba(sds->fluid, data, 0); - sds->tex = GPU_texture_create_3D(sds->res[0], sds->res[1], sds->res[2], data, NULL); + sds->tex = GPU_texture_create_3D(sds->res[0], sds->res[1], sds->res[2], GPU_RGBA8, data, NULL); MEM_freeN(data); } /* density only */ else { - sds->tex = GPU_texture_create_3D_custom(sds->res[0], sds->res[1], sds->res[2], 1, + sds->tex = GPU_texture_create_3D(sds->res[0], sds->res[1], sds->res[2], GPU_R8, smoke_get_density(sds->fluid), NULL); /* Swizzle the RGBA components to read the Red channel so @@ -933,7 +933,7 @@ void GPU_create_smoke(SmokeModifierData *smd, int highres) GPU_texture_unbind(sds->tex); } sds->tex_flame = (smoke_has_fuel(sds->fluid)) ? - GPU_texture_create_3D_custom(sds->res[0], sds->res[1], sds->res[2], 1, + GPU_texture_create_3D(sds->res[0], sds->res[1], sds->res[2], GPU_R8, smoke_get_flame(sds->fluid), NULL) : NULL; } @@ -942,12 +942,12 @@ void GPU_create_smoke(SmokeModifierData *smd, int highres) if (smoke_turbulence_has_colors(sds->wt)) { float *data = MEM_callocN(sizeof(float) * smoke_turbulence_get_cells(sds->wt) * 4, "smokeColorTexture"); smoke_turbulence_get_rgba(sds->wt, data, 0); - sds->tex = GPU_texture_create_3D(sds->res_wt[0], sds->res_wt[1], sds->res_wt[2], data, NULL); + sds->tex = GPU_texture_create_3D(sds->res_wt[0], sds->res_wt[1], sds->res_wt[2], GPU_RGBA8, data, NULL); MEM_freeN(data); } /* density only */ else { - sds->tex = GPU_texture_create_3D_custom(sds->res_wt[0], sds->res_wt[1], sds->res_wt[2], 1, + sds->tex = GPU_texture_create_3D(sds->res_wt[0], sds->res_wt[1], sds->res_wt[2], GPU_R8, smoke_turbulence_get_density(sds->wt), NULL); /* Swizzle the RGBA components to read the Red channel so @@ -961,12 +961,12 @@ void GPU_create_smoke(SmokeModifierData *smd, int highres) GPU_texture_unbind(sds->tex); } sds->tex_flame = (smoke_turbulence_has_fuel(sds->wt)) ? - GPU_texture_create_3D_custom(sds->res_wt[0], sds->res_wt[1], sds->res_wt[2], 1, + GPU_texture_create_3D(sds->res_wt[0], sds->res_wt[1], sds->res_wt[2], GPU_R8, smoke_turbulence_get_flame(sds->wt), NULL) : NULL; } - sds->tex_shadow = GPU_texture_create_3D_custom(sds->res[0], sds->res[1], sds->res[2], 1, + sds->tex_shadow = GPU_texture_create_3D(sds->res[0], sds->res[1], sds->res[2], GPU_R8, sds->shadow, NULL); } #else // WITH_SMOKE |