Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/gpu/intern/gpu_texture_private.hh')
-rw-r--r--source/blender/gpu/intern/gpu_texture_private.hh11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/gpu/intern/gpu_texture_private.hh b/source/blender/gpu/intern/gpu_texture_private.hh
index 400a36559da..51a953e110d 100644
--- a/source/blender/gpu/intern/gpu_texture_private.hh
+++ b/source/blender/gpu/intern/gpu_texture_private.hh
@@ -384,15 +384,15 @@ inline int to_component_len(eGPUTextureFormat format)
}
}
-inline size_t to_bytesize(eGPUTextureFormat tex_format, eGPUDataFormat data_format)
+inline size_t to_bytesize(eGPUDataFormat data_format)
{
switch (data_format) {
case GPU_DATA_UNSIGNED_BYTE:
- return 1 * to_component_len(tex_format);
+ return 1;
case GPU_DATA_FLOAT:
case GPU_DATA_INT:
case GPU_DATA_UNSIGNED_INT:
- return 4 * to_component_len(tex_format);
+ return 4;
case GPU_DATA_UNSIGNED_INT_24_8:
case GPU_DATA_10_11_11_REV:
return 4;
@@ -402,6 +402,11 @@ inline size_t to_bytesize(eGPUTextureFormat tex_format, eGPUDataFormat data_form
}
}
+inline size_t to_bytesize(eGPUTextureFormat tex_format, eGPUDataFormat data_format)
+{
+ return to_component_len(tex_format) * to_bytesize(data_format);
+}
+
/* Definitely not complete, edit according to the gl specification. */
inline bool validate_data_format(eGPUTextureFormat tex_format, eGPUDataFormat data_format)
{