GPU: Shader Create Info GLSL-C++ stubs #3

Closed
Clément Foucault wants to merge 90 commits from create-info-cpp-macros into glsl-include

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 56 additions and 33 deletions
Showing only changes of commit 2e657ac4ca - Show all commits

View File

@ -10,15 +10,36 @@
#include "gpu_shader_create_info.hh" #include "gpu_shader_create_info.hh"
GPU_SHADER_INTERFACE_INFO(flat_color_iface, "").flat(Type::VEC4, "finalColor"); GPU_SHADER_INTERFACE_INFO(flat_color_iface)
GPU_SHADER_INTERFACE_INFO(no_perspective_color_iface, "").no_perspective(Type::VEC4, "finalColor"); FLAT(VEC4, finalColor)
GPU_SHADER_INTERFACE_INFO(smooth_color_iface, "").smooth(Type::VEC4, "finalColor"); GPU_SHADER_INTERFACE_END()
GPU_SHADER_INTERFACE_INFO(smooth_tex_coord_interp_iface, "").smooth(Type::VEC2, "texCoord_interp");
GPU_SHADER_INTERFACE_INFO(smooth_radii_iface, "").smooth(Type::VEC2, "radii"); GPU_SHADER_INTERFACE_INFO(no_perspective_color_iface)
GPU_SHADER_INTERFACE_INFO(smooth_radii_outline_iface, "").smooth(Type::VEC4, "radii"); NO_PERSPECTIVE(VEC4, finalColor)
GPU_SHADER_INTERFACE_INFO(flat_color_smooth_tex_coord_interp_iface, "") GPU_SHADER_INTERFACE_END()
.flat(Type::VEC4, "finalColor")
.smooth(Type::VEC2, "texCoord_interp"); GPU_SHADER_INTERFACE_INFO(smooth_color_iface)
GPU_SHADER_INTERFACE_INFO(smooth_icon_interp_iface, "") SMOOTH(VEC4, finalColor)
.smooth(Type::VEC2, "texCoord_interp") GPU_SHADER_INTERFACE_END()
.smooth(Type::VEC2, "mask_coord_interp");
GPU_SHADER_INTERFACE_INFO(smooth_tex_coord_interp_iface)
SMOOTH(VEC2, texCoord_interp)
GPU_SHADER_INTERFACE_END()
GPU_SHADER_INTERFACE_INFO(smooth_radii_iface)
SMOOTH(VEC2, radii)
GPU_SHADER_INTERFACE_END()
GPU_SHADER_INTERFACE_INFO(smooth_radii_outline_iface)
SMOOTH(VEC4, radii)
GPU_SHADER_INTERFACE_END()
GPU_SHADER_INTERFACE_INFO(flat_color_smooth_tex_coord_interp_iface)
FLAT(VEC4, finalColor)
SMOOTH(VEC2, texCoord_interp)
GPU_SHADER_INTERFACE_END()
GPU_SHADER_INTERFACE_INFO(smooth_icon_interp_iface)
SMOOTH(VEC2, texCoord_interp)
SMOOTH(VEC2, mask_coord_interp)
GPU_SHADER_INTERFACE_END()

View File

@ -10,26 +10,28 @@
#include "gpu_shader_create_info.hh" #include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(gpu_shader_icon) GPU_SHADER_CREATE_INFO(gpu_shader_icon)
.define("DO_CORNER_MASKING") DEFINE(DO_CORNER_MASKING)
.vertex_out(smooth_icon_interp_iface) VERTEX_OUT(smooth_icon_interp_iface)
.fragment_out(0, Type::VEC4, "fragColor") FRAGMENT_OUT(0, VEC4, fragColor)
.push_constant(Type::MAT4, "ModelViewProjectionMatrix") PUSH_CONSTANT(MAT4, ModelViewProjectionMatrix)
.push_constant(Type::VEC4, "finalColor") PUSH_CONSTANT(VEC4, finalColor)
.push_constant(Type::VEC4, "rect_icon") PUSH_CONSTANT(VEC4, rect_icon)
.push_constant(Type::VEC4, "rect_geom") PUSH_CONSTANT(VEC4, rect_geom)
.push_constant(Type::FLOAT, "text_width") PUSH_CONSTANT(FLOAT, text_width)
.sampler(0, ImageType::FLOAT_2D, "image") SAMPLER(0, FLOAT_2D, image)
.vertex_source("gpu_shader_icon_vert.glsl") VERTEX_SOURCE("gpu_shader_icon_vert.glsl")
.fragment_source("gpu_shader_icon_frag.glsl") FRAGMENT_SOURCE("gpu_shader_icon_frag.glsl")
.do_static_compilation(true); DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(gpu_shader_icon_multi) GPU_SHADER_CREATE_INFO(gpu_shader_icon_multi)
.vertex_in(0, Type::VEC2, "pos") VERTEX_IN(0, VEC2, pos)
.vertex_out(flat_color_smooth_tex_coord_interp_iface) VERTEX_OUT(flat_color_smooth_tex_coord_interp_iface)
.fragment_out(0, Type::VEC4, "fragColor") FRAGMENT_OUT(0, VEC4, fragColor)
.uniform_buf(0, "MultiIconCallData", "multi_icon_data") UNIFORM_BUF(0, MultiIconCallData, multi_icon_data)
.sampler(0, ImageType::FLOAT_2D, "image") SAMPLER(0, FLOAT_2D, image)
.typedef_source("GPU_shader_shared.hh") TYPEDEF_SOURCE("GPU_shader_shared.hh")
.vertex_source("gpu_shader_icon_multi_vert.glsl") VERTEX_SOURCE("gpu_shader_icon_multi_vert.glsl")
.fragment_source("gpu_shader_icon_frag.glsl") FRAGMENT_SOURCE("gpu_shader_icon_frag.glsl")
.do_static_compilation(true); DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()