0
0
Fork 0

me-main #1

Merged
Nate Rupsis merged 123 commits from me-main into main 2023-02-13 18:39:11 +01:00
3 changed files with 10 additions and 2 deletions
Showing only changes of commit c2a5c592fe - Show all commits

View File

@ -59,6 +59,6 @@ struct ExtrudedFrustum {
struct ShadowPassData {
float4 far_plane;
float3 light_direction_ws;
packed_float3 light_direction_ws;
int _padding;
};

View File

@ -11,6 +11,11 @@
typedef struct TestOutputRawData TestOutputRawData;
#endif
/* NOTE: float3 has differing stride and alignment rules across different GPU backends. If 12 byte
* stride and alignment is essential, use `packed_float3` to avoid data read issues. This is
* required in the common use-case where a float3 and an int/float are paired together for optimal
* data transfer. */
enum eGPUKeyframeShapes {
GPU_KEYFRAME_SHAPE_DIAMOND = (1u << 0u),
GPU_KEYFRAME_SHAPE_CIRCLE = (1u << 1u),
@ -70,7 +75,7 @@ BLI_STATIC_ASSERT_ALIGN(struct GPUClipPlanes, 16)
struct SimpleLightingData {
float4 l_color;
float3 light;
packed_float3 light;
float _pad;
};
BLI_STATIC_ASSERT_ALIGN(struct SimpleLightingData, 16)

View File

@ -59,6 +59,7 @@
# define bool2 bvec2
# define bool3 bvec3
# define bool4 bvec4
# define packed_float3 vec3
# endif
#else /* C / C++ */
@ -83,6 +84,7 @@ using bool1 = int;
using bool2 = blender::int2;
using bool3 = blender::int3;
using bool4 = blender::int4;
using packed_float3 = blender::float3;
# else /* C */
typedef float float2[2];
@ -99,6 +101,7 @@ typedef int bool1;
typedef int bool2[2];
typedef int bool3[2];
typedef int bool4[4];
typedef float3 packed_float3;
# endif
#endif