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:
authorJason Fielder <jason_apple>2022-09-01 23:14:18 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-09-01 23:18:02 +0300
commitac07fb38a1b35fa156b2d0901eb35cd65ed73903 (patch)
tree2fe5a9b69c5c8bf04818e8b2cde0393e960a12ca /source/blender/gpu/intern/gpu_vertex_buffer_private.hh
parent5f4409b02ef7c54089ff1b491e008d4b86c030f4 (diff)
Metal: Minimum per-vertex stride, 3D texture size + Transform feedback GPUCapabilities expansion.
- Adding in compatibility paths to support minimum per-vertex strides for vertex formats. OpenGL supports a minimum stride of 1 byte, in Metal, this minimum stride is 4 bytes. Meaing a vertex format must be atleast 4-bytes in size. - Replacing transform feedback compile-time check to conditional look-up, given TF is supported on macOS with Metal. - 3D texture size safety check added as a general capability, rather than being in the gl backend only. Also required for Metal. Authored by Apple: Michael Parkin-White Ref T96261 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D14510
Diffstat (limited to 'source/blender/gpu/intern/gpu_vertex_buffer_private.hh')
-rw-r--r--source/blender/gpu/intern/gpu_vertex_buffer_private.hh10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_vertex_buffer_private.hh b/source/blender/gpu/intern/gpu_vertex_buffer_private.hh
index a7920bacaec..f20f6caf6de 100644
--- a/source/blender/gpu/intern/gpu_vertex_buffer_private.hh
+++ b/source/blender/gpu/intern/gpu_vertex_buffer_private.hh
@@ -31,6 +31,11 @@ class VertBuf {
/** NULL indicates data in VRAM (unmapped) */
uchar *data = nullptr;
+#ifndef NDEBUG
+ /** Usage including extended usage flags. */
+ GPUUsageType extended_usage_ = GPU_USAGE_STATIC;
+#endif
+
protected:
/** Usage hint for GL optimization. */
GPUUsageType usage_ = GPU_USAGE_STATIC;
@@ -83,6 +88,11 @@ class VertBuf {
}
}
+ GPUUsageType get_usage_type() const
+ {
+ return usage_;
+ }
+
virtual void update_sub(uint start, uint len, const void *data) = 0;
virtual const void *read() const = 0;
virtual void *unmap(const void *mapped_data) const = 0;