diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-10-05 22:54:10 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-10-07 13:43:09 +0300 |
commit | 055680a89e4b37662daf0c397539866a42c6d54a (patch) | |
tree | b0a6f4926f4ba72bbf323c1c4eca5799cc55e045 /source/blender/draw/intern/draw_shader_shared.h | |
parent | f43c2d9abe0f8b6efca8fa803774a065a6749a88 (diff) |
DRW: Split ViewCullingData out of ViewInfos
This is in order to reduce the size of ViewInfos and support multi view
rendering.
Diffstat (limited to 'source/blender/draw/intern/draw_shader_shared.h')
-rw-r--r-- | source/blender/draw/intern/draw_shader_shared.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/draw/intern/draw_shader_shared.h b/source/blender/draw/intern/draw_shader_shared.h index c6cd15551b9..13f21323552 100644 --- a/source/blender/draw/intern/draw_shader_shared.h +++ b/source/blender/draw/intern/draw_shader_shared.h @@ -7,6 +7,7 @@ # include "GPU_shader_shared_utils.h" # include "draw_defines.h" +typedef struct ViewCullingData ViewCullingData; typedef struct ViewInfos ViewInfos; typedef struct ObjectMatrices ObjectMatrices; typedef struct ObjectInfos ObjectInfos; @@ -50,6 +51,15 @@ typedef enum eObjectInfoFlag eObjectInfoFlag; * This should be kept in sync with `GPU_ATTR_MAX` */ #define DRW_ATTRIBUTE_PER_CURVES_MAX 15 +struct ViewCullingData { + /** \note vec3 array padded to vec4. */ + /** Frustum corners. */ + float4 corners[8]; + float4 planes[6]; + float4 bound_sphere; +}; +BLI_STATIC_ASSERT_ALIGN(ViewCullingData, 16) + struct ViewInfos { /* View matrices */ float4x4 viewmat; @@ -65,12 +75,6 @@ struct ViewInfos { float2 viewport_size; float2 viewport_size_inverse; - /** Frustum culling data. */ - /** \note vec3 array padded to vec4. */ - float4 frustum_corners[8]; - float4 frustum_planes[6]; - float4 frustum_bound_sphere; - /** For debugging purpose */ /* Mouse pixel. */ int2 mouse_pixel; |