forked from blender/blender
GPU: Shader Create Info GLSL-C++ stubs #3
@ -10,15 +10,36 @@
|
||||
|
||||
#include "gpu_shader_create_info.hh"
|
||||
|
||||
GPU_SHADER_INTERFACE_INFO(flat_color_iface, "").flat(Type::VEC4, "finalColor");
|
||||
GPU_SHADER_INTERFACE_INFO(no_perspective_color_iface, "").no_perspective(Type::VEC4, "finalColor");
|
||||
GPU_SHADER_INTERFACE_INFO(smooth_color_iface, "").smooth(Type::VEC4, "finalColor");
|
||||
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(smooth_radii_outline_iface, "").smooth(Type::VEC4, "radii");
|
||||
GPU_SHADER_INTERFACE_INFO(flat_color_smooth_tex_coord_interp_iface, "")
|
||||
.flat(Type::VEC4, "finalColor")
|
||||
.smooth(Type::VEC2, "texCoord_interp");
|
||||
GPU_SHADER_INTERFACE_INFO(smooth_icon_interp_iface, "")
|
||||
.smooth(Type::VEC2, "texCoord_interp")
|
||||
.smooth(Type::VEC2, "mask_coord_interp");
|
||||
GPU_SHADER_INTERFACE_INFO(flat_color_iface)
|
||||
FLAT(VEC4, finalColor)
|
||||
GPU_SHADER_INTERFACE_END()
|
||||
|
||||
GPU_SHADER_INTERFACE_INFO(no_perspective_color_iface)
|
||||
NO_PERSPECTIVE(VEC4, finalColor)
|
||||
GPU_SHADER_INTERFACE_END()
|
||||
|
||||
GPU_SHADER_INTERFACE_INFO(smooth_color_iface)
|
||||
SMOOTH(VEC4, finalColor)
|
||||
GPU_SHADER_INTERFACE_END()
|
||||
|
||||
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()
|
||||
|
@ -10,26 +10,28 @@
|
||||
#include "gpu_shader_create_info.hh"
|
||||
|
||||
GPU_SHADER_CREATE_INFO(gpu_shader_icon)
|
||||
.define("DO_CORNER_MASKING")
|
||||
.vertex_out(smooth_icon_interp_iface)
|
||||
.fragment_out(0, Type::VEC4, "fragColor")
|
||||
.push_constant(Type::MAT4, "ModelViewProjectionMatrix")
|
||||
.push_constant(Type::VEC4, "finalColor")
|
||||
.push_constant(Type::VEC4, "rect_icon")
|
||||
.push_constant(Type::VEC4, "rect_geom")
|
||||
.push_constant(Type::FLOAT, "text_width")
|
||||
.sampler(0, ImageType::FLOAT_2D, "image")
|
||||
.vertex_source("gpu_shader_icon_vert.glsl")
|
||||
.fragment_source("gpu_shader_icon_frag.glsl")
|
||||
.do_static_compilation(true);
|
||||
DEFINE(DO_CORNER_MASKING)
|
||||
VERTEX_OUT(smooth_icon_interp_iface)
|
||||
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||
PUSH_CONSTANT(MAT4, ModelViewProjectionMatrix)
|
||||
PUSH_CONSTANT(VEC4, finalColor)
|
||||
PUSH_CONSTANT(VEC4, rect_icon)
|
||||
PUSH_CONSTANT(VEC4, rect_geom)
|
||||
PUSH_CONSTANT(FLOAT, text_width)
|
||||
SAMPLER(0, FLOAT_2D, image)
|
||||
VERTEX_SOURCE("gpu_shader_icon_vert.glsl")
|
||||
FRAGMENT_SOURCE("gpu_shader_icon_frag.glsl")
|
||||
DO_STATIC_COMPILATION()
|
||||
GPU_SHADER_CREATE_END()
|
||||
|
||||
GPU_SHADER_CREATE_INFO(gpu_shader_icon_multi)
|
||||
.vertex_in(0, Type::VEC2, "pos")
|
||||
.vertex_out(flat_color_smooth_tex_coord_interp_iface)
|
||||
.fragment_out(0, Type::VEC4, "fragColor")
|
||||
.uniform_buf(0, "MultiIconCallData", "multi_icon_data")
|
||||
.sampler(0, ImageType::FLOAT_2D, "image")
|
||||
.typedef_source("GPU_shader_shared.hh")
|
||||
.vertex_source("gpu_shader_icon_multi_vert.glsl")
|
||||
.fragment_source("gpu_shader_icon_frag.glsl")
|
||||
.do_static_compilation(true);
|
||||
VERTEX_IN(0, VEC2, pos)
|
||||
VERTEX_OUT(flat_color_smooth_tex_coord_interp_iface)
|
||||
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||
UNIFORM_BUF(0, MultiIconCallData, multi_icon_data)
|
||||
SAMPLER(0, FLOAT_2D, image)
|
||||
TYPEDEF_SOURCE("GPU_shader_shared.hh")
|
||||
VERTEX_SOURCE("gpu_shader_icon_multi_vert.glsl")
|
||||
FRAGMENT_SOURCE("gpu_shader_icon_frag.glsl")
|
||||
DO_STATIC_COMPILATION()
|
||||
GPU_SHADER_CREATE_END()
|
||||
|
Loading…
Reference in New Issue
Block a user