me-main #1

Merged
Nate Rupsis merged 123 commits from me-main into main 2023-02-13 18:39:11 +01:00
7 changed files with 16 additions and 38 deletions
Showing only changes of commit 83a6642045 - Show all commits

View File

@ -22,6 +22,7 @@
#include "DNA_scene_types.h" #include "DNA_scene_types.h"
#include "GPU_immediate.h" #include "GPU_immediate.h"
#include "GPU_shader_shared.h"
#include "GPU_state.h" #include "GPU_state.h"
#include "UI_interface.h" #include "UI_interface.h"

View File

@ -51,6 +51,7 @@
#include "GPU_immediate.h" #include "GPU_immediate.h"
#include "GPU_immediate_util.h" #include "GPU_immediate_util.h"
#include "GPU_matrix.h" #include "GPU_matrix.h"
#include "GPU_shader_shared.h"
#include "GPU_state.h" #include "GPU_state.h"
#include "GPU_viewport.h" #include "GPU_viewport.h"

View File

@ -291,20 +291,6 @@ void GPU_shader_uniform_int(GPUShader *shader, int location, int value);
/** \} */ /** \} */
/* TODO: Move to shader shared. */
typedef enum eGPUKeyframeShapes {
GPU_KEYFRAME_SHAPE_DIAMOND = (1 << 0),
GPU_KEYFRAME_SHAPE_CIRCLE = (1 << 1),
GPU_KEYFRAME_SHAPE_CLIPPED_VERTICAL = (1 << 2),
GPU_KEYFRAME_SHAPE_CLIPPED_HORIZONTAL = (1 << 3),
GPU_KEYFRAME_SHAPE_INNER_DOT = (1 << 4),
GPU_KEYFRAME_SHAPE_ARROW_END_MAX = (1 << 8),
GPU_KEYFRAME_SHAPE_ARROW_END_MIN = (1 << 9),
GPU_KEYFRAME_SHAPE_ARROW_END_MIXED = (1 << 10),
} eGPUKeyframeShapes;
#define GPU_KEYFRAME_SHAPE_SQUARE \
(GPU_KEYFRAME_SHAPE_CLIPPED_VERTICAL | GPU_KEYFRAME_SHAPE_CLIPPED_HORIZONTAL)
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -11,6 +11,19 @@
typedef struct TestOutputRawData TestOutputRawData; typedef struct TestOutputRawData TestOutputRawData;
#endif #endif
enum eGPUKeyframeShapes {
GPU_KEYFRAME_SHAPE_DIAMOND = (1u << 0u),
GPU_KEYFRAME_SHAPE_CIRCLE = (1u << 1u),
GPU_KEYFRAME_SHAPE_CLIPPED_VERTICAL = (1u << 2u),
GPU_KEYFRAME_SHAPE_CLIPPED_HORIZONTAL = (1u << 3u),
GPU_KEYFRAME_SHAPE_INNER_DOT = (1u << 4u),
GPU_KEYFRAME_SHAPE_ARROW_END_MAX = (1u << 8u),
GPU_KEYFRAME_SHAPE_ARROW_END_MIN = (1u << 9u),
GPU_KEYFRAME_SHAPE_ARROW_END_MIXED = (1u << 10u),
GPU_KEYFRAME_SHAPE_SQUARE = (GPU_KEYFRAME_SHAPE_CLIPPED_VERTICAL |
GPU_KEYFRAME_SHAPE_CLIPPED_HORIZONTAL),
};
struct NodeLinkData { struct NodeLinkData {
float4 colors[3]; float4 colors[3];
/* bezierPts Is actually a float2, but due to std140 each element needs to be aligned to 16 /* bezierPts Is actually a float2, but due to std140 each element needs to be aligned to 16

View File

@ -1,16 +1,4 @@
/* Values in GPU_shader.h. */
#define GPU_KEYFRAME_SHAPE_DIAMOND (1u << 0)
#define GPU_KEYFRAME_SHAPE_CIRCLE (1u << 1)
#define GPU_KEYFRAME_SHAPE_CLIPPED_VERTICAL (1u << 2)
#define GPU_KEYFRAME_SHAPE_CLIPPED_HORIZONTAL (1u << 3)
#define GPU_KEYFRAME_SHAPE_INNER_DOT (1u << 4)
#define GPU_KEYFRAME_SHAPE_ARROW_END_MAX (1u << 8)
#define GPU_KEYFRAME_SHAPE_ARROW_END_MIN (1u << 9)
#define GPU_KEYFRAME_SHAPE_ARROW_END_MIXED (1u << 10)
#define GPU_KEYFRAME_SHAPE_SQUARE \
(GPU_KEYFRAME_SHAPE_CLIPPED_VERTICAL | GPU_KEYFRAME_SHAPE_CLIPPED_HORIZONTAL)
const float diagonal_scale = sqrt(0.5); const float diagonal_scale = sqrt(0.5);
const float minmax_bias = 0.7; const float minmax_bias = 0.7;

View File

@ -1,16 +1,4 @@
/* Values in GPU_shader.h. */
#define GPU_KEYFRAME_SHAPE_DIAMOND (1u << 0)
#define GPU_KEYFRAME_SHAPE_CIRCLE (1u << 1)
#define GPU_KEYFRAME_SHAPE_CLIPPED_VERTICAL (1u << 2)
#define GPU_KEYFRAME_SHAPE_CLIPPED_HORIZONTAL (1u << 3)
#define GPU_KEYFRAME_SHAPE_INNER_DOT (1u << 4)
#define GPU_KEYFRAME_SHAPE_ARROW_END_MAX (1u << 8)
#define GPU_KEYFRAME_SHAPE_ARROW_END_MIN (1u << 9)
#define GPU_KEYFRAME_SHAPE_ARROW_END_MIXED (1u << 10)
#define GPU_KEYFRAME_SHAPE_SQUARE \
(GPU_KEYFRAME_SHAPE_CLIPPED_VERTICAL | GPU_KEYFRAME_SHAPE_CLIPPED_HORIZONTAL)
const float line_falloff = 1.0; const float line_falloff = 1.0;
const float circle_scale = sqrt(2.0 / 3.1416); const float circle_scale = sqrt(2.0 / 3.1416);
const float square_scale = sqrt(0.5); const float square_scale = sqrt(0.5);

View File

@ -15,6 +15,7 @@ GPU_SHADER_INTERFACE_INFO(keyframe_shape_iface, "")
.flat(Type::UINT, "finalFlags"); .flat(Type::UINT, "finalFlags");
GPU_SHADER_CREATE_INFO(gpu_shader_keyframe_shape) GPU_SHADER_CREATE_INFO(gpu_shader_keyframe_shape)
.typedef_source("GPU_shader_shared.h")
.vertex_in(0, Type::VEC4, "color") .vertex_in(0, Type::VEC4, "color")
.vertex_in(1, Type::VEC4, "outlineColor") .vertex_in(1, Type::VEC4, "outlineColor")
.vertex_in(2, Type::VEC2, "pos") .vertex_in(2, Type::VEC2, "pos")