Compare commits
20 Commits
temp-geome
...
gpu-shader
Author | SHA1 | Date | |
---|---|---|---|
f240ac1673 | |||
a590474f4c | |||
b2462b6f5c | |||
21ee89c52f | |||
2c95da88aa | |||
7358a5aba2 | |||
9159295c3c | |||
62a04f7aa6 | |||
38a3819171 | |||
3844e9dbe7 | |||
ea93e5df6c | |||
60befc8f02 | |||
62b50c612f | |||
9e5aae4215 | |||
c09e8a3590 | |||
792badcfef | |||
c0a2b21744 | |||
fb4851fbbc | |||
b40e930ac7 | |||
cf266ecaa6 |
@@ -269,5 +269,9 @@ StatementMacros:
|
||||
- PyObject_HEAD
|
||||
- PyObject_VAR_HEAD
|
||||
|
||||
StatementMacros:
|
||||
- GPU_STAGE_INTERFACE_CREATE
|
||||
- GPU_SHADER_DESCRIPTOR
|
||||
|
||||
MacroBlockBegin: "^BSDF_CLOSURE_CLASS_BEGIN$"
|
||||
MacroBlockEnd: "^BSDF_CLOSURE_CLASS_END$"
|
||||
|
@@ -12,6 +12,8 @@ Checks: >
|
||||
-readability-avoid-const-params-in-decls,
|
||||
-readability-simplify-boolean-expr,
|
||||
-readability-make-member-function-const,
|
||||
-readability-suspicious-call-argument,
|
||||
-readability-redundant-member-init,
|
||||
|
||||
-readability-misleading-indentation,
|
||||
|
||||
@@ -25,6 +27,8 @@ Checks: >
|
||||
-bugprone-branch-clone,
|
||||
-bugprone-macro-parentheses,
|
||||
-bugprone-reserved-identifier,
|
||||
-bugprone-easily-swappable-parameters,
|
||||
-bugprone-implicit-widening-of-multiplication-result,
|
||||
|
||||
-bugprone-sizeof-expression,
|
||||
-bugprone-integer-division,
|
||||
@@ -40,7 +44,8 @@ Checks: >
|
||||
-modernize-pass-by-value,
|
||||
# Cannot be enabled yet, because using raw string literals in tests breaks
|
||||
# the windows compiler currently.
|
||||
-modernize-raw-string-literal
|
||||
-modernize-raw-string-literal,
|
||||
-modernize-return-braced-init-list
|
||||
|
||||
CheckOptions:
|
||||
- key: modernize-use-default-member-init.UseAssignment
|
||||
|
@@ -2147,7 +2147,7 @@ def km_file_browser(params):
|
||||
("file.next", {"type": 'RIGHT_ARROW', "value": 'PRESS', "alt": True}, None),
|
||||
# The two refresh operators have polls excluding each other (so only one is available depending on context).
|
||||
("file.refresh", {"type": 'R', "value": 'PRESS'}, None),
|
||||
("file.asset_library_refresh", {"type": 'R', "value": 'PRESS'}, None),
|
||||
("asset.library_refresh", {"type": 'R', "value": 'PRESS'}, None),
|
||||
("file.parent", {"type": 'P', "value": 'PRESS'}, None),
|
||||
("file.previous", {"type": 'BACK_SPACE', "value": 'PRESS'}, None),
|
||||
("file.next", {"type": 'BACK_SPACE', "value": 'PRESS', "shift": True}, None),
|
||||
|
@@ -1229,7 +1229,7 @@ def km_file_browser(params):
|
||||
("file.next", {"type": 'RIGHT_ARROW', "value": 'PRESS', "ctrl": True}, None),
|
||||
# The two refresh operators have polls excluding each other (so only one is available depending on context).
|
||||
("file.refresh", {"type": 'R', "value": 'PRESS', "ctrl": True}, None),
|
||||
("file.asset_library_refresh", {"type": 'R', "value": 'PRESS', "ctrl": True}, None),
|
||||
("asset.library_refresh", {"type": 'R', "value": 'PRESS', "ctrl": True}, None),
|
||||
("file.previous", {"type": 'BACK_SPACE', "value": 'PRESS'}, None),
|
||||
("file.next", {"type": 'BACK_SPACE', "value": 'PRESS', "shift": True}, None),
|
||||
("wm.context_toggle", {"type": 'H', "value": 'PRESS'},
|
||||
@@ -1276,7 +1276,7 @@ def km_file_browser_main(params):
|
||||
("file.mouse_execute", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, None),
|
||||
# The two refresh operators have polls excluding each other (so only one is available depending on context).
|
||||
("file.refresh", {"type": 'R', "value": 'PRESS', "ctrl": True}, None),
|
||||
("file.asset_library_refresh", {"type": 'R', "value": 'PRESS', "ctrl": True}, None),
|
||||
("asset.library_refresh", {"type": 'R', "value": 'PRESS', "ctrl": True}, None),
|
||||
("file.select", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, None),
|
||||
("file.select", {"type": 'LEFTMOUSE', "value": 'CLICK'},
|
||||
{"properties": [("open", False), ("deselect_all", True)]}),
|
||||
|
@@ -142,14 +142,8 @@ class ASSET_OT_open_containing_blend_file(Operator):
|
||||
if returncode:
|
||||
self.report({'WARNING'}, "Blender sub-process exited with error code %d" % returncode)
|
||||
|
||||
# TODO(Sybren): Replace this with a generic "reload assets" operator
|
||||
# that can run outside of the Asset Browser context.
|
||||
if bpy.ops.file.refresh.poll():
|
||||
bpy.ops.file.refresh()
|
||||
if bpy.ops.asset.list_refresh.poll():
|
||||
bpy.ops.asset.list_refresh()
|
||||
if bpy.ops.file.asset_library_refresh.poll():
|
||||
bpy.ops.file.asset_library_refresh()
|
||||
if bpy.ops.asset.library_refresh.poll():
|
||||
bpy.ops.asset.library_refresh()
|
||||
|
||||
self.cancel(context)
|
||||
return {'FINISHED'}
|
||||
|
@@ -793,7 +793,7 @@ class ASSETBROWSER_MT_context_menu(AssetBrowserMenu, Menu):
|
||||
st = context.space_data
|
||||
params = st.params
|
||||
|
||||
layout.operator("file.asset_library_refresh")
|
||||
layout.operator("asset.library_refresh")
|
||||
|
||||
layout.separator()
|
||||
|
||||
|
@@ -110,8 +110,8 @@ bool BLI_rcti_isect_circle(const struct rcti *rect, const float xy[2], const flo
|
||||
bool BLI_rctf_isect_circle(const struct rctf *rect, const float xy[2], const float radius);
|
||||
bool BLI_rcti_inside_rcti(const rcti *rct_a, const rcti *rct_b);
|
||||
bool BLI_rctf_inside_rctf(const rctf *rct_a, const rctf *rct_b);
|
||||
void BLI_rcti_union(struct rcti *rct1, const struct rcti *rct2);
|
||||
void BLI_rctf_union(struct rctf *rct1, const struct rctf *rct2);
|
||||
void BLI_rcti_union(struct rcti *rct_a, const struct rcti *rct_b);
|
||||
void BLI_rctf_union(struct rctf *rct_a, const struct rctf *rct_b);
|
||||
void BLI_rcti_rctf_copy(struct rcti *dst, const struct rctf *src);
|
||||
void BLI_rctf_rcti_copy(struct rctf *dst, const struct rcti *src);
|
||||
void BLI_rcti_rctf_copy_floor(struct rcti *dst, const struct rctf *src);
|
||||
|
@@ -401,35 +401,35 @@ bool BLI_rctf_isect_circle(const rctf *rect, const float xy[2], const float radi
|
||||
return dx * dx + dy * dy <= radius * radius;
|
||||
}
|
||||
|
||||
void BLI_rctf_union(rctf *rct1, const rctf *rct2)
|
||||
void BLI_rctf_union(rctf *rct_a, const rctf *rct_b)
|
||||
{
|
||||
if (rct1->xmin > rct2->xmin) {
|
||||
rct1->xmin = rct2->xmin;
|
||||
if (rct_a->xmin > rct_b->xmin) {
|
||||
rct_a->xmin = rct_b->xmin;
|
||||
}
|
||||
if (rct1->xmax < rct2->xmax) {
|
||||
rct1->xmax = rct2->xmax;
|
||||
if (rct_a->xmax < rct_b->xmax) {
|
||||
rct_a->xmax = rct_b->xmax;
|
||||
}
|
||||
if (rct1->ymin > rct2->ymin) {
|
||||
rct1->ymin = rct2->ymin;
|
||||
if (rct_a->ymin > rct_b->ymin) {
|
||||
rct_a->ymin = rct_b->ymin;
|
||||
}
|
||||
if (rct1->ymax < rct2->ymax) {
|
||||
rct1->ymax = rct2->ymax;
|
||||
if (rct_a->ymax < rct_b->ymax) {
|
||||
rct_a->ymax = rct_b->ymax;
|
||||
}
|
||||
}
|
||||
|
||||
void BLI_rcti_union(rcti *rct1, const rcti *rct2)
|
||||
void BLI_rcti_union(rcti *rct_a, const rcti *rct_b)
|
||||
{
|
||||
if (rct1->xmin > rct2->xmin) {
|
||||
rct1->xmin = rct2->xmin;
|
||||
if (rct_a->xmin > rct_b->xmin) {
|
||||
rct_a->xmin = rct_b->xmin;
|
||||
}
|
||||
if (rct1->xmax < rct2->xmax) {
|
||||
rct1->xmax = rct2->xmax;
|
||||
if (rct_a->xmax < rct_b->xmax) {
|
||||
rct_a->xmax = rct_b->xmax;
|
||||
}
|
||||
if (rct1->ymin > rct2->ymin) {
|
||||
rct1->ymin = rct2->ymin;
|
||||
if (rct_a->ymin > rct_b->ymin) {
|
||||
rct_a->ymin = rct_b->ymin;
|
||||
}
|
||||
if (rct1->ymax < rct2->ymax) {
|
||||
rct1->ymax = rct2->ymax;
|
||||
if (rct_a->ymax < rct_b->ymax) {
|
||||
rct_a->ymax = rct_b->ymax;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -237,256 +237,283 @@ set(LIB
|
||||
bf_windowmanager
|
||||
)
|
||||
|
||||
data_to_c_simple(engines/eevee/shaders/ambient_occlusion_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/background_vert.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/common_uniforms_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/common_utiltex_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/lights_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/lightprobe_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/lightprobe_filter_visibility_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/lightprobe_geom.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/lightprobe_vert.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/lightprobe_cube_display_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/lightprobe_cube_display_vert.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/lightprobe_grid_display_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/lightprobe_grid_display_vert.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/lightprobe_grid_fill_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/lightprobe_planar_display_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/lightprobe_planar_display_vert.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/lookdev_world_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/closure_eval_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/closure_eval_diffuse_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/closure_eval_glossy_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/closure_eval_refraction_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/closure_eval_translucent_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/closure_type_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_bloom_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_dof_bokeh_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_dof_dilate_tiles_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_dof_downsample_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_dof_filter_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_dof_flatten_tiles_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_dof_gather_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_dof_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_dof_reduce_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_dof_resolve_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_dof_scatter_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_dof_scatter_vert.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_dof_setup_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_reflection_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_reflection_resolve_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_reflection_trace_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_downsample_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_downsample_cube_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_gtao_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_velocity_resolve_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_velocity_tile_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_minmaxz_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_mist_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_motion_blur_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_subsurface_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_translucency_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/effect_temporal_aa.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/lightprobe_planar_downsample_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/lightprobe_planar_downsample_geom.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/lightprobe_planar_downsample_vert.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/object_motion_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/object_motion_vert.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/prepass_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/prepass_vert.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/shadow_accum_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/shadow_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/shadow_vert.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/bsdf_lut_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/btdf_lut_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/bsdf_common_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/irradiance_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/octahedron_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/cubemap_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/bsdf_sampling_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/random_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/raytrace_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/renderpass_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/renderpass_postprocess_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/cryptomatte_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/ltc_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/ssr_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/surface_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/surface_geom.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/surface_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/surface_vert.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/update_noise_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/volumetric_accum_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/volumetric_lib.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/volumetric_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/volumetric_geom.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/volumetric_vert.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/volumetric_resolve_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/volumetric_scatter_frag.glsl SRC)
|
||||
data_to_c_simple(engines/eevee/shaders/volumetric_integration_frag.glsl SRC)
|
||||
set(GLSL_SRC
|
||||
engines/eevee/shaders/ambient_occlusion_lib.glsl
|
||||
engines/eevee/shaders/background_vert.glsl
|
||||
engines/eevee/shaders/common_uniforms_lib.glsl
|
||||
engines/eevee/shaders/common_utiltex_lib.glsl
|
||||
engines/eevee/shaders/lights_lib.glsl
|
||||
engines/eevee/shaders/lightprobe_lib.glsl
|
||||
engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl
|
||||
engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl
|
||||
engines/eevee/shaders/lightprobe_filter_visibility_frag.glsl
|
||||
engines/eevee/shaders/lightprobe_geom.glsl
|
||||
engines/eevee/shaders/lightprobe_vert.glsl
|
||||
engines/eevee/shaders/lightprobe_cube_display_frag.glsl
|
||||
engines/eevee/shaders/lightprobe_cube_display_vert.glsl
|
||||
engines/eevee/shaders/lightprobe_grid_display_frag.glsl
|
||||
engines/eevee/shaders/lightprobe_grid_display_vert.glsl
|
||||
engines/eevee/shaders/lightprobe_grid_fill_frag.glsl
|
||||
engines/eevee/shaders/lightprobe_planar_display_frag.glsl
|
||||
engines/eevee/shaders/lightprobe_planar_display_vert.glsl
|
||||
engines/eevee/shaders/lookdev_world_frag.glsl
|
||||
engines/eevee/shaders/closure_eval_lib.glsl
|
||||
engines/eevee/shaders/closure_eval_diffuse_lib.glsl
|
||||
engines/eevee/shaders/closure_eval_glossy_lib.glsl
|
||||
engines/eevee/shaders/closure_eval_refraction_lib.glsl
|
||||
engines/eevee/shaders/closure_eval_translucent_lib.glsl
|
||||
engines/eevee/shaders/closure_type_lib.glsl
|
||||
engines/eevee/shaders/effect_bloom_frag.glsl
|
||||
engines/eevee/shaders/effect_dof_bokeh_frag.glsl
|
||||
engines/eevee/shaders/effect_dof_dilate_tiles_frag.glsl
|
||||
engines/eevee/shaders/effect_dof_downsample_frag.glsl
|
||||
engines/eevee/shaders/effect_dof_filter_frag.glsl
|
||||
engines/eevee/shaders/effect_dof_flatten_tiles_frag.glsl
|
||||
engines/eevee/shaders/effect_dof_gather_frag.glsl
|
||||
engines/eevee/shaders/effect_dof_lib.glsl
|
||||
engines/eevee/shaders/effect_dof_reduce_frag.glsl
|
||||
engines/eevee/shaders/effect_dof_resolve_frag.glsl
|
||||
engines/eevee/shaders/effect_dof_scatter_frag.glsl
|
||||
engines/eevee/shaders/effect_dof_scatter_vert.glsl
|
||||
engines/eevee/shaders/effect_dof_setup_frag.glsl
|
||||
engines/eevee/shaders/effect_reflection_lib.glsl
|
||||
engines/eevee/shaders/effect_reflection_resolve_frag.glsl
|
||||
engines/eevee/shaders/effect_reflection_trace_frag.glsl
|
||||
engines/eevee/shaders/effect_downsample_frag.glsl
|
||||
engines/eevee/shaders/effect_downsample_cube_frag.glsl
|
||||
engines/eevee/shaders/effect_gtao_frag.glsl
|
||||
engines/eevee/shaders/effect_velocity_resolve_frag.glsl
|
||||
engines/eevee/shaders/effect_velocity_tile_frag.glsl
|
||||
engines/eevee/shaders/effect_minmaxz_frag.glsl
|
||||
engines/eevee/shaders/effect_mist_frag.glsl
|
||||
engines/eevee/shaders/effect_motion_blur_frag.glsl
|
||||
engines/eevee/shaders/effect_subsurface_frag.glsl
|
||||
engines/eevee/shaders/effect_translucency_frag.glsl
|
||||
engines/eevee/shaders/effect_temporal_aa.glsl
|
||||
engines/eevee/shaders/lightprobe_planar_downsample_frag.glsl
|
||||
engines/eevee/shaders/lightprobe_planar_downsample_geom.glsl
|
||||
engines/eevee/shaders/lightprobe_planar_downsample_vert.glsl
|
||||
engines/eevee/shaders/object_motion_frag.glsl
|
||||
engines/eevee/shaders/object_motion_vert.glsl
|
||||
engines/eevee/shaders/prepass_frag.glsl
|
||||
engines/eevee/shaders/prepass_vert.glsl
|
||||
engines/eevee/shaders/shadow_accum_frag.glsl
|
||||
engines/eevee/shaders/shadow_frag.glsl
|
||||
engines/eevee/shaders/shadow_vert.glsl
|
||||
engines/eevee/shaders/bsdf_lut_frag.glsl
|
||||
engines/eevee/shaders/btdf_lut_frag.glsl
|
||||
engines/eevee/shaders/bsdf_common_lib.glsl
|
||||
engines/eevee/shaders/irradiance_lib.glsl
|
||||
engines/eevee/shaders/octahedron_lib.glsl
|
||||
engines/eevee/shaders/cubemap_lib.glsl
|
||||
engines/eevee/shaders/bsdf_sampling_lib.glsl
|
||||
engines/eevee/shaders/random_lib.glsl
|
||||
engines/eevee/shaders/raytrace_lib.glsl
|
||||
engines/eevee/shaders/renderpass_lib.glsl
|
||||
engines/eevee/shaders/renderpass_postprocess_frag.glsl
|
||||
engines/eevee/shaders/cryptomatte_frag.glsl
|
||||
engines/eevee/shaders/ltc_lib.glsl
|
||||
engines/eevee/shaders/ssr_lib.glsl
|
||||
engines/eevee/shaders/surface_frag.glsl
|
||||
engines/eevee/shaders/surface_geom.glsl
|
||||
engines/eevee/shaders/surface_lib.glsl
|
||||
engines/eevee/shaders/surface_vert.glsl
|
||||
engines/eevee/shaders/update_noise_frag.glsl
|
||||
engines/eevee/shaders/volumetric_accum_frag.glsl
|
||||
engines/eevee/shaders/volumetric_lib.glsl
|
||||
engines/eevee/shaders/volumetric_frag.glsl
|
||||
engines/eevee/shaders/volumetric_geom.glsl
|
||||
engines/eevee/shaders/volumetric_vert.glsl
|
||||
engines/eevee/shaders/volumetric_resolve_frag.glsl
|
||||
engines/eevee/shaders/volumetric_scatter_frag.glsl
|
||||
engines/eevee/shaders/volumetric_integration_frag.glsl
|
||||
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_cavity_lib.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_common_lib.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_composite_frag.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_curvature_lib.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_data_lib.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_effect_cavity_frag.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_effect_dof_frag.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_effect_outline_frag.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_effect_smaa_frag.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_effect_smaa_vert.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_effect_taa_frag.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_image_lib.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_matcap_lib.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_material_lib.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_merge_infront_frag.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_prepass_frag.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_prepass_hair_vert.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_prepass_pointcloud_vert.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_prepass_vert.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_shader_interface_lib.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_shadow_caps_geom.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_shadow_debug_frag.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_shadow_geom.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_shadow_vert.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_transparent_accum_frag.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_transparent_resolve_frag.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_volume_frag.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_volume_vert.glsl SRC)
|
||||
data_to_c_simple(engines/workbench/shaders/workbench_world_light_lib.glsl SRC)
|
||||
engines/workbench/shaders/workbench_cavity_lib.glsl
|
||||
engines/workbench/shaders/workbench_common_lib.glsl
|
||||
engines/workbench/shaders/workbench_composite_frag.glsl
|
||||
engines/workbench/shaders/workbench_curvature_lib.glsl
|
||||
engines/workbench/shaders/workbench_data_lib.glsl
|
||||
engines/workbench/shaders/workbench_effect_cavity_frag.glsl
|
||||
engines/workbench/shaders/workbench_effect_dof_frag.glsl
|
||||
engines/workbench/shaders/workbench_effect_outline_frag.glsl
|
||||
engines/workbench/shaders/workbench_effect_smaa_frag.glsl
|
||||
engines/workbench/shaders/workbench_effect_smaa_vert.glsl
|
||||
engines/workbench/shaders/workbench_effect_taa_frag.glsl
|
||||
engines/workbench/shaders/workbench_image_lib.glsl
|
||||
engines/workbench/shaders/workbench_matcap_lib.glsl
|
||||
engines/workbench/shaders/workbench_material_lib.glsl
|
||||
engines/workbench/shaders/workbench_merge_infront_frag.glsl
|
||||
engines/workbench/shaders/workbench_prepass_frag.glsl
|
||||
engines/workbench/shaders/workbench_prepass_hair_vert.glsl
|
||||
engines/workbench/shaders/workbench_prepass_pointcloud_vert.glsl
|
||||
engines/workbench/shaders/workbench_prepass_vert.glsl
|
||||
engines/workbench/shaders/workbench_shader_interface_lib.glsl
|
||||
engines/workbench/shaders/workbench_shadow_caps_geom.glsl
|
||||
engines/workbench/shaders/workbench_shadow_debug_frag.glsl
|
||||
engines/workbench/shaders/workbench_shadow_geom.glsl
|
||||
engines/workbench/shaders/workbench_shadow_vert.glsl
|
||||
engines/workbench/shaders/workbench_transparent_accum_frag.glsl
|
||||
engines/workbench/shaders/workbench_transparent_resolve_frag.glsl
|
||||
engines/workbench/shaders/workbench_volume_frag.glsl
|
||||
engines/workbench/shaders/workbench_volume_vert.glsl
|
||||
engines/workbench/shaders/workbench_world_light_lib.glsl
|
||||
|
||||
data_to_c_simple(intern/shaders/common_colormanagement_lib.glsl SRC)
|
||||
data_to_c_simple(intern/shaders/common_globals_lib.glsl SRC)
|
||||
data_to_c_simple(intern/shaders/common_pointcloud_lib.glsl SRC)
|
||||
data_to_c_simple(intern/shaders/common_hair_lib.glsl SRC)
|
||||
data_to_c_simple(intern/shaders/common_hair_refine_vert.glsl SRC)
|
||||
data_to_c_simple(intern/shaders/common_hair_refine_comp.glsl SRC)
|
||||
data_to_c_simple(intern/shaders/common_math_lib.glsl SRC)
|
||||
data_to_c_simple(intern/shaders/common_math_geom_lib.glsl SRC)
|
||||
data_to_c_simple(intern/shaders/common_view_lib.glsl SRC)
|
||||
data_to_c_simple(intern/shaders/common_fxaa_lib.glsl SRC)
|
||||
data_to_c_simple(intern/shaders/common_smaa_lib.glsl SRC)
|
||||
data_to_c_simple(intern/shaders/common_fullscreen_vert.glsl SRC)
|
||||
intern/shaders/common_colormanagement_lib.glsl
|
||||
intern/shaders/common_globals_lib.glsl
|
||||
intern/shaders/common_pointcloud_lib.glsl
|
||||
intern/shaders/common_hair_lib.glsl
|
||||
intern/shaders/common_hair_refine_vert.glsl
|
||||
intern/shaders/common_hair_refine_comp.glsl
|
||||
intern/shaders/common_math_lib.glsl
|
||||
intern/shaders/common_math_geom_lib.glsl
|
||||
intern/shaders/common_view_lib.glsl
|
||||
intern/shaders/common_fxaa_lib.glsl
|
||||
intern/shaders/common_smaa_lib.glsl
|
||||
intern/shaders/common_fullscreen_vert.glsl
|
||||
|
||||
data_to_c_simple(engines/gpencil/shaders/gpencil_frag.glsl SRC)
|
||||
data_to_c_simple(engines/gpencil/shaders/gpencil_vert.glsl SRC)
|
||||
data_to_c_simple(engines/gpencil/shaders/gpencil_antialiasing_frag.glsl SRC)
|
||||
data_to_c_simple(engines/gpencil/shaders/gpencil_antialiasing_vert.glsl SRC)
|
||||
data_to_c_simple(engines/gpencil/shaders/gpencil_common_lib.glsl SRC)
|
||||
data_to_c_simple(engines/gpencil/shaders/gpencil_layer_blend_frag.glsl SRC)
|
||||
data_to_c_simple(engines/gpencil/shaders/gpencil_mask_invert_frag.glsl SRC)
|
||||
data_to_c_simple(engines/gpencil/shaders/gpencil_depth_merge_frag.glsl SRC)
|
||||
data_to_c_simple(engines/gpencil/shaders/gpencil_depth_merge_vert.glsl SRC)
|
||||
data_to_c_simple(engines/gpencil/shaders/gpencil_vfx_frag.glsl SRC)
|
||||
engines/gpencil/shaders/gpencil_frag.glsl
|
||||
engines/gpencil/shaders/gpencil_vert.glsl
|
||||
engines/gpencil/shaders/gpencil_antialiasing_frag.glsl
|
||||
engines/gpencil/shaders/gpencil_antialiasing_vert.glsl
|
||||
engines/gpencil/shaders/gpencil_common_lib.glsl
|
||||
engines/gpencil/shaders/gpencil_layer_blend_frag.glsl
|
||||
engines/gpencil/shaders/gpencil_mask_invert_frag.glsl
|
||||
engines/gpencil/shaders/gpencil_depth_merge_frag.glsl
|
||||
engines/gpencil/shaders/gpencil_depth_merge_vert.glsl
|
||||
engines/gpencil/shaders/gpencil_vfx_frag.glsl
|
||||
|
||||
data_to_c_simple(engines/select/shaders/selection_id_3D_vert.glsl SRC)
|
||||
data_to_c_simple(engines/select/shaders/selection_id_frag.glsl SRC)
|
||||
engines/select/shaders/selection_id_3D_vert.glsl
|
||||
engines/select/shaders/selection_id_frag.glsl
|
||||
|
||||
data_to_c_simple(engines/basic/shaders/conservative_depth_geom.glsl SRC)
|
||||
data_to_c_simple(engines/basic/shaders/depth_vert.glsl SRC)
|
||||
data_to_c_simple(engines/basic/shaders/depth_frag.glsl SRC)
|
||||
engines/basic/shaders/conservative_depth_geom.glsl
|
||||
engines/basic/shaders/depth_vert.glsl
|
||||
engines/basic/shaders/depth_frag.glsl
|
||||
|
||||
data_to_c_simple(engines/overlay/shaders/common_overlay_lib.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/antialiasing_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/antialiasing_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/armature_dof_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/armature_dof_solid_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/armature_envelope_outline_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/armature_envelope_solid_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/armature_envelope_solid_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/armature_shape_outline_geom.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/armature_shape_outline_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/armature_shape_solid_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/armature_shape_solid_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/armature_shape_wire_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/armature_sphere_outline_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/armature_sphere_solid_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/armature_sphere_solid_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/armature_stick_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/armature_stick_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/armature_wire_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/armature_wire_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/background_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/clipbound_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/depth_only_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_curve_handle_geom.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_curve_handle_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_curve_point_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_curve_wire_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_gpencil_canvas_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_gpencil_guide_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_gpencil_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_lattice_point_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_lattice_wire_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_mesh_common_lib.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_mesh_facefill_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_mesh_facefill_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_mesh_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_mesh_geom.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_mesh_normal_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_mesh_analysis_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_mesh_analysis_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_mesh_skin_root_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_mesh_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_particle_strand_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_particle_point_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_uv_edges_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_uv_edges_geom.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_uv_edges_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_uv_verts_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_uv_verts_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_uv_faces_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_uv_face_dots_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_uv_image_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_uv_image_mask_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_uv_stretching_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/edit_uv_tiled_image_borders_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/extra_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/extra_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/extra_groundline_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/extra_lightprobe_grid_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/extra_loose_point_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/extra_loose_point_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/extra_point_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/extra_wire_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/extra_wire_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/facing_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/facing_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/grid_background_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/grid_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/grid_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/image_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/image_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/motion_path_line_geom.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/motion_path_line_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/motion_path_point_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/outline_detect_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/outline_prepass_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/outline_prepass_geom.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/outline_prepass_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/paint_face_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/paint_point_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/paint_texture_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/paint_texture_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/paint_vertcol_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/paint_vertcol_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/paint_weight_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/paint_weight_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/paint_wire_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/particle_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/particle_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/sculpt_mask_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/sculpt_mask_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/volume_velocity_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/volume_gridlines_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/wireframe_vert.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/wireframe_frag.glsl SRC)
|
||||
data_to_c_simple(engines/overlay/shaders/xray_fade_frag.glsl SRC)
|
||||
engines/overlay/shaders/common_overlay_lib.glsl
|
||||
engines/overlay/shaders/antialiasing_frag.glsl
|
||||
engines/overlay/shaders/antialiasing_vert.glsl
|
||||
engines/overlay/shaders/armature_dof_vert.glsl
|
||||
engines/overlay/shaders/armature_dof_solid_frag.glsl
|
||||
engines/overlay/shaders/armature_envelope_outline_vert.glsl
|
||||
engines/overlay/shaders/armature_envelope_solid_frag.glsl
|
||||
engines/overlay/shaders/armature_envelope_solid_vert.glsl
|
||||
engines/overlay/shaders/armature_shape_outline_geom.glsl
|
||||
engines/overlay/shaders/armature_shape_outline_vert.glsl
|
||||
engines/overlay/shaders/armature_shape_solid_frag.glsl
|
||||
engines/overlay/shaders/armature_shape_solid_vert.glsl
|
||||
engines/overlay/shaders/armature_shape_wire_vert.glsl
|
||||
engines/overlay/shaders/armature_sphere_outline_vert.glsl
|
||||
engines/overlay/shaders/armature_sphere_solid_frag.glsl
|
||||
engines/overlay/shaders/armature_sphere_solid_vert.glsl
|
||||
engines/overlay/shaders/armature_stick_frag.glsl
|
||||
engines/overlay/shaders/armature_stick_vert.glsl
|
||||
engines/overlay/shaders/armature_wire_frag.glsl
|
||||
engines/overlay/shaders/armature_wire_vert.glsl
|
||||
engines/overlay/shaders/background_frag.glsl
|
||||
engines/overlay/shaders/clipbound_vert.glsl
|
||||
engines/overlay/shaders/depth_only_vert.glsl
|
||||
engines/overlay/shaders/edit_curve_handle_geom.glsl
|
||||
engines/overlay/shaders/edit_curve_handle_vert.glsl
|
||||
engines/overlay/shaders/edit_curve_point_vert.glsl
|
||||
engines/overlay/shaders/edit_curve_wire_vert.glsl
|
||||
engines/overlay/shaders/edit_gpencil_canvas_vert.glsl
|
||||
engines/overlay/shaders/edit_gpencil_guide_vert.glsl
|
||||
engines/overlay/shaders/edit_gpencil_vert.glsl
|
||||
engines/overlay/shaders/edit_lattice_point_vert.glsl
|
||||
engines/overlay/shaders/edit_lattice_wire_vert.glsl
|
||||
engines/overlay/shaders/edit_mesh_common_lib.glsl
|
||||
engines/overlay/shaders/edit_mesh_facefill_frag.glsl
|
||||
engines/overlay/shaders/edit_mesh_facefill_vert.glsl
|
||||
engines/overlay/shaders/edit_mesh_frag.glsl
|
||||
engines/overlay/shaders/edit_mesh_geom.glsl
|
||||
engines/overlay/shaders/edit_mesh_normal_vert.glsl
|
||||
engines/overlay/shaders/edit_mesh_analysis_frag.glsl
|
||||
engines/overlay/shaders/edit_mesh_analysis_vert.glsl
|
||||
engines/overlay/shaders/edit_mesh_skin_root_vert.glsl
|
||||
engines/overlay/shaders/edit_mesh_vert.glsl
|
||||
engines/overlay/shaders/edit_particle_strand_vert.glsl
|
||||
engines/overlay/shaders/edit_particle_point_vert.glsl
|
||||
engines/overlay/shaders/edit_uv_edges_vert.glsl
|
||||
engines/overlay/shaders/edit_uv_edges_geom.glsl
|
||||
engines/overlay/shaders/edit_uv_edges_frag.glsl
|
||||
engines/overlay/shaders/edit_uv_verts_vert.glsl
|
||||
engines/overlay/shaders/edit_uv_verts_frag.glsl
|
||||
engines/overlay/shaders/edit_uv_faces_vert.glsl
|
||||
engines/overlay/shaders/edit_uv_face_dots_vert.glsl
|
||||
engines/overlay/shaders/edit_uv_image_vert.glsl
|
||||
engines/overlay/shaders/edit_uv_image_mask_frag.glsl
|
||||
engines/overlay/shaders/edit_uv_stretching_vert.glsl
|
||||
engines/overlay/shaders/edit_uv_tiled_image_borders_vert.glsl
|
||||
engines/overlay/shaders/extra_frag.glsl
|
||||
engines/overlay/shaders/extra_vert.glsl
|
||||
engines/overlay/shaders/extra_groundline_vert.glsl
|
||||
engines/overlay/shaders/extra_lightprobe_grid_vert.glsl
|
||||
engines/overlay/shaders/extra_loose_point_frag.glsl
|
||||
engines/overlay/shaders/extra_loose_point_vert.glsl
|
||||
engines/overlay/shaders/extra_point_vert.glsl
|
||||
engines/overlay/shaders/extra_wire_frag.glsl
|
||||
engines/overlay/shaders/extra_wire_vert.glsl
|
||||
engines/overlay/shaders/facing_frag.glsl
|
||||
engines/overlay/shaders/facing_vert.glsl
|
||||
engines/overlay/shaders/grid_background_frag.glsl
|
||||
engines/overlay/shaders/grid_frag.glsl
|
||||
engines/overlay/shaders/grid_vert.glsl
|
||||
engines/overlay/shaders/image_vert.glsl
|
||||
engines/overlay/shaders/image_frag.glsl
|
||||
engines/overlay/shaders/motion_path_line_geom.glsl
|
||||
engines/overlay/shaders/motion_path_line_vert.glsl
|
||||
engines/overlay/shaders/motion_path_point_vert.glsl
|
||||
engines/overlay/shaders/outline_detect_frag.glsl
|
||||
engines/overlay/shaders/outline_prepass_frag.glsl
|
||||
engines/overlay/shaders/outline_prepass_geom.glsl
|
||||
engines/overlay/shaders/outline_prepass_vert.glsl
|
||||
engines/overlay/shaders/paint_face_vert.glsl
|
||||
engines/overlay/shaders/paint_point_vert.glsl
|
||||
engines/overlay/shaders/paint_texture_frag.glsl
|
||||
engines/overlay/shaders/paint_texture_vert.glsl
|
||||
engines/overlay/shaders/paint_vertcol_frag.glsl
|
||||
engines/overlay/shaders/paint_vertcol_vert.glsl
|
||||
engines/overlay/shaders/paint_weight_frag.glsl
|
||||
engines/overlay/shaders/paint_weight_vert.glsl
|
||||
engines/overlay/shaders/paint_wire_vert.glsl
|
||||
engines/overlay/shaders/particle_vert.glsl
|
||||
engines/overlay/shaders/particle_frag.glsl
|
||||
engines/overlay/shaders/sculpt_mask_vert.glsl
|
||||
engines/overlay/shaders/sculpt_mask_frag.glsl
|
||||
engines/overlay/shaders/volume_velocity_vert.glsl
|
||||
engines/overlay/shaders/volume_gridlines_vert.glsl
|
||||
engines/overlay/shaders/wireframe_vert.glsl
|
||||
engines/overlay/shaders/wireframe_frag.glsl
|
||||
engines/overlay/shaders/xray_fade_frag.glsl
|
||||
|
||||
data_to_c_simple(engines/image/shaders/engine_image_frag.glsl SRC)
|
||||
data_to_c_simple(engines/image/shaders/engine_image_vert.glsl SRC)
|
||||
engines/image/shaders/engine_image_frag.glsl
|
||||
engines/image/shaders/engine_image_vert.glsl
|
||||
)
|
||||
|
||||
set(GLSL_C)
|
||||
foreach(GLSL_FILE ${GLSL_SRC})
|
||||
data_to_c_simple(${GLSL_FILE} GLSL_C)
|
||||
endforeach()
|
||||
|
||||
blender_add_lib(bf_draw_shaders "${GLSL_C}" "" "" "")
|
||||
|
||||
list(APPEND LIB
|
||||
bf_draw_shaders
|
||||
)
|
||||
|
||||
set(GLSL_SOURCE_CONTENT "")
|
||||
foreach(GLSL_FILE ${GLSL_SRC})
|
||||
get_filename_component(GLSL_FILE_NAME ${GLSL_FILE} NAME)
|
||||
string(REPLACE "." "_" GLSL_FILE_NAME_UNDERSCORES ${GLSL_FILE_NAME})
|
||||
string(APPEND GLSL_SOURCE_CONTENT "SHADER_SOURCE\(datatoc_${GLSL_FILE_NAME_UNDERSCORES}, \"${GLSL_FILE_NAME}\"\)\n")
|
||||
endforeach()
|
||||
|
||||
set(glsl_source_list_file "${CMAKE_CURRENT_BINARY_DIR}/glsl_draw_source_list.h")
|
||||
file(GENERATE OUTPUT ${glsl_source_list_file} CONTENT "${GLSL_SOURCE_CONTENT}")
|
||||
list(APPEND SRC ${glsl_source_list_file})
|
||||
list(APPEND INC ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
target_include_directories(bf_draw_shaders PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
list(APPEND INC
|
||||
)
|
||||
|
@@ -0,0 +1,25 @@
|
||||
|
||||
#include "gpu_shader_descriptor.h"
|
||||
|
||||
GPU_SHADER_DESCRIPTOR(workbench_effect_cavity)
|
||||
{
|
||||
.do_static_compilation = true,
|
||||
.fragment_outputs =
|
||||
{
|
||||
[0] = FRAGMENT_OUTPUT(VEC4, "fragColor"),
|
||||
},
|
||||
.resources =
|
||||
{
|
||||
[DESCRIPTOR_SET_1] =
|
||||
{
|
||||
[0] = SAMPLER(FLOAT_2D, "depthBuffer", GPU_SAMPLER_DEFAULT),
|
||||
[1] = SAMPLER(FLOAT_2D, "normalBuffer", GPU_SAMPLER_DEFAULT),
|
||||
[2] = SAMPLER(UINT_2D, "objectIdBuffer", GPU_SAMPLER_DEFAULT),
|
||||
},
|
||||
},
|
||||
.fragment_source = "workbench_effect_cavity_frag.glsl",
|
||||
.additional_descriptors =
|
||||
{
|
||||
"draw_fullscreen",
|
||||
},
|
||||
};
|
@@ -0,0 +1,259 @@
|
||||
|
||||
#include "gpu_shader_descriptor.h"
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Object Type
|
||||
* \{ */
|
||||
|
||||
GPU_SHADER_DESCRIPTOR(workbench_mesh)
|
||||
{
|
||||
.vertex_inputs =
|
||||
{
|
||||
[0] = VERTEX_INPUT(VEC3, "pos"),
|
||||
[1] = VERTEX_INPUT(VEC3, "nor"),
|
||||
[2] = VERTEX_INPUT(VEC4, "ac"),
|
||||
[3] = VERTEX_INPUT(VEC2, "au"),
|
||||
},
|
||||
.vertex_source = "workbench_prepass_vert.glsl",
|
||||
};
|
||||
|
||||
GPU_SHADER_DESCRIPTOR(workbench_hair)
|
||||
{
|
||||
.resources =
|
||||
{
|
||||
[DESCRIPTOR_SET_0] =
|
||||
{
|
||||
[0] = SAMPLER(FLOAT_BUFFER, "ac", GPU_SAMPLER_DEFAULT),
|
||||
[1] = SAMPLER(FLOAT_BUFFER, "au", GPU_SAMPLER_DEFAULT),
|
||||
},
|
||||
},
|
||||
.vertex_source = "workbench_prepass_hair_vert.glsl",
|
||||
/* TODO */
|
||||
// .additional_descriptors = { "draw_hair", },
|
||||
};
|
||||
|
||||
GPU_SHADER_DESCRIPTOR(workbench_pointcloud)
|
||||
{
|
||||
.vertex_inputs =
|
||||
{
|
||||
[0] = VERTEX_INPUT(VEC4, "pos"),
|
||||
/* ---- Instanced attribs ---- */
|
||||
[1] = VERTEX_INPUT(VEC3, "pos_inst"),
|
||||
[2] = VERTEX_INPUT(VEC3, "nor"),
|
||||
},
|
||||
.vertex_source = "workbench_prepass_pointcloud_vert.glsl",
|
||||
/* TODO */
|
||||
// .additional_descriptors = { "draw_pointcloud", },
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Texture Type
|
||||
* \{ */
|
||||
|
||||
GPU_SHADER_DESCRIPTOR(workbench_texture_none)
|
||||
{
|
||||
.defines =
|
||||
{
|
||||
[0] = "#define TEXTURE_NONE\n",
|
||||
},
|
||||
};
|
||||
|
||||
GPU_SHADER_DESCRIPTOR(workbench_texture_single)
|
||||
{
|
||||
.resources =
|
||||
{
|
||||
[DESCRIPTOR_SET_0] =
|
||||
{
|
||||
/* ---- Hair buffers ---- */
|
||||
// [0] = SAMPLER(FLOAT_BUFFER, "ac", GPU_SAMPLER_DEFAULT),
|
||||
// [1] = SAMPLER(FLOAT_BUFFER, "au", GPU_SAMPLER_DEFAULT),
|
||||
[2] = SAMPLER(FLOAT_2D, "imageTexture", GPU_SAMPLER_DEFAULT),
|
||||
},
|
||||
},
|
||||
.defines =
|
||||
{
|
||||
[0] = "#define V3D_SHADING_TEXTURE_COLOR\n",
|
||||
},
|
||||
};
|
||||
|
||||
GPU_SHADER_DESCRIPTOR(workbench_texture_tile)
|
||||
{
|
||||
.resources =
|
||||
{
|
||||
[DESCRIPTOR_SET_0] =
|
||||
{
|
||||
/* ---- Hair buffers ---- */
|
||||
// [0] = SAMPLER(FLOAT_BUFFER, "ac", GPU_SAMPLER_DEFAULT),
|
||||
// [1] = SAMPLER(FLOAT_BUFFER, "au", GPU_SAMPLER_DEFAULT),
|
||||
[2] = SAMPLER(FLOAT_2D_ARRAY, "imageTileArray", GPU_SAMPLER_DEFAULT),
|
||||
[3] = SAMPLER(FLOAT_1D_ARRAY, "imageTileData", GPU_SAMPLER_DEFAULT),
|
||||
},
|
||||
},
|
||||
.defines =
|
||||
{
|
||||
[0] = "#define TEXTURE_IMAGE_ARRAY\n",
|
||||
},
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Lighting Type
|
||||
* \{ */
|
||||
|
||||
GPU_SHADER_DESCRIPTOR(workbench_lighting_studio)
|
||||
{
|
||||
.defines =
|
||||
{
|
||||
[1] = "#define V3D_LIGHTING_STUDIO\n",
|
||||
},
|
||||
};
|
||||
|
||||
GPU_SHADER_DESCRIPTOR(workbench_lighting_matcap)
|
||||
{
|
||||
.defines =
|
||||
{
|
||||
[1] = "#define V3D_LIGHTING_MATCAP\n",
|
||||
},
|
||||
};
|
||||
|
||||
GPU_SHADER_DESCRIPTOR(workbench_lighting_flat)
|
||||
{
|
||||
.defines =
|
||||
{
|
||||
[1] = "#define V3D_LIGHTING_FLAT\n",
|
||||
},
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Material Interface
|
||||
* \{ */
|
||||
|
||||
GPU_STAGE_INTERFACE_CREATE(workbench_material_iface)
|
||||
{
|
||||
{VEC3, "normal_interp"},
|
||||
{VEC3, "color_interp"},
|
||||
{FLOAT, "alpha_interp"},
|
||||
{VEC2, "uv_interp"},
|
||||
{INT, "object_id", FLAT},
|
||||
{FLOAT, "roughness", FLAT},
|
||||
{FLOAT, "metallic", FLAT},
|
||||
};
|
||||
|
||||
GPU_SHADER_DESCRIPTOR(workbench_material)
|
||||
{
|
||||
.vertex_out_interfaces =
|
||||
{
|
||||
[0] = STAGE_INTERFACE("", workbench_material_iface),
|
||||
},
|
||||
.additional_descriptors =
|
||||
{
|
||||
"draw_view",
|
||||
},
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Pipeline Type
|
||||
* \{ */
|
||||
|
||||
GPU_SHADER_DESCRIPTOR(workbench_transparent_accum)
|
||||
{
|
||||
|
||||
.fragment_outputs =
|
||||
{
|
||||
/* Note: Blending will be skipped on objectId because output is a
|
||||
non-normalized integer buffer. */
|
||||
[0] = FRAGMENT_OUTPUT(VEC4, "transparentAccum"),
|
||||
[1] = FRAGMENT_OUTPUT(VEC4, "revealageAccum"),
|
||||
[2] = FRAGMENT_OUTPUT(UINT, "objectId"),
|
||||
},
|
||||
.fragment_source = "workbench_effect_cavity_frag.glsl",
|
||||
.additional_descriptors =
|
||||
{
|
||||
"workbench_material",
|
||||
},
|
||||
};
|
||||
|
||||
GPU_SHADER_DESCRIPTOR(workbench_opaque)
|
||||
{
|
||||
|
||||
.fragment_outputs =
|
||||
{
|
||||
/* Note: Blending will be skipped on objectId because output is a
|
||||
non-normalized integer buffer. */
|
||||
[0] = FRAGMENT_OUTPUT(VEC4, "materialData"),
|
||||
[1] = FRAGMENT_OUTPUT(VEC2, "normalData"),
|
||||
[2] = FRAGMENT_OUTPUT(UINT, "objectId"),
|
||||
},
|
||||
.resources =
|
||||
{
|
||||
[DESCRIPTOR_SET_0] =
|
||||
{
|
||||
[4] = UNIFORM_BUFFER("WB_Scene", "scene"),
|
||||
},
|
||||
},
|
||||
.fragment_source = "workbench_effect_cavity_frag.glsl",
|
||||
.additional_descriptors =
|
||||
{
|
||||
"workbench_material",
|
||||
},
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Variations Declaration
|
||||
* \{ */
|
||||
|
||||
#define WORKBENCH_SURFACETYPE_VARIATIONS(prefix, ...) \
|
||||
GPU_SHADER_DESCRIPTOR(prefix##_mesh) \
|
||||
{ \
|
||||
.additional_descriptors = \
|
||||
{ \
|
||||
"workbench_mesh", \
|
||||
__VA_ARGS__, \
|
||||
}, \
|
||||
}; \
|
||||
GPU_SHADER_DESCRIPTOR(prefix##_hair) \
|
||||
{ \
|
||||
.additional_descriptors = \
|
||||
{ \
|
||||
"workbench_hair", \
|
||||
__VA_ARGS__, \
|
||||
}, \
|
||||
}; \
|
||||
GPU_SHADER_DESCRIPTOR(prefix##_ptcloud) \
|
||||
{ \
|
||||
.additional_descriptors = \
|
||||
{ \
|
||||
"workbench_pointcloud", \
|
||||
__VA_ARGS__, \
|
||||
}, \
|
||||
};
|
||||
|
||||
#define WORKBENCH_PIPELINE_VARIATIONS(prefix, ...) \
|
||||
WORKBENCH_SURFACETYPE_VARIATIONS(prefix##_transp_studio, \
|
||||
"workbench_transparent_accum", \
|
||||
"workbench_lighting_studio", \
|
||||
__VA_ARGS__) \
|
||||
WORKBENCH_SURFACETYPE_VARIATIONS(prefix##_transp_matcap, \
|
||||
"workbench_transparent_accum", \
|
||||
"workbench_lighting_matcap", \
|
||||
__VA_ARGS__) \
|
||||
WORKBENCH_SURFACETYPE_VARIATIONS(prefix##_transp_flat, \
|
||||
"workbench_transparent_accum", \
|
||||
"workbench_lighting_flat", \
|
||||
__VA_ARGS__) \
|
||||
WORKBENCH_SURFACETYPE_VARIATIONS(prefix##_opaque, "workbench_opaque", __VA_ARGS__)
|
||||
|
||||
WORKBENCH_PIPELINE_VARIATIONS(workbench_tex_none, "workbench_texture_none")
|
||||
WORKBENCH_PIPELINE_VARIATIONS(workbench_tex_single, "workbench_texture_single")
|
||||
WORKBENCH_PIPELINE_VARIATIONS(workbench_tex_tile, "workbench_texture_tile")
|
||||
|
||||
/** \} */
|
16
source/blender/draw/intern/shaders/draw_fullscreen.desc.h
Normal file
16
source/blender/draw/intern/shaders/draw_fullscreen.desc.h
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
#include "gpu_shader_descriptor.h"
|
||||
|
||||
GPU_STAGE_INTERFACE_CREATE(fullscreen_iface)
|
||||
{
|
||||
{VEC4, "uvcoordsvar"},
|
||||
};
|
||||
|
||||
GPU_SHADER_DESCRIPTOR(draw_fullscreen)
|
||||
{
|
||||
.vertex_out_interfaces =
|
||||
{
|
||||
[0] = STAGE_INTERFACE("", fullscreen_iface),
|
||||
},
|
||||
.vertex_source = "common_fullscreen_vert.glsl",
|
||||
};
|
13
source/blender/draw/intern/shaders/draw_object_infos.desc.h
Normal file
13
source/blender/draw/intern/shaders/draw_object_infos.desc.h
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
#include "gpu_shader_descriptor.h"
|
||||
|
||||
GPU_SHADER_DESCRIPTOR(draw_object_infos)
|
||||
{
|
||||
.resources =
|
||||
{
|
||||
[DESCRIPTOR_SET_1] =
|
||||
{
|
||||
[2] = UNIFORM_BUFFER("ObjectInfos", "drw_infos[DRW_RESOURCE_CHUNK_LEN]"),
|
||||
},
|
||||
},
|
||||
};
|
14
source/blender/draw/intern/shaders/draw_view.desc.h
Normal file
14
source/blender/draw/intern/shaders/draw_view.desc.h
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
#include "gpu_shader_descriptor.h"
|
||||
|
||||
GPU_SHADER_DESCRIPTOR(draw_view)
|
||||
{
|
||||
.resources =
|
||||
{
|
||||
[DESCRIPTOR_SET_1] =
|
||||
{
|
||||
[0] = UNIFORM_BUFFER("ViewInfos", "drw_view"),
|
||||
[1] = UNIFORM_BUFFER("ObjectMatrices", "drw_matrices[DRW_RESOURCE_CHUNK_LEN]"),
|
||||
},
|
||||
},
|
||||
};
|
@@ -30,7 +30,10 @@
|
||||
#include "BLI_fileops.h"
|
||||
#include "BLI_fnmatch.h"
|
||||
#include "BLI_path_util.h"
|
||||
|
||||
#include "ED_asset.h"
|
||||
#include "ED_asset_catalog.hh"
|
||||
#include "ED_screen.h"
|
||||
#include "ED_util.h"
|
||||
/* XXX needs access to the file list, should all be done via the asset system in future. */
|
||||
#include "ED_fileselect.h"
|
||||
@@ -388,8 +391,14 @@ static void ASSET_OT_clear(wmOperatorType *ot)
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
static bool asset_list_refresh_poll(bContext *C)
|
||||
static bool asset_library_refresh_poll(bContext *C)
|
||||
{
|
||||
if (ED_operator_asset_browsing_active(C)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* While not inside an Asset Browser, check if there's a asset list stored for the active asset
|
||||
* library (stored in the workspace, obtained via context). */
|
||||
const AssetLibraryReference *library = CTX_wm_asset_library_ref(C);
|
||||
if (!library) {
|
||||
return false;
|
||||
@@ -398,23 +407,38 @@ static bool asset_list_refresh_poll(bContext *C)
|
||||
return ED_assetlist_storage_has_list_for_library(library);
|
||||
}
|
||||
|
||||
static int asset_list_refresh_exec(bContext *C, wmOperator *UNUSED(unused))
|
||||
static int asset_library_refresh_exec(bContext *C, wmOperator *UNUSED(unused))
|
||||
{
|
||||
const AssetLibraryReference *library = CTX_wm_asset_library_ref(C);
|
||||
ED_assetlist_clear(library, C);
|
||||
/* Execution mode #1: Inside the Asset Browser. */
|
||||
if (ED_operator_asset_browsing_active(C)) {
|
||||
SpaceFile *sfile = CTX_wm_space_file(C);
|
||||
ED_fileselect_clear(CTX_wm_manager(C), sfile);
|
||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_FILE_LIST, NULL);
|
||||
}
|
||||
else {
|
||||
/* Execution mode #2: Outside the Asset Browser, use the asset list. */
|
||||
const AssetLibraryReference *library = CTX_wm_asset_library_ref(C);
|
||||
ED_assetlist_clear(library, C);
|
||||
}
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
static void ASSET_OT_list_refresh(struct wmOperatorType *ot)
|
||||
/**
|
||||
* This operator currently covers both cases, the File/Asset Browser file list and the asset list
|
||||
* used for the asset-view template. Once the asset list design is used by the Asset Browser, this
|
||||
* can be simplified to just that case.
|
||||
*/
|
||||
static void ASSET_OT_library_refresh(struct wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Refresh Asset List";
|
||||
ot->description = "Trigger a reread of the assets";
|
||||
ot->idname = "ASSET_OT_list_refresh";
|
||||
ot->name = "Refresh Asset Library";
|
||||
ot->description = "Reread assets and asset catalogs from the asset library on disk";
|
||||
ot->idname = "ASSET_OT_library_refresh";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec = asset_list_refresh_exec;
|
||||
ot->poll = asset_list_refresh_poll;
|
||||
ot->exec = asset_library_refresh_exec;
|
||||
ot->poll = asset_library_refresh_poll;
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
@@ -901,5 +925,5 @@ void ED_operatortypes_asset(void)
|
||||
WM_operatortype_append(ASSET_OT_catalog_undo_push);
|
||||
WM_operatortype_append(ASSET_OT_bundle_install);
|
||||
|
||||
WM_operatortype_append(ASSET_OT_list_refresh);
|
||||
WM_operatortype_append(ASSET_OT_library_refresh);
|
||||
}
|
||||
|
@@ -1762,6 +1762,8 @@ void UI_panel_header_buttons_begin(struct Panel *panel);
|
||||
void UI_panel_header_buttons_end(struct Panel *panel);
|
||||
void UI_panel_end(struct Panel *panel, int width, int height);
|
||||
|
||||
void UI_panel_context_pointer_set(struct Panel *panel, const char *name, struct PointerRNA *ptr);
|
||||
|
||||
bool UI_panel_is_closed(const struct Panel *panel);
|
||||
bool UI_panel_is_active(const struct Panel *panel);
|
||||
void UI_panel_label_offset(const struct uiBlock *block, int *r_x, int *r_y);
|
||||
|
@@ -486,8 +486,12 @@ static void reorder_instanced_panel_list(bContext *C, ARegion *region, Panel *dr
|
||||
/* Set the bit to tell the interface to instanced the list. */
|
||||
drag_panel->flag |= PNL_INSTANCED_LIST_ORDER_CHANGED;
|
||||
|
||||
CTX_store_set(C, drag_panel->runtime.context);
|
||||
|
||||
/* Finally, move this panel's list item to the new index in its list. */
|
||||
drag_panel->type->reorder(C, drag_panel, move_to_index);
|
||||
|
||||
CTX_store_set(C, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2458,6 +2462,17 @@ static void ui_panel_custom_data_set_recursive(Panel *panel, PointerRNA *custom_
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a context for this entire panel and its current layout. This should be used whenever panel
|
||||
* callbacks that are called outside of regular drawing might require context. Currently it affects
|
||||
* the #PanelType.reorder callback only.
|
||||
*/
|
||||
void UI_panel_context_pointer_set(Panel *panel, const char *name, PointerRNA *ptr)
|
||||
{
|
||||
uiLayoutSetContextPointer(panel->layout, name, ptr);
|
||||
panel->runtime.context = uiLayoutGetContextStore(panel->layout);
|
||||
}
|
||||
|
||||
void UI_panel_custom_data_set(Panel *panel, PointerRNA *custom_data)
|
||||
{
|
||||
BLI_assert(panel->type != NULL);
|
||||
|
@@ -227,7 +227,7 @@ void uiTemplateAssetView(uiLayout *layout,
|
||||
if ((display_flags & UI_TEMPLATE_ASSET_DRAW_NO_LIBRARY) == 0) {
|
||||
uiItemFullR(row, asset_library_dataptr, asset_library_prop, RNA_NO_INDEX, 0, 0, "", 0);
|
||||
if (asset_library_ref.type != ASSET_LIBRARY_LOCAL) {
|
||||
uiItemO(row, "", ICON_FILE_REFRESH, "ASSET_OT_list_refresh");
|
||||
uiItemO(row, "", ICON_FILE_REFRESH, "ASSET_OT_library_refresh");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2727,7 +2727,12 @@ static void draw_constraint_header(uiLayout *layout, Object *ob, bConstraint *co
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(&ob->id, &RNA_Constraint, con, &ptr);
|
||||
|
||||
uiLayoutSetContextPointer(layout, "constraint", &ptr);
|
||||
if (block->panel) {
|
||||
UI_panel_context_pointer_set(block->panel, "constraint", &ptr);
|
||||
}
|
||||
else {
|
||||
uiLayoutSetContextPointer(layout, "constraint", &ptr);
|
||||
}
|
||||
|
||||
/* Constraint type icon. */
|
||||
uiLayout *sub = uiLayoutRow(layout, false);
|
||||
|
@@ -79,7 +79,6 @@ void FILE_OT_directory_new(struct wmOperatorType *ot);
|
||||
void FILE_OT_previous(struct wmOperatorType *ot);
|
||||
void FILE_OT_next(struct wmOperatorType *ot);
|
||||
void FILE_OT_refresh(struct wmOperatorType *ot);
|
||||
void FILE_OT_asset_library_refresh(struct wmOperatorType *ot);
|
||||
void FILE_OT_filenum(struct wmOperatorType *ot);
|
||||
void FILE_OT_delete(struct wmOperatorType *ot);
|
||||
void FILE_OT_rename(struct wmOperatorType *ot);
|
||||
|
@@ -1955,35 +1955,6 @@ void FILE_OT_refresh(struct wmOperatorType *ot)
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Refresh Asset Library Operator
|
||||
* \{ */
|
||||
|
||||
static int file_asset_library_refresh_exec(bContext *C, wmOperator *UNUSED(unused))
|
||||
{
|
||||
wmWindowManager *wm = CTX_wm_manager(C);
|
||||
SpaceFile *sfile = CTX_wm_space_file(C);
|
||||
|
||||
ED_fileselect_clear(wm, sfile);
|
||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_FILE_LIST, NULL);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void FILE_OT_asset_library_refresh(struct wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Refresh Asset Library";
|
||||
ot->description = "Reread assets and asset catalogs from the asset library on disk";
|
||||
ot->idname = "FILE_OT_asset_library_refresh";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec = file_asset_library_refresh_exec;
|
||||
ot->poll = ED_operator_asset_browsing_active;
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Navigate Parent Operator
|
||||
* \{ */
|
||||
|
@@ -261,7 +261,7 @@ static void file_panel_asset_catalog_buttons_draw(const bContext *C, Panel *pane
|
||||
CTX_free(mutable_ctx);
|
||||
}
|
||||
else {
|
||||
uiItemO(row, "", ICON_FILE_REFRESH, "FILE_OT_asset_library_refresh");
|
||||
uiItemO(row, "", ICON_FILE_REFRESH, "ASSET_OT_library_refresh");
|
||||
}
|
||||
|
||||
uiItemS(col);
|
||||
|
@@ -688,7 +688,6 @@ static void file_operatortypes(void)
|
||||
WM_operatortype_append(FILE_OT_previous);
|
||||
WM_operatortype_append(FILE_OT_next);
|
||||
WM_operatortype_append(FILE_OT_refresh);
|
||||
WM_operatortype_append(FILE_OT_asset_library_refresh);
|
||||
WM_operatortype_append(FILE_OT_bookmark_add);
|
||||
WM_operatortype_append(FILE_OT_bookmark_delete);
|
||||
WM_operatortype_append(FILE_OT_bookmark_cleanup);
|
||||
|
@@ -1664,24 +1664,22 @@ static std::string node_get_execution_time_label(const SpaceNode *snode, const b
|
||||
if (exec_time_us == 0) {
|
||||
return std::string("-");
|
||||
}
|
||||
else if (exec_time_us < 100) {
|
||||
if (exec_time_us < 100) {
|
||||
return std::string("< 0.1 ms");
|
||||
}
|
||||
else {
|
||||
short precision = 0;
|
||||
/* Show decimal if value is below 1ms */
|
||||
if (exec_time_us < 1000) {
|
||||
precision = 2;
|
||||
}
|
||||
else if (exec_time_us < 10000) {
|
||||
precision = 1;
|
||||
}
|
||||
|
||||
std::stringstream stream;
|
||||
stream << std::fixed << std::setprecision(precision) << (exec_time_us / 1000.0f);
|
||||
return std::string(stream.str() + " ms");
|
||||
int precision = 0;
|
||||
/* Show decimal if value is below 1ms */
|
||||
if (exec_time_us < 1000) {
|
||||
precision = 2;
|
||||
}
|
||||
return std::string("");
|
||||
else if (exec_time_us < 10000) {
|
||||
precision = 1;
|
||||
}
|
||||
|
||||
std::stringstream stream;
|
||||
stream << std::fixed << std::setprecision(precision) << (exec_time_us / 1000.0f);
|
||||
return stream.str() + " ms";
|
||||
}
|
||||
|
||||
struct NodeExtraInfoRow {
|
||||
|
@@ -286,7 +286,14 @@ static bool gizmo2d_calc_bounds(const bContext *C, float *r_center, float *r_min
|
||||
* In addition to this, the rotation of the bounding box can not currently be hooked up
|
||||
* properly to read the result from the transform system (when transforming multiple strips).
|
||||
*/
|
||||
mid_v2_v2v2(r_center, r_min, r_max);
|
||||
const int pivot_point = scene->toolsettings->sequencer_tool_settings->pivot_point;
|
||||
if (pivot_point == V3D_AROUND_CURSOR) {
|
||||
SpaceSeq *sseq = area->spacedata.first;
|
||||
SEQ_image_preview_unit_to_px(scene, sseq->cursor, r_center);
|
||||
}
|
||||
else {
|
||||
mid_v2_v2v2(r_center, r_min, r_max);
|
||||
}
|
||||
zero_v2(r_min);
|
||||
zero_v2(r_max);
|
||||
return has_select;
|
||||
@@ -353,39 +360,59 @@ static float gizmo2d_calc_rotation(const bContext *C)
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
static bool gizmo2d_calc_center(const bContext *C, float r_center[2])
|
||||
static bool seq_get_strip_pivot_median(const Scene *scene, float r_pivot[2])
|
||||
{
|
||||
zero_v2(r_pivot);
|
||||
|
||||
ListBase *seqbase = SEQ_active_seqbase_get(SEQ_editing_get(scene));
|
||||
SeqCollection *strips = SEQ_query_rendered_strips(seqbase, scene->r.cfra, 0);
|
||||
SEQ_filter_selected_strips(strips);
|
||||
bool has_select = SEQ_collection_len(strips) != 0;
|
||||
|
||||
if (has_select) {
|
||||
Sequence *seq;
|
||||
SEQ_ITERATOR_FOREACH (seq, strips) {
|
||||
float origin[2];
|
||||
SEQ_image_transform_origin_offset_pixelspace_get(scene, seq, origin);
|
||||
add_v2_v2(r_pivot, origin);
|
||||
}
|
||||
mul_v2_fl(r_pivot, 1.0f / SEQ_collection_len(strips));
|
||||
}
|
||||
|
||||
SEQ_collection_free(strips);
|
||||
return has_select;
|
||||
}
|
||||
|
||||
static bool gizmo2d_calc_transform_pivot(const bContext *C, float r_pivot[2])
|
||||
{
|
||||
ScrArea *area = CTX_wm_area(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
bool has_select = false;
|
||||
zero_v2(r_center);
|
||||
|
||||
if (area->spacetype == SPACE_IMAGE) {
|
||||
SpaceImage *sima = area->spacedata.first;
|
||||
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||
ED_uvedit_center_from_pivot_ex(sima, scene, view_layer, r_center, sima->around, &has_select);
|
||||
ED_uvedit_center_from_pivot_ex(sima, scene, view_layer, r_pivot, sima->around, &has_select);
|
||||
}
|
||||
else if (area->spacetype == SPACE_SEQ) {
|
||||
SpaceSeq *sseq = area->spacedata.first;
|
||||
const int pivot_point = scene->toolsettings->sequencer_tool_settings->pivot_point;
|
||||
ListBase *seqbase = SEQ_active_seqbase_get(SEQ_editing_get(scene));
|
||||
SeqCollection *strips = SEQ_query_rendered_strips(seqbase, scene->r.cfra, 0);
|
||||
SEQ_filter_selected_strips(strips);
|
||||
has_select = SEQ_collection_len(strips) != 0;
|
||||
|
||||
if (pivot_point == V3D_AROUND_CURSOR) {
|
||||
SEQ_image_preview_unit_to_px(scene, sseq->cursor, r_center);
|
||||
}
|
||||
else if (has_select) {
|
||||
Sequence *seq;
|
||||
SEQ_ITERATOR_FOREACH (seq, strips) {
|
||||
float origin[2];
|
||||
SEQ_image_transform_origin_offset_pixelspace_get(scene, seq, origin);
|
||||
add_v2_v2(r_center, origin);
|
||||
}
|
||||
mul_v2_fl(r_center, 1.0f / SEQ_collection_len(strips));
|
||||
}
|
||||
SEQ_image_preview_unit_to_px(scene, sseq->cursor, r_pivot);
|
||||
|
||||
SEQ_collection_free(strips);
|
||||
ListBase *seqbase = SEQ_active_seqbase_get(SEQ_editing_get(scene));
|
||||
SeqCollection *strips = SEQ_query_rendered_strips(seqbase, scene->r.cfra, 0);
|
||||
SEQ_filter_selected_strips(strips);
|
||||
has_select = SEQ_collection_len(strips) != 0;
|
||||
SEQ_collection_free(strips);
|
||||
}
|
||||
else {
|
||||
has_select = seq_get_strip_pivot_median(scene, r_pivot);
|
||||
}
|
||||
}
|
||||
else {
|
||||
BLI_assert_msg(0, "Unhandled space type!");
|
||||
}
|
||||
return has_select;
|
||||
}
|
||||
@@ -409,7 +436,7 @@ static int gizmo2d_modal(bContext *C,
|
||||
ARegion *region = CTX_wm_region(C);
|
||||
float origin[3];
|
||||
|
||||
gizmo2d_calc_center(C, origin);
|
||||
gizmo2d_calc_transform_pivot(C, origin);
|
||||
gizmo2d_origin_to_region(region, origin);
|
||||
WM_gizmo_set_matrix_location(widget, origin);
|
||||
|
||||
@@ -541,7 +568,7 @@ static void gizmo2d_xform_refresh(const bContext *C, wmGizmoGroup *gzgroup)
|
||||
GizmoGroup2D *ggd = gzgroup->customdata;
|
||||
bool has_select;
|
||||
if (ggd->no_cage) {
|
||||
has_select = gizmo2d_calc_center(C, ggd->origin);
|
||||
has_select = gizmo2d_calc_transform_pivot(C, ggd->origin);
|
||||
}
|
||||
else {
|
||||
has_select = gizmo2d_calc_bounds(C, ggd->origin, ggd->min, ggd->max);
|
||||
@@ -597,7 +624,8 @@ static void gizmo2d_xform_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup)
|
||||
ScrArea *area = CTX_wm_area(C);
|
||||
|
||||
if (area->spacetype == SPACE_SEQ) {
|
||||
gizmo2d_calc_center(C, origin);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
seq_get_strip_pivot_median(scene, origin);
|
||||
|
||||
float matrix_rotate[4][4];
|
||||
unit_m4(matrix_rotate);
|
||||
@@ -660,7 +688,8 @@ static void gizmo2d_xform_invoke_prepare(const bContext *C,
|
||||
|
||||
if (ggd->rotation != 0.0f && area->spacetype == SPACE_SEQ) {
|
||||
float origin[3];
|
||||
gizmo2d_calc_center(C, origin);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
seq_get_strip_pivot_median(scene, origin);
|
||||
/* We need to rotate the cardinal points so they align with the rotated bounding box. */
|
||||
|
||||
rotate_around_center_v2(n, origin, ggd->rotation);
|
||||
@@ -781,7 +810,7 @@ static void gizmo2d_resize_refresh(const bContext *C, wmGizmoGroup *gzgroup)
|
||||
{
|
||||
GizmoGroup_Resize2D *ggd = gzgroup->customdata;
|
||||
float origin[3];
|
||||
const bool has_select = gizmo2d_calc_center(C, origin);
|
||||
const bool has_select = gizmo2d_calc_transform_pivot(C, origin);
|
||||
|
||||
if (has_select == false) {
|
||||
for (int i = 0; i < ARRAY_SIZE(ggd->gizmo_xy); i++) {
|
||||
@@ -941,7 +970,7 @@ static void gizmo2d_rotate_refresh(const bContext *C, wmGizmoGroup *gzgroup)
|
||||
{
|
||||
GizmoGroup_Rotate2D *ggd = gzgroup->customdata;
|
||||
float origin[3];
|
||||
const bool has_select = gizmo2d_calc_center(C, origin);
|
||||
const bool has_select = gizmo2d_calc_transform_pivot(C, origin);
|
||||
|
||||
if (has_select == false) {
|
||||
ggd->gizmo->flag |= WM_GIZMO_HIDDEN;
|
||||
|
@@ -232,7 +232,7 @@ PointerRNA *gpencil_modifier_panel_get_property_pointers(Panel *panel, PointerRN
|
||||
UI_block_lock_clear(block);
|
||||
UI_block_lock_set(block, ID_IS_LINKED((Object *)ptr->owner_id), ERROR_LIBDATA_MESSAGE);
|
||||
|
||||
uiLayoutSetContextPointer(panel->layout, "modifier", ptr);
|
||||
UI_panel_context_pointer_set(panel, "modifier", ptr);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
@@ -312,7 +312,7 @@ static void gpencil_modifier_panel_header(const bContext *UNUSED(C), Panel *pane
|
||||
PointerRNA *ptr = UI_panel_custom_data_get(panel);
|
||||
GpencilModifierData *md = (GpencilModifierData *)ptr->data;
|
||||
|
||||
uiLayoutSetContextPointer(panel->layout, "modifier", ptr);
|
||||
UI_panel_context_pointer_set(panel, "modifier", ptr);
|
||||
|
||||
const GpencilModifierTypeInfo *mti = BKE_gpencil_modifier_get_info(md->type);
|
||||
bool narrow_panel = (panel->sizex < UI_UNIT_X * 9 && panel->sizex != 0);
|
||||
|
@@ -313,8 +313,6 @@ static void panel_draw(const bContext *C, Panel *panel)
|
||||
UI_TEMPLATE_LIST_FLAG_NONE);
|
||||
|
||||
uiLayout *col = uiLayoutColumn(row, false);
|
||||
uiLayoutSetContextPointer(col, "modifier", ptr);
|
||||
|
||||
uiLayout *sub = uiLayoutColumn(col, true);
|
||||
uiItemO(sub, "", ICON_ADD, "GPENCIL_OT_segment_add");
|
||||
uiItemO(sub, "", ICON_REMOVE, "GPENCIL_OT_segment_remove");
|
||||
|
@@ -83,6 +83,7 @@ set(SRC
|
||||
intern/gpu_select_sample_query.cc
|
||||
intern/gpu_shader.cc
|
||||
intern/gpu_shader_builtin.c
|
||||
intern/gpu_shader_dependency.cc
|
||||
intern/gpu_shader_interface.cc
|
||||
intern/gpu_shader_log.cc
|
||||
intern/gpu_state.cc
|
||||
@@ -197,186 +198,254 @@ if(NOT WITH_SYSTEM_GLEW)
|
||||
)
|
||||
endif()
|
||||
|
||||
data_to_c_simple(shaders/gpu_shader_depth_only_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_uniform_color_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_checker_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_diag_stripes_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_simple_lighting_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_flat_color_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_flat_color_alpha_test_0_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_flat_id_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_area_borders_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_area_borders_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_widget_base_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_widget_base_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_widget_shadow_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_widget_shadow_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_nodelink_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_nodelink_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_flat_color_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_line_dashed_uniform_color_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_line_dashed_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_smooth_color_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_smooth_color_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_image_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_image_rect_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_image_multi_rect_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_image_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_image_desaturate_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_image_overlays_merge_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_image_overlays_stereo_merge_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_image_modulate_alpha_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_image_shuffle_color_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_image_color_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_image_varying_color_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_3D_image_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_3D_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_3D_normal_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_3D_flat_color_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_3D_line_dashed_uniform_color_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_3D_polyline_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_3D_polyline_geom.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_3D_polyline_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_3D_smooth_color_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_3D_smooth_color_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_3D_passthrough_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_3D_clipped_uniform_color_vert.glsl SRC)
|
||||
set(GLSL_SRC
|
||||
shaders/gpu_shader_depth_only_frag.glsl
|
||||
shaders/gpu_shader_uniform_color_frag.glsl
|
||||
shaders/gpu_shader_checker_frag.glsl
|
||||
shaders/gpu_shader_diag_stripes_frag.glsl
|
||||
shaders/gpu_shader_simple_lighting_frag.glsl
|
||||
shaders/gpu_shader_flat_color_frag.glsl
|
||||
shaders/gpu_shader_flat_color_alpha_test_0_frag.glsl
|
||||
shaders/gpu_shader_flat_id_frag.glsl
|
||||
shaders/gpu_shader_2D_vert.glsl
|
||||
shaders/gpu_shader_2D_area_borders_vert.glsl
|
||||
shaders/gpu_shader_2D_area_borders_frag.glsl
|
||||
shaders/gpu_shader_2D_widget_base_vert.glsl
|
||||
shaders/gpu_shader_2D_widget_base_frag.glsl
|
||||
shaders/gpu_shader_2D_widget_shadow_vert.glsl
|
||||
shaders/gpu_shader_2D_widget_shadow_frag.glsl
|
||||
shaders/gpu_shader_2D_nodelink_frag.glsl
|
||||
shaders/gpu_shader_2D_nodelink_vert.glsl
|
||||
shaders/gpu_shader_2D_flat_color_vert.glsl
|
||||
shaders/gpu_shader_2D_line_dashed_uniform_color_vert.glsl
|
||||
shaders/gpu_shader_2D_line_dashed_frag.glsl
|
||||
shaders/gpu_shader_2D_smooth_color_vert.glsl
|
||||
shaders/gpu_shader_2D_smooth_color_frag.glsl
|
||||
shaders/gpu_shader_2D_image_vert.glsl
|
||||
shaders/gpu_shader_2D_image_rect_vert.glsl
|
||||
shaders/gpu_shader_2D_image_multi_rect_vert.glsl
|
||||
shaders/gpu_shader_image_frag.glsl
|
||||
shaders/gpu_shader_image_desaturate_frag.glsl
|
||||
shaders/gpu_shader_image_overlays_merge_frag.glsl
|
||||
shaders/gpu_shader_image_overlays_stereo_merge_frag.glsl
|
||||
shaders/gpu_shader_image_modulate_alpha_frag.glsl
|
||||
shaders/gpu_shader_image_shuffle_color_frag.glsl
|
||||
shaders/gpu_shader_image_color_frag.glsl
|
||||
shaders/gpu_shader_image_varying_color_frag.glsl
|
||||
shaders/gpu_shader_3D_image_vert.glsl
|
||||
shaders/gpu_shader_3D_vert.glsl
|
||||
shaders/gpu_shader_3D_normal_vert.glsl
|
||||
shaders/gpu_shader_3D_flat_color_vert.glsl
|
||||
shaders/gpu_shader_3D_line_dashed_uniform_color_vert.glsl
|
||||
shaders/gpu_shader_3D_polyline_frag.glsl
|
||||
shaders/gpu_shader_3D_polyline_geom.glsl
|
||||
shaders/gpu_shader_3D_polyline_vert.glsl
|
||||
shaders/gpu_shader_3D_smooth_color_vert.glsl
|
||||
shaders/gpu_shader_3D_smooth_color_frag.glsl
|
||||
shaders/gpu_shader_3D_passthrough_vert.glsl
|
||||
shaders/gpu_shader_3D_clipped_uniform_color_vert.glsl
|
||||
|
||||
data_to_c_simple(shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl SRC)
|
||||
shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl
|
||||
|
||||
data_to_c_simple(shaders/gpu_shader_point_uniform_color_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_point_uniform_color_aa_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_point_uniform_color_outline_aa_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_point_varying_color_outline_aa_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_point_varying_color_varying_outline_aa_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_point_varying_color_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_3D_point_fixed_size_varying_color_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_3D_point_varying_size_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_3D_point_varying_size_varying_color_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_3D_point_uniform_size_aa_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_3D_point_uniform_size_outline_aa_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_point_varying_size_varying_color_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_point_uniform_size_aa_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_point_uniform_size_outline_aa_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_point_uniform_size_varying_color_outline_aa_vert.glsl SRC)
|
||||
shaders/gpu_shader_point_uniform_color_frag.glsl
|
||||
shaders/gpu_shader_point_uniform_color_aa_frag.glsl
|
||||
shaders/gpu_shader_point_uniform_color_outline_aa_frag.glsl
|
||||
shaders/gpu_shader_point_varying_color_outline_aa_frag.glsl
|
||||
shaders/gpu_shader_point_varying_color_varying_outline_aa_frag.glsl
|
||||
shaders/gpu_shader_point_varying_color_frag.glsl
|
||||
shaders/gpu_shader_3D_point_fixed_size_varying_color_vert.glsl
|
||||
shaders/gpu_shader_3D_point_varying_size_vert.glsl
|
||||
shaders/gpu_shader_3D_point_varying_size_varying_color_vert.glsl
|
||||
shaders/gpu_shader_3D_point_uniform_size_aa_vert.glsl
|
||||
shaders/gpu_shader_3D_point_uniform_size_outline_aa_vert.glsl
|
||||
shaders/gpu_shader_2D_point_varying_size_varying_color_vert.glsl
|
||||
shaders/gpu_shader_2D_point_uniform_size_aa_vert.glsl
|
||||
shaders/gpu_shader_2D_point_uniform_size_outline_aa_vert.glsl
|
||||
shaders/gpu_shader_2D_point_uniform_size_varying_color_outline_aa_vert.glsl
|
||||
|
||||
data_to_c_simple(shaders/gpu_shader_2D_edituvs_points_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_edituvs_facedots_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_edituvs_edges_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_edituvs_edges_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_edituvs_faces_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_2D_edituvs_stretch_vert.glsl SRC)
|
||||
shaders/gpu_shader_2D_edituvs_points_vert.glsl
|
||||
shaders/gpu_shader_2D_edituvs_facedots_vert.glsl
|
||||
shaders/gpu_shader_2D_edituvs_edges_vert.glsl
|
||||
shaders/gpu_shader_2D_edituvs_edges_frag.glsl
|
||||
shaders/gpu_shader_2D_edituvs_faces_vert.glsl
|
||||
shaders/gpu_shader_2D_edituvs_stretch_vert.glsl
|
||||
|
||||
data_to_c_simple(shaders/gpu_shader_text_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_text_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_keyframe_shape_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_keyframe_shape_frag.glsl SRC)
|
||||
shaders/gpu_shader_text_vert.glsl
|
||||
shaders/gpu_shader_text_frag.glsl
|
||||
shaders/gpu_shader_keyframe_shape_vert.glsl
|
||||
shaders/gpu_shader_keyframe_shape_frag.glsl
|
||||
|
||||
data_to_c_simple(shaders/gpu_shader_codegen_lib.glsl SRC)
|
||||
shaders/gpu_shader_codegen_lib.glsl
|
||||
|
||||
data_to_c_simple(shaders/gpu_shader_geometry.glsl SRC)
|
||||
shaders/gpu_shader_geometry.glsl
|
||||
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_add_shader.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_ambient_occlusion.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_anisotropic.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_attribute.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_background.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_bevel.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_wavelength.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_blackbody.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_bright_contrast.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_bump.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_camera.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_clamp.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_color_ramp.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_color_util.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_combine_hsv.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_combine_rgb.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_combine_xyz.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_diffuse.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_displacement.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_eevee_specular.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_emission.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_float_curve.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_fractal_noise.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_fresnel.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_gamma.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_geometry.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_glass.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_glossy.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_hair_info.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_hash.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_holdout.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_hue_sat_val.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_invert.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_layer_weight.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_light_falloff.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_light_path.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_mapping.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_map_range.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_math.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_math_util.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_mix_rgb.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_mix_shader.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_noise.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_normal.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_normal_map.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_object_info.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_output_aov.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_output_material.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_output_world.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_particle_info.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_principled.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_refraction.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_rgb_curves.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_rgb_to_bw.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_separate_hsv.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_separate_rgb.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_separate_xyz.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_set.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_shader_to_rgba.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_squeeze.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_subsurface_scattering.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_tangent.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_tex_brick.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_tex_checker.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_tex_environment.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_tex_gradient.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_tex_image.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_tex_magic.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_tex_musgrave.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_tex_noise.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_tex_sky.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_texture_coordinates.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_tex_voronoi.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_tex_wave.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_tex_white_noise.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_toon.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_translucent.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_transparent.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_uv_map.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_vector_curves.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_vector_displacement.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_vector_math.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_vector_rotate.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_velvet.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_vertex_color.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_volume_absorption.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_volume_info.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_volume_principled.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_volume_scatter.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_wireframe.glsl SRC)
|
||||
data_to_c_simple(shaders/material/gpu_shader_material_world_normals.glsl SRC)
|
||||
shaders/material/gpu_shader_material_add_shader.glsl
|
||||
shaders/material/gpu_shader_material_ambient_occlusion.glsl
|
||||
shaders/material/gpu_shader_material_anisotropic.glsl
|
||||
shaders/material/gpu_shader_material_attribute.glsl
|
||||
shaders/material/gpu_shader_material_background.glsl
|
||||
shaders/material/gpu_shader_material_bevel.glsl
|
||||
shaders/material/gpu_shader_material_wavelength.glsl
|
||||
shaders/material/gpu_shader_material_blackbody.glsl
|
||||
shaders/material/gpu_shader_material_bright_contrast.glsl
|
||||
shaders/material/gpu_shader_material_bump.glsl
|
||||
shaders/material/gpu_shader_material_camera.glsl
|
||||
shaders/material/gpu_shader_material_clamp.glsl
|
||||
shaders/material/gpu_shader_material_color_ramp.glsl
|
||||
shaders/material/gpu_shader_material_color_util.glsl
|
||||
shaders/material/gpu_shader_material_combine_hsv.glsl
|
||||
shaders/material/gpu_shader_material_combine_rgb.glsl
|
||||
shaders/material/gpu_shader_material_combine_xyz.glsl
|
||||
shaders/material/gpu_shader_material_diffuse.glsl
|
||||
shaders/material/gpu_shader_material_displacement.glsl
|
||||
shaders/material/gpu_shader_material_eevee_specular.glsl
|
||||
shaders/material/gpu_shader_material_emission.glsl
|
||||
shaders/material/gpu_shader_material_float_curve.glsl
|
||||
shaders/material/gpu_shader_material_fractal_noise.glsl
|
||||
shaders/material/gpu_shader_material_fresnel.glsl
|
||||
shaders/material/gpu_shader_material_gamma.glsl
|
||||
shaders/material/gpu_shader_material_geometry.glsl
|
||||
shaders/material/gpu_shader_material_glass.glsl
|
||||
shaders/material/gpu_shader_material_glossy.glsl
|
||||
shaders/material/gpu_shader_material_hair_info.glsl
|
||||
shaders/material/gpu_shader_material_hash.glsl
|
||||
shaders/material/gpu_shader_material_holdout.glsl
|
||||
shaders/material/gpu_shader_material_hue_sat_val.glsl
|
||||
shaders/material/gpu_shader_material_invert.glsl
|
||||
shaders/material/gpu_shader_material_layer_weight.glsl
|
||||
shaders/material/gpu_shader_material_light_falloff.glsl
|
||||
shaders/material/gpu_shader_material_light_path.glsl
|
||||
shaders/material/gpu_shader_material_mapping.glsl
|
||||
shaders/material/gpu_shader_material_map_range.glsl
|
||||
shaders/material/gpu_shader_material_math.glsl
|
||||
shaders/material/gpu_shader_material_math_util.glsl
|
||||
shaders/material/gpu_shader_material_mix_rgb.glsl
|
||||
shaders/material/gpu_shader_material_mix_shader.glsl
|
||||
shaders/material/gpu_shader_material_noise.glsl
|
||||
shaders/material/gpu_shader_material_normal.glsl
|
||||
shaders/material/gpu_shader_material_normal_map.glsl
|
||||
shaders/material/gpu_shader_material_object_info.glsl
|
||||
shaders/material/gpu_shader_material_output_aov.glsl
|
||||
shaders/material/gpu_shader_material_output_material.glsl
|
||||
shaders/material/gpu_shader_material_output_world.glsl
|
||||
shaders/material/gpu_shader_material_particle_info.glsl
|
||||
shaders/material/gpu_shader_material_principled.glsl
|
||||
shaders/material/gpu_shader_material_refraction.glsl
|
||||
shaders/material/gpu_shader_material_rgb_curves.glsl
|
||||
shaders/material/gpu_shader_material_rgb_to_bw.glsl
|
||||
shaders/material/gpu_shader_material_separate_hsv.glsl
|
||||
shaders/material/gpu_shader_material_separate_rgb.glsl
|
||||
shaders/material/gpu_shader_material_separate_xyz.glsl
|
||||
shaders/material/gpu_shader_material_set.glsl
|
||||
shaders/material/gpu_shader_material_shader_to_rgba.glsl
|
||||
shaders/material/gpu_shader_material_squeeze.glsl
|
||||
shaders/material/gpu_shader_material_subsurface_scattering.glsl
|
||||
shaders/material/gpu_shader_material_tangent.glsl
|
||||
shaders/material/gpu_shader_material_tex_brick.glsl
|
||||
shaders/material/gpu_shader_material_tex_checker.glsl
|
||||
shaders/material/gpu_shader_material_tex_environment.glsl
|
||||
shaders/material/gpu_shader_material_tex_gradient.glsl
|
||||
shaders/material/gpu_shader_material_tex_image.glsl
|
||||
shaders/material/gpu_shader_material_tex_magic.glsl
|
||||
shaders/material/gpu_shader_material_tex_musgrave.glsl
|
||||
shaders/material/gpu_shader_material_tex_noise.glsl
|
||||
shaders/material/gpu_shader_material_tex_sky.glsl
|
||||
shaders/material/gpu_shader_material_texture_coordinates.glsl
|
||||
shaders/material/gpu_shader_material_tex_voronoi.glsl
|
||||
shaders/material/gpu_shader_material_tex_wave.glsl
|
||||
shaders/material/gpu_shader_material_tex_white_noise.glsl
|
||||
shaders/material/gpu_shader_material_toon.glsl
|
||||
shaders/material/gpu_shader_material_translucent.glsl
|
||||
shaders/material/gpu_shader_material_transparent.glsl
|
||||
shaders/material/gpu_shader_material_uv_map.glsl
|
||||
shaders/material/gpu_shader_material_vector_curves.glsl
|
||||
shaders/material/gpu_shader_material_vector_displacement.glsl
|
||||
shaders/material/gpu_shader_material_vector_math.glsl
|
||||
shaders/material/gpu_shader_material_vector_rotate.glsl
|
||||
shaders/material/gpu_shader_material_velvet.glsl
|
||||
shaders/material/gpu_shader_material_vertex_color.glsl
|
||||
shaders/material/gpu_shader_material_volume_absorption.glsl
|
||||
shaders/material/gpu_shader_material_volume_info.glsl
|
||||
shaders/material/gpu_shader_material_volume_principled.glsl
|
||||
shaders/material/gpu_shader_material_volume_scatter.glsl
|
||||
shaders/material/gpu_shader_material_wireframe.glsl
|
||||
shaders/material/gpu_shader_material_world_normals.glsl
|
||||
|
||||
data_to_c_simple(shaders/gpu_shader_gpencil_stroke_vert.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_gpencil_stroke_frag.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_gpencil_stroke_geom.glsl SRC)
|
||||
shaders/gpu_shader_gpencil_stroke_vert.glsl
|
||||
shaders/gpu_shader_gpencil_stroke_frag.glsl
|
||||
shaders/gpu_shader_gpencil_stroke_geom.glsl
|
||||
|
||||
data_to_c_simple(shaders/gpu_shader_cfg_world_clip_lib.glsl SRC)
|
||||
data_to_c_simple(shaders/gpu_shader_colorspace_lib.glsl SRC)
|
||||
shaders/gpu_shader_cfg_world_clip_lib.glsl
|
||||
shaders/gpu_shader_colorspace_lib.glsl
|
||||
|
||||
data_to_c_simple(shaders/gpu_shader_common_obinfos_lib.glsl SRC)
|
||||
shaders/gpu_shader_common_obinfos_lib.glsl
|
||||
)
|
||||
|
||||
set(GLSL_C)
|
||||
foreach(GLSL_FILE ${GLSL_SRC})
|
||||
data_to_c_simple(${GLSL_FILE} GLSL_C)
|
||||
endforeach()
|
||||
|
||||
blender_add_lib(bf_gpu_shaders "${GLSL_C}" "" "" "")
|
||||
|
||||
list(APPEND LIB
|
||||
bf_gpu_shaders
|
||||
)
|
||||
|
||||
set(GLSL_SOURCE_CONTENT "")
|
||||
foreach(GLSL_FILE ${GLSL_SRC})
|
||||
get_filename_component(GLSL_FILE_NAME ${GLSL_FILE} NAME)
|
||||
string(REPLACE "." "_" GLSL_FILE_NAME_UNDERSCORES ${GLSL_FILE_NAME})
|
||||
string(APPEND GLSL_SOURCE_CONTENT "SHADER_SOURCE\(datatoc_${GLSL_FILE_NAME_UNDERSCORES}, \"${GLSL_FILE_NAME}\"\)\n")
|
||||
endforeach()
|
||||
|
||||
set(glsl_source_list_file "${CMAKE_CURRENT_BINARY_DIR}/glsl_gpu_source_list.h")
|
||||
file(GENERATE OUTPUT ${glsl_source_list_file} CONTENT "${GLSL_SOURCE_CONTENT}")
|
||||
list(APPEND SRC ${glsl_source_list_file})
|
||||
list(APPEND INC ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
set(SHADER_DESCRIPTORS
|
||||
../draw/engines/workbench/shaders/workbench_effect_cavity.desc.h
|
||||
../draw/engines/workbench/shaders/workbench_prepass.desc.h
|
||||
../draw/intern/shaders/draw_fullscreen.desc.h
|
||||
../draw/intern/shaders/draw_view.desc.h
|
||||
../draw/intern/shaders/draw_object_infos.desc.h
|
||||
shaders/gpu_shader_3D_flat_color.desc.h
|
||||
shaders/gpu_clip_planes.desc.h
|
||||
)
|
||||
|
||||
set(SHADER_DESCRIPTORS_CONTENT "")
|
||||
foreach(DESCRIPTOR_FILE ${SHADER_DESCRIPTORS})
|
||||
string(APPEND SHADER_DESCRIPTORS_CONTENT "#include \"${DESCRIPTOR_FILE}\"\n")
|
||||
endforeach()
|
||||
|
||||
set(shader_descriptor_list_file "${CMAKE_CURRENT_BINARY_DIR}/gpu_shader_descriptor_list.h")
|
||||
file(GENERATE OUTPUT ${shader_descriptor_list_file} CONTENT "${SHADER_DESCRIPTORS_CONTENT}")
|
||||
|
||||
add_executable(shader_builder
|
||||
intern/gpu_shader_builder.c
|
||||
intern/gpu_shader_dependency.cc
|
||||
${shader_descriptor_list_file}
|
||||
)
|
||||
target_link_libraries(shader_builder PRIVATE
|
||||
bf_intern_guardedalloc
|
||||
bf_blenlib
|
||||
bf_gpu_shaders
|
||||
bf_draw_shaders
|
||||
${PLATFORM_LINKLIBS})
|
||||
target_include_directories(shader_builder PRIVATE ${INC} ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
set(BAKED_DESCRIPTORS_FILE ${CMAKE_CURRENT_BINARY_DIR}/shader_descriptors_baked.c)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT
|
||||
${BAKED_DESCRIPTORS_FILE}
|
||||
COMMAND
|
||||
"$<TARGET_FILE:shader_builder>" ${BAKED_DESCRIPTORS_FILE}
|
||||
DEPENDS shader_builder
|
||||
)
|
||||
|
||||
list(APPEND SRC ${BAKED_DESCRIPTORS_FILE})
|
||||
|
||||
|
||||
if(WITH_MOD_FLUID)
|
||||
@@ -390,6 +459,10 @@ if(WITH_IMAGE_DDS)
|
||||
endif()
|
||||
|
||||
blender_add_lib(bf_gpu "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
|
||||
target_link_libraries(bf_gpu PUBLIC
|
||||
bf_draw_shaders
|
||||
bf_gpu_shaders
|
||||
)
|
||||
|
||||
if(CXX_WARN_NO_SUGGEST_OVERRIDE)
|
||||
target_compile_options(bf_gpu PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Wsuggest-override>)
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#include "intern/gpu_codegen.h"
|
||||
#include "intern/gpu_material_library.h"
|
||||
#include "intern/gpu_private.h"
|
||||
#include "intern/gpu_shader_dependency_private.h"
|
||||
|
||||
/**
|
||||
* although the order of initialization and shutdown should not matter
|
||||
@@ -49,6 +50,8 @@ void GPU_init(void)
|
||||
|
||||
initialized = true;
|
||||
|
||||
gpu_shader_dependency_init();
|
||||
|
||||
gpu_codegen_init();
|
||||
gpu_material_library_init();
|
||||
|
||||
@@ -70,6 +73,8 @@ void GPU_exit(void)
|
||||
gpu_material_library_exit();
|
||||
gpu_codegen_exit();
|
||||
|
||||
gpu_shader_dependency_exit();
|
||||
|
||||
initialized = false;
|
||||
}
|
||||
|
||||
|
541
source/blender/gpu/intern/gpu_shader_builder.c
Normal file
541
source/blender/gpu/intern/gpu_shader_builder.c
Normal file
@@ -0,0 +1,541 @@
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2021 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* \ingroup gpu
|
||||
*
|
||||
* Compile time automation of shader compilation and validation.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "gpu_shader_dependency_private.h"
|
||||
|
||||
#include "gpu_shader_descriptor.h"
|
||||
#undef GPU_STAGE_INTERFACE_CREATE
|
||||
#undef GPU_SHADER_DESCRIPTOR
|
||||
|
||||
static const GPUShaderDescriptor *find_descriptor_by_name(const GPUShaderDescriptor **descriptors,
|
||||
const char *name)
|
||||
{
|
||||
const GPUShaderDescriptor **result = descriptors;
|
||||
while (*result) {
|
||||
if (strcmp((*result)->name, name) == 0) {
|
||||
return *result;
|
||||
}
|
||||
result++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Return 0 on success. (Recursive). */
|
||||
static bool descriptor_flatten(const GPUShaderDescriptor **descriptors,
|
||||
const GPUShaderDescriptor *input,
|
||||
GPUShaderDescriptor *output)
|
||||
{
|
||||
int errors = 0;
|
||||
|
||||
if (output->name == NULL) {
|
||||
output->name = input->name;
|
||||
}
|
||||
|
||||
if (input->do_static_compilation) {
|
||||
/* If one descriptor is valid, final one is too. */
|
||||
output->do_static_compilation = true;
|
||||
}
|
||||
|
||||
if (input->vertex_source) {
|
||||
if (output->vertex_source) {
|
||||
printf("Error: %s.vertex_source cannot be overriden by %s.\n", output->name, input->name);
|
||||
}
|
||||
else {
|
||||
output->vertex_source = input->vertex_source;
|
||||
}
|
||||
}
|
||||
if (input->geometry_source) {
|
||||
if (output->geometry_source) {
|
||||
printf("Error: %s.geometry_source cannot be overriden by %s.\n", output->name, input->name);
|
||||
}
|
||||
else {
|
||||
output->geometry_source = input->geometry_source;
|
||||
}
|
||||
}
|
||||
if (input->fragment_source) {
|
||||
if (output->fragment_source) {
|
||||
printf("Error: %s.fragment_source cannot be overriden by %s.\n", output->name, input->name);
|
||||
}
|
||||
else {
|
||||
output->fragment_source = input->fragment_source;
|
||||
}
|
||||
}
|
||||
if (input->compute_source) {
|
||||
if (output->compute_source) {
|
||||
printf("Error: %s.compute_source cannot be overriden by %s.\n", output->name, input->name);
|
||||
}
|
||||
else {
|
||||
output->compute_source = input->compute_source;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(input->defines); i++) {
|
||||
if (input->defines[i]) {
|
||||
if (output->defines[i]) {
|
||||
printf("Error: %s.defines[%d] cannot be overriden by %s.\n", output->name, i, input->name);
|
||||
}
|
||||
else {
|
||||
output->defines[i] = input->defines[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(input->vertex_inputs); i++) {
|
||||
if (input->vertex_inputs[i].type == UNUSED) {
|
||||
continue;
|
||||
}
|
||||
else if (output->vertex_inputs[i].type != UNUSED) {
|
||||
printf("Error: vertex_inputs[%d] is already used by \"%s\".\n",
|
||||
i,
|
||||
output->vertex_inputs[i].name);
|
||||
errors++;
|
||||
}
|
||||
else {
|
||||
output->vertex_inputs[i] = input->vertex_inputs[i];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(input->fragment_outputs); i++) {
|
||||
if (input->fragment_outputs[i].type == UNUSED) {
|
||||
continue;
|
||||
}
|
||||
else if (output->fragment_outputs[i].type != UNUSED) {
|
||||
printf("Error: fragment_outputs[%d] is already used by \"%s\".\n",
|
||||
i,
|
||||
output->fragment_outputs[i].name);
|
||||
errors++;
|
||||
}
|
||||
else {
|
||||
output->fragment_outputs[i] = input->fragment_outputs[i];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(input->vertex_out_interfaces); i++) {
|
||||
if (input->vertex_out_interfaces[i].inouts_len == 0) {
|
||||
continue;
|
||||
}
|
||||
else if (output->vertex_out_interfaces[i].inouts_len != 0) {
|
||||
printf("Error: vertex_out_interfaces[%d] is already used by \"%s\".\n",
|
||||
i,
|
||||
output->vertex_out_interfaces[i].name);
|
||||
errors++;
|
||||
}
|
||||
else {
|
||||
output->vertex_out_interfaces[i] = input->vertex_out_interfaces[i];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(input->geometry_out_interfaces); i++) {
|
||||
if (input->geometry_out_interfaces[i].inouts_len == 0) {
|
||||
continue;
|
||||
}
|
||||
else if (output->geometry_out_interfaces[i].inouts_len != 0) {
|
||||
printf("Error: geometry_out_interfaces[%d] is already used by \"%s\".\n",
|
||||
i,
|
||||
output->geometry_out_interfaces[i].name);
|
||||
errors++;
|
||||
}
|
||||
else {
|
||||
output->geometry_out_interfaces[i] = input->geometry_out_interfaces[i];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(input->resources); i++) {
|
||||
for (int j = 0; j < ARRAY_SIZE(input->resources[i]); j++) {
|
||||
if (input->resources[i][j].bind_type == UNUSED) {
|
||||
continue;
|
||||
}
|
||||
else if (output->resources[i][j].bind_type != UNUSED) {
|
||||
printf("Error: resources[%d][%d] is already used by \"%s\".\n",
|
||||
i,
|
||||
j,
|
||||
output->resources[i][j].name);
|
||||
errors++;
|
||||
}
|
||||
else {
|
||||
output->resources[i][j] = input->resources[i][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(input->push_constants); i++) {
|
||||
if (input->push_constants[i].type == UNUSED) {
|
||||
continue;
|
||||
}
|
||||
else if (output->push_constants[i].type != UNUSED) {
|
||||
printf("Error: push_constants[%d] is already used by \"%s\".\n",
|
||||
i,
|
||||
output->push_constants[i].name);
|
||||
errors++;
|
||||
}
|
||||
else {
|
||||
output->push_constants[i] = input->push_constants[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (errors) {
|
||||
printf("Error: Cannot merge %s into %s.\n", input->name, output->name);
|
||||
return errors;
|
||||
}
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(input->additional_descriptors); i++) {
|
||||
if (input->additional_descriptors[i]) {
|
||||
const GPUShaderDescriptor *deps = find_descriptor_by_name(descriptors,
|
||||
input->additional_descriptors[i]);
|
||||
if (deps) {
|
||||
errors += descriptor_flatten(descriptors, deps, output);
|
||||
}
|
||||
else {
|
||||
printf("Error: %s : Could not find dependency %s.\n",
|
||||
input->name,
|
||||
input->additional_descriptors[i]);
|
||||
errors++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return errors;
|
||||
}
|
||||
|
||||
#define ENUM_TO_STR(_enum) [_enum] = #_enum
|
||||
|
||||
static const char *inout_type_to_str(eGPUInOutType type)
|
||||
{
|
||||
const char *strings[] = {
|
||||
ENUM_TO_STR(UNUSED), ENUM_TO_STR(BOOL), ENUM_TO_STR(FLOAT),
|
||||
ENUM_TO_STR(VEC2), ENUM_TO_STR(VEC3), ENUM_TO_STR(VEC4),
|
||||
ENUM_TO_STR(UINT), ENUM_TO_STR(UVEC2), ENUM_TO_STR(UVEC3),
|
||||
ENUM_TO_STR(UVEC4), ENUM_TO_STR(INT), ENUM_TO_STR(IVEC2),
|
||||
ENUM_TO_STR(IVEC3), ENUM_TO_STR(IVEC4), ENUM_TO_STR(FLOAT_1D),
|
||||
ENUM_TO_STR(FLOAT_1D_ARRAY), ENUM_TO_STR(FLOAT_2D), ENUM_TO_STR(FLOAT_2D_ARRAY),
|
||||
ENUM_TO_STR(FLOAT_3D), ENUM_TO_STR(INT_1D), ENUM_TO_STR(INT_1D_ARRAY),
|
||||
ENUM_TO_STR(INT_2D), ENUM_TO_STR(INT_2D_ARRAY), ENUM_TO_STR(INT_3D),
|
||||
ENUM_TO_STR(UINT_1D), ENUM_TO_STR(UINT_1D_ARRAY), ENUM_TO_STR(UINT_2D),
|
||||
ENUM_TO_STR(UINT_2D_ARRAY), ENUM_TO_STR(UINT_3D), ENUM_TO_STR(STRUCT),
|
||||
};
|
||||
return strings[type];
|
||||
}
|
||||
|
||||
#undef ENUM_TO_STR
|
||||
|
||||
/* Write newlines as separated lines. */
|
||||
static void write_str(FILE *fp,
|
||||
const char *indent,
|
||||
const char *iface_type,
|
||||
const GPUShaderDescriptor *desc,
|
||||
const char *const *src)
|
||||
{
|
||||
(void)desc;
|
||||
(void)iface_type;
|
||||
const char *str = *src;
|
||||
int n_char = strcspn(str, "\n");
|
||||
do {
|
||||
if (str != *src) {
|
||||
fprintf(fp, "\n%s", indent);
|
||||
}
|
||||
fprintf(fp, "\"%.*s\\n\"", n_char, str);
|
||||
str += n_char + 1;
|
||||
n_char = strcspn(str, "\n");
|
||||
} while (n_char > 1);
|
||||
}
|
||||
|
||||
static void write_inout(FILE *fp,
|
||||
const char *indent,
|
||||
const char *iface_type,
|
||||
const GPUShaderDescriptor *desc,
|
||||
const GPUInOut *inout)
|
||||
{
|
||||
(void)indent;
|
||||
(void)desc;
|
||||
(void)iface_type;
|
||||
fprintf(
|
||||
fp, "{%s, \"%s\", %u}", inout_type_to_str(inout->type), inout->name, (uint32_t)inout->qual);
|
||||
}
|
||||
|
||||
static void write_interface_declaration(FILE *fp,
|
||||
const char *indent,
|
||||
const char *iface_type,
|
||||
const GPUShaderDescriptor *desc,
|
||||
const GPUInterfaceBlockDescription *iface)
|
||||
{
|
||||
(void)indent;
|
||||
fprintf(fp, "GPUInOut %s_%s_%s[] = {\n", desc->name, iface_type, iface->name);
|
||||
for (int i = 0; i < iface->inouts_len; i++) {
|
||||
fprintf(fp, " ");
|
||||
write_inout(fp, indent, iface_type, desc, &iface->inouts[i]);
|
||||
fprintf(fp, ",\n");
|
||||
}
|
||||
fprintf(fp, "};\n");
|
||||
}
|
||||
|
||||
static void write_interface(FILE *fp,
|
||||
const char *indent,
|
||||
const char *iface_type,
|
||||
const GPUShaderDescriptor *desc,
|
||||
const GPUInterfaceBlockDescription *iface)
|
||||
{
|
||||
(void)indent;
|
||||
if (iface->inouts_len > 0) {
|
||||
fprintf(
|
||||
fp, "STAGE_INTERFACE(\"%s\", %s_%s_%s)", iface->name, desc->name, iface_type, iface->name);
|
||||
}
|
||||
else {
|
||||
fprintf(fp, "{NULL, 0, NULL}");
|
||||
}
|
||||
}
|
||||
|
||||
#define write_array(fp, desc, array, array_name, _used, write_function, iface_type, indent) \
|
||||
{ \
|
||||
int used_slots = 0; \
|
||||
for (int i = 0; i < ARRAY_SIZE(array); i++) { \
|
||||
used_slots += (array[i] _used != UNUSED); \
|
||||
} \
|
||||
if (used_slots) { \
|
||||
if (#array_name[0] != '\0') { \
|
||||
fprintf(fp, "%s " #array_name " = ", indent); \
|
||||
} \
|
||||
else { \
|
||||
fprintf(fp, "%s ", indent); \
|
||||
} \
|
||||
fprintf(fp, "{\n"); \
|
||||
for (int i = 0; i < ARRAY_SIZE(array); i++) { \
|
||||
if (array[i] _used != UNUSED) { \
|
||||
fprintf(fp, "%s [%d] = ", indent, i); \
|
||||
write_function(fp, indent, iface_type, desc, &array[i]); \
|
||||
fprintf(fp, ",\n"); \
|
||||
} \
|
||||
} \
|
||||
fprintf(fp, "%s },\n", indent); \
|
||||
} \
|
||||
}
|
||||
|
||||
static void write_resource_bind(FILE *fp,
|
||||
const char *indent,
|
||||
const char *iface_type,
|
||||
const GPUShaderDescriptor *desc,
|
||||
const GPUResourceBind *bind)
|
||||
{
|
||||
(void)indent;
|
||||
(void)desc;
|
||||
(void)iface_type;
|
||||
fprintf(fp,
|
||||
"{%u, %u, %u, %u, \"%s\", \"%s\"}",
|
||||
(uint32_t)bind->bind_type,
|
||||
(uint32_t)bind->type,
|
||||
(uint32_t)bind->qual,
|
||||
(uint32_t)bind->sampler,
|
||||
bind->type_name ? bind->type_name : "",
|
||||
bind->name);
|
||||
}
|
||||
|
||||
static void write_descriptor(FILE *fp, const GPUShaderDescriptor *desc)
|
||||
{
|
||||
fprintf(fp, "extern const GPUShaderDescriptor %s;\n", desc->name);
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(desc->vertex_out_interfaces); i++) {
|
||||
if (desc->vertex_out_interfaces[i].inouts_len != 0) {
|
||||
write_interface_declaration(fp, "", "vert", desc, &desc->vertex_out_interfaces[i]);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < ARRAY_SIZE(desc->geometry_out_interfaces); i++) {
|
||||
if (desc->geometry_out_interfaces[i].inouts_len != 0) {
|
||||
write_interface_declaration(fp, "", "geom", desc, &desc->geometry_out_interfaces[i]);
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(fp, "const GPUShaderDescriptor %s = {\n", desc->name);
|
||||
write_array(fp, desc, desc->vertex_inputs, .vertex_inputs, .type, write_inout, "", "");
|
||||
write_array(fp, desc, desc->fragment_outputs, .fragment_outputs, .type, write_inout, "", "");
|
||||
write_array(fp,
|
||||
desc,
|
||||
desc->vertex_out_interfaces,
|
||||
.vertex_out_interfaces,
|
||||
.inouts_len,
|
||||
write_interface,
|
||||
"vert",
|
||||
"");
|
||||
write_array(fp,
|
||||
desc,
|
||||
desc->geometry_out_interfaces,
|
||||
.geometry_out_interfaces,
|
||||
.inouts_len,
|
||||
write_interface,
|
||||
"frag",
|
||||
"");
|
||||
{
|
||||
int used_slots_1 = 0;
|
||||
for (int i = 0; i < ARRAY_SIZE(desc->resources); i++) {
|
||||
for (int j = 0; j < ARRAY_SIZE(desc->resources[i]); j++) {
|
||||
used_slots_1 += (desc->resources[i][j].bind_type != UNUSED);
|
||||
}
|
||||
}
|
||||
if (used_slots_1) {
|
||||
fprintf(fp, " .resources = {\n");
|
||||
write_array(fp,
|
||||
desc,
|
||||
desc->resources[0],
|
||||
[DESCRIPTOR_SET_0],
|
||||
.bind_type,
|
||||
write_resource_bind,
|
||||
"",
|
||||
" ");
|
||||
write_array(fp,
|
||||
desc,
|
||||
desc->resources[1],
|
||||
[DESCRIPTOR_SET_1],
|
||||
.bind_type,
|
||||
write_resource_bind,
|
||||
"",
|
||||
" ");
|
||||
fprintf(fp, " },\n");
|
||||
}
|
||||
}
|
||||
write_array(fp, desc, desc->push_constants, .push_constants, .type, write_inout, "", "");
|
||||
write_array(fp, desc, desc->defines, .defines, , write_str, "", "");
|
||||
|
||||
if (desc->vertex_source) {
|
||||
fprintf(fp, " .vertex_source = \"%s\",\n", desc->vertex_source);
|
||||
}
|
||||
if (desc->geometry_source) {
|
||||
fprintf(fp, " .geometry_source = \"%s\",\n", desc->geometry_source);
|
||||
}
|
||||
if (desc->fragment_source) {
|
||||
fprintf(fp, " .fragment_source = \"%s\",\n", desc->fragment_source);
|
||||
}
|
||||
if (desc->compute_source) {
|
||||
fprintf(fp, " .compute_source = \"%s\",\n", desc->compute_source);
|
||||
}
|
||||
|
||||
fprintf(fp, "};\n\n");
|
||||
}
|
||||
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
if (argc < 1) {
|
||||
printf("Usage: shader_builder <data_file_to>\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
size_t descriptors_len = 0;
|
||||
/* Count number of descriptors. Define interfaces. */
|
||||
#define GPU_STAGE_INTERFACE_CREATE(_interface) GPUInOut _interface[] =
|
||||
#define GPU_SHADER_DESCRIPTOR(_descriptor) \
|
||||
descriptors_len++; \
|
||||
(void)(GPUShaderDescriptor)
|
||||
#include "gpu_shader_descriptor_list.h"
|
||||
#undef GPU_STAGE_INTERFACE_CREATE
|
||||
#undef GPU_SHADER_DESCRIPTOR
|
||||
/* Discard interfaces then. */
|
||||
#define GPU_STAGE_INTERFACE_CREATE(_interface) (void)(GPUInOut[])
|
||||
|
||||
/* Null ended array. */
|
||||
GPUShaderDescriptor **descriptors = calloc(descriptors_len + 1, sizeof(void *));
|
||||
|
||||
size_t index = 0;
|
||||
/* Declare everything first to be able to avoid dependency for references. */
|
||||
#define GPU_SHADER_DESCRIPTOR(_descriptor) \
|
||||
GPUShaderDescriptor _descriptor; \
|
||||
descriptors[index++] = &_descriptor; \
|
||||
(void)(GPUShaderDescriptor)
|
||||
#include "gpu_shader_descriptor_list.h"
|
||||
#undef GPU_SHADER_DESCRIPTOR
|
||||
|
||||
/* Set values. */
|
||||
#define GPU_SHADER_DESCRIPTOR(_descriptor) _descriptor = (GPUShaderDescriptor)
|
||||
#include "gpu_shader_descriptor_list.h"
|
||||
#undef GPU_SHADER_DESCRIPTOR
|
||||
|
||||
/* Set name. */
|
||||
#define GPU_SHADER_DESCRIPTOR(_descriptor) \
|
||||
_descriptor.name = #_descriptor; \
|
||||
(void)(GPUShaderDescriptor)
|
||||
#include "gpu_shader_descriptor_list.h"
|
||||
#undef GPU_SHADER_DESCRIPTOR
|
||||
|
||||
FILE *fp = fopen(argv[1], "w");
|
||||
|
||||
fprintf(fp, "#include \"gpu_shader_descriptor.h\"\n");
|
||||
|
||||
#if 1 /* TEST */
|
||||
gpu_shader_dependency_init();
|
||||
#endif
|
||||
|
||||
int result = 0;
|
||||
for (size_t i = 0; i < descriptors_len; i++) {
|
||||
const GPUShaderDescriptor *descriptor = descriptors[i];
|
||||
|
||||
GPUShaderDescriptor flattened_descriptor = {0};
|
||||
|
||||
int errors = descriptor_flatten(descriptors, descriptor, &flattened_descriptor);
|
||||
if (errors != 0) {
|
||||
result = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
descriptor = &flattened_descriptor;
|
||||
|
||||
/* TODO(fclem): Validate push constant alignment & overlapping. */
|
||||
|
||||
if (descriptor->do_static_compilation) {
|
||||
#if 0 /* TODO */
|
||||
descriptor->vulkan_spirv = vk_shader_compile(descriptor);
|
||||
if (descriptor->vulkan_spirv == nullptr) {
|
||||
result = 1;
|
||||
}
|
||||
#endif
|
||||
#if 0 /* TODO */
|
||||
if (gl_shader_validate(descriptor) == false) {
|
||||
result = 1;
|
||||
}
|
||||
#endif
|
||||
#if 1 /* TEST */
|
||||
if (descriptor->vertex_source) {
|
||||
char *src = gpu_shader_dependency_get_resolved_source(descriptor->vertex_source);
|
||||
|
||||
FILE *test_fp = fopen(descriptor->vertex_source, "w");
|
||||
fprintf(test_fp, "%s", src);
|
||||
fclose(test_fp);
|
||||
|
||||
free(src);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
write_descriptor(fp, descriptor);
|
||||
}
|
||||
|
||||
#if 1 /* TEST */
|
||||
gpu_shader_dependency_exit();
|
||||
#endif
|
||||
|
||||
fclose(fp);
|
||||
|
||||
free(descriptors);
|
||||
|
||||
return result;
|
||||
}
|
138
source/blender/gpu/intern/gpu_shader_dependency.cc
Normal file
138
source/blender/gpu/intern/gpu_shader_dependency.cc
Normal file
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2021 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* \ingroup gpu
|
||||
*
|
||||
* Shader source dependency builder that make possible to support #include directive inside the
|
||||
* shader files.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "BLI_map.hh"
|
||||
#include "BLI_set.hh"
|
||||
#include "BLI_string_ref.hh"
|
||||
|
||||
#include "gpu_shader_dependency_private.h"
|
||||
|
||||
extern "C" {
|
||||
#define SHADER_SOURCE(datatoc, filename) extern char datatoc[];
|
||||
#include "glsl_draw_source_list.h"
|
||||
#include "glsl_gpu_source_list.h"
|
||||
#undef SHADER_SOURCE
|
||||
}
|
||||
|
||||
namespace blender::gpu {
|
||||
|
||||
using GPUSourceDictionnary = Map<StringRef, struct GPUSource *>;
|
||||
|
||||
struct GPUSource {
|
||||
StringRefNull filename;
|
||||
StringRefNull source;
|
||||
Set<GPUSource *> dependencies;
|
||||
bool dependencies_init = false;
|
||||
|
||||
GPUSource(const char *file, const char *datatoc) : filename(file), source(datatoc){};
|
||||
|
||||
void init_dependencies(const GPUSourceDictionnary &dict)
|
||||
{
|
||||
if (dependencies_init) {
|
||||
return;
|
||||
}
|
||||
dependencies_init = true;
|
||||
int64_t pos = 0;
|
||||
while (1) {
|
||||
pos = source.find("#pragma BLENDER_REQUIRE(", pos);
|
||||
if (pos == -1) {
|
||||
return;
|
||||
}
|
||||
int64_t start = source.find("(", pos) + 1;
|
||||
int64_t end = source.find(")", pos);
|
||||
if (end == -1) {
|
||||
/* TODO Use clog. */
|
||||
std::cout << "Error: " << filename << " : Malformed BLENDER_REQUIRE: Missing \")\"."
|
||||
<< std::endl;
|
||||
return;
|
||||
}
|
||||
StringRef dependency_name = source.substr(start, end - start);
|
||||
GPUSource *source = dict.lookup_default(dependency_name, nullptr);
|
||||
if (source == nullptr) {
|
||||
/* TODO Use clog. */
|
||||
std::cout << "Error: " << filename << " : Dependency not found \"" << dependency_name
|
||||
<< "\"." << std::endl;
|
||||
return;
|
||||
}
|
||||
/* Recursive. */
|
||||
source->init_dependencies(dict);
|
||||
|
||||
for (auto dep : source->dependencies) {
|
||||
dependencies.add(dep);
|
||||
}
|
||||
dependencies.add(source);
|
||||
pos++;
|
||||
};
|
||||
}
|
||||
|
||||
/* Returns the final string with all inlcudes done. */
|
||||
void build(std::string &str)
|
||||
{
|
||||
for (auto dep : dependencies) {
|
||||
str += dep->source;
|
||||
}
|
||||
str += source;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace blender::gpu
|
||||
|
||||
using namespace blender::gpu;
|
||||
|
||||
static GPUSourceDictionnary *g_sources = nullptr;
|
||||
|
||||
void gpu_shader_dependency_init()
|
||||
{
|
||||
g_sources = new GPUSourceDictionnary();
|
||||
|
||||
#define SHADER_SOURCE(datatoc, filename) \
|
||||
g_sources->add_new(filename, new GPUSource(filename, datatoc));
|
||||
#include "glsl_draw_source_list.h"
|
||||
#include "glsl_source_list.h"
|
||||
#undef SHADER_SOURCE
|
||||
|
||||
for (auto value : g_sources->values()) {
|
||||
value->init_dependencies(*g_sources);
|
||||
}
|
||||
}
|
||||
|
||||
void gpu_shader_dependency_exit()
|
||||
{
|
||||
for (auto value : g_sources->values()) {
|
||||
delete value;
|
||||
}
|
||||
delete g_sources;
|
||||
}
|
||||
|
||||
char *gpu_shader_dependency_get_resolved_source(const char *shader_source_name)
|
||||
{
|
||||
GPUSource *source = g_sources->lookup(shader_source_name);
|
||||
std::string str;
|
||||
source->build(str);
|
||||
return strdup(str.c_str());
|
||||
}
|
40
source/blender/gpu/intern/gpu_shader_dependency_private.h
Normal file
40
source/blender/gpu/intern/gpu_shader_dependency_private.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2021 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* \ingroup gpu
|
||||
*
|
||||
* Shader source dependency builder that make possible to support #include directive inside the
|
||||
* shader files.
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void gpu_shader_dependency_init(void);
|
||||
|
||||
void gpu_shader_dependency_exit(void);
|
||||
|
||||
/* User must free the resulting string using MEM_freeN. */
|
||||
char *gpu_shader_dependency_get_resolved_source(const char *shader_source_name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
243
source/blender/gpu/intern/gpu_shader_descriptor.h
Normal file
243
source/blender/gpu/intern/gpu_shader_descriptor.h
Normal file
@@ -0,0 +1,243 @@
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2021 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* \ingroup gpu
|
||||
*
|
||||
* Descriptior type used to define shader structure, resources and interfaces.
|
||||
*
|
||||
* Some rule of thumb:
|
||||
* - Do not include anything else than this file in each descriptor file.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
/* For helping intellisense. */
|
||||
#ifndef GPU_SHADER_DESCRIPTOR
|
||||
# define GPU_STAGE_INTERFACE_CREATE(_interface) GPUInOut _interface[] =
|
||||
# define GPU_SHADER_DESCRIPTOR(_descriptor) GPUShaderDescriptor _descriptor =
|
||||
#endif
|
||||
|
||||
#ifndef ARRAY_SIZE
|
||||
# define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(*(arr)))
|
||||
#endif
|
||||
|
||||
#define UNUSED 0
|
||||
|
||||
typedef enum eGPUInOutType {
|
||||
/* UNUSED = 0 */
|
||||
FLOAT = 1,
|
||||
VEC2,
|
||||
VEC3,
|
||||
VEC4,
|
||||
UINT,
|
||||
UVEC2,
|
||||
UVEC3,
|
||||
UVEC4,
|
||||
INT,
|
||||
IVEC2,
|
||||
IVEC3,
|
||||
IVEC4,
|
||||
BOOL,
|
||||
/* Samplers & images. */
|
||||
FLOAT_BUFFER,
|
||||
FLOAT_1D,
|
||||
FLOAT_1D_ARRAY,
|
||||
FLOAT_2D,
|
||||
FLOAT_2D_ARRAY,
|
||||
FLOAT_3D,
|
||||
INT_BUFFER,
|
||||
INT_1D,
|
||||
INT_1D_ARRAY,
|
||||
INT_2D,
|
||||
INT_2D_ARRAY,
|
||||
INT_3D,
|
||||
UINT_BUFFER,
|
||||
UINT_1D,
|
||||
UINT_1D_ARRAY,
|
||||
UINT_2D,
|
||||
UINT_2D_ARRAY,
|
||||
UINT_3D,
|
||||
/* Custom structure. */
|
||||
STRUCT,
|
||||
} eGPUInOutType;
|
||||
|
||||
typedef enum eGPUInOutQualifier {
|
||||
/* Storage qualifiers. */
|
||||
RESTRICT = (1 << 0),
|
||||
READ_ONLY = (1 << 1),
|
||||
WRITE_ONLY = (1 << 2),
|
||||
/* Interp qualifiers. */
|
||||
SMOOTH = (1 << 3),
|
||||
FLAT = (2 << 3),
|
||||
NO_PERSPECTIVE = (3 << 3),
|
||||
/* Dual Source Blending Index. */
|
||||
OUTPUT_INDEX_0 = (4 << 3),
|
||||
OUTPUT_INDEX_1 = (5 << 3),
|
||||
} eGPUInOutQualifier;
|
||||
|
||||
typedef enum eGPUBindType {
|
||||
GPU_BIND_UNIFORM_BUFFER = 1,
|
||||
GPU_BIND_STORAGE_BUFFER,
|
||||
GPU_BIND_SAMPLER,
|
||||
GPU_BIND_IMAGE,
|
||||
} eGPUBindType;
|
||||
|
||||
/* Syntaxic suggar. */
|
||||
#define DESCRIPTOR_SET_0 0
|
||||
#define DESCRIPTOR_SET_1 1
|
||||
#define DESCRIPTOR_SET_2 2
|
||||
#define DESCRIPTOR_SET_3 3
|
||||
|
||||
typedef struct GPUInOut {
|
||||
eGPUInOutType type;
|
||||
const char *name;
|
||||
eGPUInOutQualifier qual;
|
||||
} GPUInOut;
|
||||
|
||||
#define VERTEX_INPUT(_type, _name) \
|
||||
{ \
|
||||
.type = _type, .name = _name \
|
||||
}
|
||||
|
||||
#define FRAGMENT_OUTPUT(_type, _name) \
|
||||
{ \
|
||||
.type = _type, .name = _name \
|
||||
}
|
||||
|
||||
#define FRAGMENT_OUTPUT_DUALBLEND(_type, _name, _index) \
|
||||
{ \
|
||||
.type = _type, .name = _name, .qual = _index \
|
||||
}
|
||||
|
||||
#define PUSH_CONSTANT(_type, _name) \
|
||||
{ \
|
||||
.type = _type, .name = _name \
|
||||
}
|
||||
|
||||
typedef enum eGPUSamplerState {
|
||||
GPU_SAMPLER_DEFAULT = 0,
|
||||
GPU_SAMPLER_FILTER = (1 << 0),
|
||||
GPU_SAMPLER_MIPMAP = (1 << 1),
|
||||
GPU_SAMPLER_REPEAT_S = (1 << 2),
|
||||
GPU_SAMPLER_REPEAT_T = (1 << 3),
|
||||
GPU_SAMPLER_REPEAT_R = (1 << 4),
|
||||
GPU_SAMPLER_CLAMP_BORDER = (1 << 5), /* Clamp to border color instead of border texel. */
|
||||
GPU_SAMPLER_COMPARE = (1 << 6),
|
||||
GPU_SAMPLER_ANISO = (1 << 7),
|
||||
GPU_SAMPLER_ICON = (1 << 8),
|
||||
|
||||
GPU_SAMPLER_REPEAT = (GPU_SAMPLER_REPEAT_S | GPU_SAMPLER_REPEAT_T | GPU_SAMPLER_REPEAT_R),
|
||||
} eGPUSamplerState;
|
||||
|
||||
typedef struct GPUResourceBind {
|
||||
eGPUBindType bind_type;
|
||||
eGPUInOutType type;
|
||||
eGPUInOutQualifier qual;
|
||||
eGPUSamplerState sampler;
|
||||
/* Defined type name. */
|
||||
const char *type_name;
|
||||
/* Name can contain array size (i.e: "colors[6]"). Note: supports unsized arrays for SSBO. */
|
||||
const char *name;
|
||||
} GPUResourceBind;
|
||||
|
||||
#define UNIFORM_BUFFER(_typename, _name) \
|
||||
{ \
|
||||
.bind_type = GPU_BIND_UNIFORM_BUFFER, .type_name = _typename, .name = _name, \
|
||||
}
|
||||
|
||||
#define STORAGE_BUFFER(_typename, _name, _qual) \
|
||||
{ \
|
||||
.bind_type = GPU_BIND_STORAGE_BUFFER, .type_name = _typename, .name = _name, .qual = _qual, \
|
||||
}
|
||||
|
||||
#define SAMPLER(_type, _name, _sampler) \
|
||||
{ \
|
||||
.bind_type = GPU_BIND_SAMPLER, .type = _type, .name = _name, .sampler = _sampler, \
|
||||
}
|
||||
|
||||
#define IMAGE(_type, _name, _qual) \
|
||||
{ \
|
||||
.bind_type = GPU_BIND_IMAGE, .type = _type, .name = _name, .qual = _qual, \
|
||||
}
|
||||
|
||||
typedef struct GPUInterfaceBlockDescription {
|
||||
/** Name of the instance of the block (used to access). Can be empty "". */
|
||||
const char *name;
|
||||
/** List of all members of the interface. */
|
||||
int inouts_len;
|
||||
GPUInOut *inouts;
|
||||
} GPUInterfaceBlockDescription;
|
||||
|
||||
#define STAGE_INTERFACE(_name, _inouts) \
|
||||
{ \
|
||||
.name = _name, .inouts_len = ARRAY_SIZE(_inouts), .inouts = _inouts \
|
||||
}
|
||||
|
||||
/* Vulkan garantee 4 distinct descriptior set. */
|
||||
#define GPU_MAX_DESCIPTOR_SET 2
|
||||
/* Should be tweaked to be as large as the maximum supported by the low end hardware we support. */
|
||||
#define GPU_MAX_RESOURCE_PER_DESCRIPTOR 8
|
||||
|
||||
/**
|
||||
* @brief Describe inputs & outputs, stage interfaces, resources and sources of a shader.
|
||||
* If all data is correctly provided, this is all that is needed to create and compile
|
||||
* a GPUShader.
|
||||
*
|
||||
* IMPORTANT: All strings are references only. Make sure all the strings used by a
|
||||
* GPUShaderDescriptor are not freed until it is consumed or deleted.
|
||||
*/
|
||||
typedef struct GPUShaderDescriptor {
|
||||
/** Shader name for debugging. */
|
||||
const char *name;
|
||||
/** True if the shader is static and can be precompiled at compile time. */
|
||||
bool do_static_compilation;
|
||||
|
||||
GPUInOut vertex_inputs[16];
|
||||
GPUInOut fragment_outputs[8];
|
||||
|
||||
GPUInterfaceBlockDescription vertex_out_interfaces[4];
|
||||
GPUInterfaceBlockDescription geometry_out_interfaces[4];
|
||||
|
||||
GPUResourceBind resources[GPU_MAX_DESCIPTOR_SET][GPU_MAX_RESOURCE_PER_DESCRIPTOR];
|
||||
|
||||
/**
|
||||
* Data managed by GPUShader. Can be set through uniform functions. Must be less than 128bytes.
|
||||
* One slot represents 4bytes. Each element needs to have enough empty space left after it.
|
||||
* example:
|
||||
* [0] = PUSH_CONSTANT(MAT4, "ModelMatrix"),
|
||||
* ---- 16 slots occupied by ModelMatrix ----
|
||||
* [16] = PUSH_CONSTANT(VEC4, "color"),
|
||||
* ---- 4 slots occupied by color ----
|
||||
* [20] = PUSH_CONSTANT(BOOL, "srgbToggle"),
|
||||
*/
|
||||
GPUInOut push_constants[32];
|
||||
|
||||
const char *vertex_source, *geometry_source, *fragment_source, *compute_source;
|
||||
|
||||
const char *defines[8];
|
||||
|
||||
/**
|
||||
* Name of other descriptors to recursively merge with this one.
|
||||
* No data slot must overlap otherwise we throw an error.
|
||||
*/
|
||||
const char *additional_descriptors[4];
|
||||
} GPUShaderDescriptor;
|
17
source/blender/gpu/shaders/gpu_clip_planes.desc.h
Normal file
17
source/blender/gpu/shaders/gpu_clip_planes.desc.h
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
#include "gpu_shader_descriptor.h"
|
||||
|
||||
GPU_SHADER_DESCRIPTOR(gpu_clip_planes)
|
||||
{
|
||||
.resources =
|
||||
{
|
||||
[DESCRIPTOR_SET_0] =
|
||||
{
|
||||
[1] = UNIFORM_BUFFER("GPUClipPlanes", "clipPlanes"),
|
||||
},
|
||||
},
|
||||
.defines =
|
||||
{
|
||||
[5] = "#define USE_WORLD_CLIP_PLANES\n",
|
||||
},
|
||||
};
|
39
source/blender/gpu/shaders/gpu_shader_3D_flat_color.desc.h
Normal file
39
source/blender/gpu/shaders/gpu_shader_3D_flat_color.desc.h
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
#include "gpu_shader_descriptor.h"
|
||||
|
||||
GPU_STAGE_INTERFACE_CREATE(flat_color_iface)
|
||||
{
|
||||
{VEC4, "finalColor", FLAT},
|
||||
};
|
||||
|
||||
GPU_SHADER_DESCRIPTOR(gpu_shader_3D_flat_color)
|
||||
{
|
||||
.vertex_inputs =
|
||||
{
|
||||
[0] = VERTEX_INPUT(VEC3, "pos"),
|
||||
[1] = VERTEX_INPUT(VEC4, "col"),
|
||||
},
|
||||
.vertex_out_interfaces =
|
||||
{
|
||||
[0] = STAGE_INTERFACE("", flat_color_iface),
|
||||
},
|
||||
.fragment_outputs =
|
||||
{
|
||||
[0] = FRAGMENT_OUTPUT(VEC4, "fragColor"),
|
||||
},
|
||||
.push_constants =
|
||||
{
|
||||
[1] = PUSH_CONSTANT(BOOL, "srgbTarget"),
|
||||
},
|
||||
.vertex_source = "gpu_shader_3D_flat_color_vert.glsl",
|
||||
.fragment_source = "gpu_shader_flat_color_frag.glsl",
|
||||
};
|
||||
|
||||
GPU_SHADER_DESCRIPTOR(gpu_shader_3D_flat_color_clipped)
|
||||
{
|
||||
.additional_descriptors =
|
||||
{
|
||||
"gpu_shader_3D_flat_color",
|
||||
"gpu_clip_planes",
|
||||
},
|
||||
};
|
@@ -154,6 +154,9 @@ typedef struct Panel_Runtime {
|
||||
/* Pointer to the panel's block. Useful when changes to panel #uiBlocks
|
||||
* need some context from traversal of the panel "tree". */
|
||||
struct uiBlock *block;
|
||||
|
||||
/* Non-owning pointer. The context is stored in the block. */
|
||||
struct bContextStore *context;
|
||||
} Panel_Runtime;
|
||||
|
||||
/** The part from uiBlock that needs saved in file. */
|
||||
|
@@ -1491,6 +1491,14 @@ class GeometryNodesEvaluator {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the value of a socket that is not computed by another node. Note that the socket may
|
||||
* still be linked to e.g. a Group Input node, but the socket on the outside is not connected to
|
||||
* anything.
|
||||
*
|
||||
* \param input_socket The socket of the node that wants to use the value.
|
||||
* \param origin_socket The socket that we want to load the value from.
|
||||
*/
|
||||
void load_unlinked_input_value(LockedNode &locked_node,
|
||||
const DInputSocket input_socket,
|
||||
InputState &input_state,
|
||||
@@ -1510,7 +1518,15 @@ class GeometryNodesEvaluator {
|
||||
else {
|
||||
SingleInputValue &single_value = *input_state.value.single;
|
||||
single_value.value = value.get();
|
||||
this->log_socket_value({input_socket}, value);
|
||||
Vector<DSocket> sockets_to_log_to = {input_socket};
|
||||
if (origin_socket != input_socket) {
|
||||
/* This might log the socket value for the #origin_socket more than once, but this is
|
||||
* handled by the logging system gracefully. */
|
||||
sockets_to_log_to.append(origin_socket);
|
||||
}
|
||||
/* TODO: Log to the intermediate sockets between the group input and where the value is
|
||||
* actually used as well. */
|
||||
this->log_socket_value(sockets_to_log_to, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -132,7 +132,7 @@ PointerRNA *modifier_panel_get_property_pointers(Panel *panel, PointerRNA *r_ob_
|
||||
uiBlock *block = uiLayoutGetBlock(panel->layout);
|
||||
UI_block_lock_set(block, ID_IS_LINKED((Object *)ptr->owner_id), ERROR_LIBDATA_MESSAGE);
|
||||
|
||||
uiLayoutSetContextPointer(panel->layout, "modifier", ptr);
|
||||
UI_panel_context_pointer_set(panel, "modifier", ptr);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
@@ -304,7 +304,7 @@ static void modifier_panel_header(const bContext *C, Panel *panel)
|
||||
ModifierData *md = (ModifierData *)ptr->data;
|
||||
Object *ob = (Object *)ptr->owner_id;
|
||||
|
||||
uiLayoutSetContextPointer(panel->layout, "modifier", ptr);
|
||||
UI_panel_context_pointer_set(panel, "modifier", ptr);
|
||||
|
||||
const ModifierTypeInfo *mti = BKE_modifier_get_info(md->type);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
|
@@ -163,6 +163,27 @@ static void copy_attributes_based_on_mask(const Map<AttributeIDRef, AttributeKin
|
||||
}
|
||||
}
|
||||
|
||||
static void copy_face_corner_attributes(const Map<AttributeIDRef, AttributeKind> &attributes,
|
||||
const GeometryComponent &in_component,
|
||||
GeometryComponent &out_component,
|
||||
const int num_selected_loops,
|
||||
const Span<int> selected_poly_indices,
|
||||
const Mesh &mesh_in)
|
||||
{
|
||||
Vector<int64_t> indices;
|
||||
indices.reserve(num_selected_loops);
|
||||
for (const int src_poly_index : selected_poly_indices) {
|
||||
const MPoly &src_poly = mesh_in.mpoly[src_poly_index];
|
||||
const int src_loop_start = src_poly.loopstart;
|
||||
const int tot_loop = src_poly.totloop;
|
||||
for (const int i : IndexRange(tot_loop)) {
|
||||
indices.append_unchecked(src_loop_start + i);
|
||||
}
|
||||
}
|
||||
copy_attributes_based_on_mask(
|
||||
attributes, in_component, out_component, ATTR_DOMAIN_CORNER, IndexMask(indices));
|
||||
}
|
||||
|
||||
static void copy_masked_edges_to_new_mesh(const Mesh &src_mesh, Mesh &dst_mesh, Span<int> edge_map)
|
||||
{
|
||||
BLI_assert(src_mesh.totedge == edge_map.size());
|
||||
@@ -1017,12 +1038,17 @@ static void do_mesh_separation(GeometrySet &geometry_set,
|
||||
out_component,
|
||||
ATTR_DOMAIN_EDGE,
|
||||
index_mask_indices(edge_map, num_selected_edges, indices));
|
||||
copy_attributes_based_on_mask(
|
||||
attributes,
|
||||
in_component,
|
||||
out_component,
|
||||
ATTR_DOMAIN_FACE,
|
||||
index_mask_indices(selected_poly_indices, num_selected_polys, indices));
|
||||
copy_attributes_based_on_mask(attributes,
|
||||
in_component,
|
||||
out_component,
|
||||
ATTR_DOMAIN_FACE,
|
||||
IndexMask(Vector<int64_t>(selected_poly_indices.as_span())));
|
||||
copy_face_corner_attributes(attributes,
|
||||
in_component,
|
||||
out_component,
|
||||
num_selected_loops,
|
||||
selected_poly_indices,
|
||||
mesh_in);
|
||||
break;
|
||||
}
|
||||
case GEO_NODE_DELETE_GEOMETRY_MODE_ONLY_FACE: {
|
||||
@@ -1069,11 +1095,17 @@ static void do_mesh_separation(GeometrySet &geometry_set,
|
||||
copy_attributes(
|
||||
attributes, in_component, out_component, {ATTR_DOMAIN_POINT, ATTR_DOMAIN_EDGE});
|
||||
copy_masked_polys_to_new_mesh(mesh_in, *mesh_out, selected_poly_indices, new_loop_starts);
|
||||
Vector<int64_t> indices;
|
||||
const IndexMask mask = index_mask_indices(
|
||||
selected_poly_indices, num_selected_polys, indices);
|
||||
copy_attributes_based_on_mask(
|
||||
attributes, in_component, out_component, ATTR_DOMAIN_FACE, mask);
|
||||
copy_attributes_based_on_mask(attributes,
|
||||
in_component,
|
||||
out_component,
|
||||
ATTR_DOMAIN_FACE,
|
||||
IndexMask(Vector<int64_t>(selected_poly_indices.as_span())));
|
||||
copy_face_corner_attributes(attributes,
|
||||
in_component,
|
||||
out_component,
|
||||
num_selected_loops,
|
||||
selected_poly_indices,
|
||||
mesh_in);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -117,7 +117,7 @@ PointerRNA *shaderfx_panel_get_property_pointers(Panel *panel, PointerRNA *r_ob_
|
||||
RNA_pointer_create(ptr->owner_id, &RNA_Object, ptr->owner_id, r_ob_ptr);
|
||||
}
|
||||
|
||||
uiLayoutSetContextPointer(panel->layout, "shaderfx", ptr);
|
||||
UI_panel_context_pointer_set(panel, "shaderfx", ptr);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
Reference in New Issue
Block a user