39 case Interpolation::SMOOTH:
41 case Interpolation::FLAT:
43 case Interpolation::NO_PERSPECTIVE:
44 return "noperspective";
152 return "r11f_g11f_b10f";
163 case PrimitiveIn::POINTS:
165 case PrimitiveIn::LINES:
167 case PrimitiveIn::LINES_ADJACENCY:
168 return "lines_adjacency";
169 case PrimitiveIn::TRIANGLES:
171 case PrimitiveIn::TRIANGLES_ADJACENCY:
172 return "triangles_adjacency";
181 case PrimitiveOut::POINTS:
183 case PrimitiveOut::LINE_STRIP:
185 case PrimitiveOut::TRIANGLE_STRIP:
186 return "triangle_strip";
195 case DepthWrite::ANY:
197 case DepthWrite::GREATER:
198 return "depth_greater";
199 case DepthWrite::LESS:
202 return "depth_unchanged";
211 case ImageType::INT_BUFFER:
212 case ImageType::INT_1D:
213 case ImageType::INT_1D_ARRAY:
214 case ImageType::INT_2D:
215 case ImageType::INT_2D_ARRAY:
216 case ImageType::INT_3D:
217 case ImageType::INT_CUBE:
218 case ImageType::INT_CUBE_ARRAY:
219 case ImageType::INT_2D_ATOMIC:
220 case ImageType::INT_2D_ARRAY_ATOMIC:
221 case ImageType::INT_3D_ATOMIC:
224 case ImageType::UINT_BUFFER:
225 case ImageType::UINT_1D:
226 case ImageType::UINT_1D_ARRAY:
227 case ImageType::UINT_2D:
228 case ImageType::UINT_2D_ARRAY:
229 case ImageType::UINT_3D:
230 case ImageType::UINT_CUBE:
231 case ImageType::UINT_CUBE_ARRAY:
232 case ImageType::UINT_2D_ATOMIC:
233 case ImageType::UINT_2D_ARRAY_ATOMIC:
234 case ImageType::UINT_3D_ATOMIC:
241 if (bind_type == ShaderCreateInfo::Resource::BindType::IMAGE) {
249 case ImageType::FLOAT_BUFFER:
250 case ImageType::INT_BUFFER:
251 case ImageType::UINT_BUFFER:
254 case ImageType::FLOAT_1D:
255 case ImageType::FLOAT_1D_ARRAY:
256 case ImageType::INT_1D:
257 case ImageType::INT_1D_ARRAY:
258 case ImageType::UINT_1D:
259 case ImageType::UINT_1D_ARRAY:
262 case ImageType::FLOAT_2D:
263 case ImageType::FLOAT_2D_ARRAY:
264 case ImageType::INT_2D:
265 case ImageType::INT_2D_ARRAY:
266 case ImageType::UINT_2D:
267 case ImageType::UINT_2D_ARRAY:
268 case ImageType::SHADOW_2D:
269 case ImageType::SHADOW_2D_ARRAY:
270 case ImageType::DEPTH_2D:
271 case ImageType::DEPTH_2D_ARRAY:
272 case ImageType::INT_2D_ATOMIC:
273 case ImageType::INT_2D_ARRAY_ATOMIC:
274 case ImageType::UINT_2D_ATOMIC:
275 case ImageType::UINT_2D_ARRAY_ATOMIC:
278 case ImageType::FLOAT_3D:
279 case ImageType::INT_3D:
280 case ImageType::INT_3D_ATOMIC:
281 case ImageType::UINT_3D:
282 case ImageType::UINT_3D_ATOMIC:
285 case ImageType::FLOAT_CUBE:
286 case ImageType::FLOAT_CUBE_ARRAY:
287 case ImageType::INT_CUBE:
288 case ImageType::INT_CUBE_ARRAY:
289 case ImageType::UINT_CUBE:
290 case ImageType::UINT_CUBE_ARRAY:
291 case ImageType::SHADOW_CUBE:
292 case ImageType::SHADOW_CUBE_ARRAY:
293 case ImageType::DEPTH_CUBE:
294 case ImageType::DEPTH_CUBE_ARRAY:
302 case ImageType::FLOAT_1D_ARRAY:
303 case ImageType::FLOAT_2D_ARRAY:
304 case ImageType::FLOAT_CUBE_ARRAY:
305 case ImageType::INT_1D_ARRAY:
306 case ImageType::INT_2D_ARRAY:
307 case ImageType::INT_CUBE_ARRAY:
308 case ImageType::UINT_1D_ARRAY:
309 case ImageType::UINT_2D_ARRAY:
310 case ImageType::UINT_CUBE_ARRAY:
311 case ImageType::SHADOW_2D_ARRAY:
312 case ImageType::SHADOW_CUBE_ARRAY:
313 case ImageType::DEPTH_2D_ARRAY:
314 case ImageType::DEPTH_CUBE_ARRAY:
315 case ImageType::UINT_2D_ARRAY_ATOMIC:
323 case ImageType::SHADOW_2D:
324 case ImageType::SHADOW_2D_ARRAY:
325 case ImageType::SHADOW_CUBE:
326 case ImageType::SHADOW_CUBE_ARRAY:
337 if (
bool(qualifiers & Qualifier::NO_RESTRICT) ==
false) {
340 if (
bool(qualifiers & Qualifier::READ) ==
false) {
343 if (
bool(qualifiers & Qualifier::WRITE) ==
false) {
353 os <<
"layout(binding = " <<
uint32_t(location);
354 if (res.
bind_type == ShaderCreateInfo::Resource::BindType::IMAGE) {
357 else if (res.
bind_type == ShaderCreateInfo::Resource::BindType::UNIFORM_BUFFER) {
360 else if (res.
bind_type == ShaderCreateInfo::Resource::BindType::STORAGE_BUFFER) {
369 case ShaderCreateInfo::Resource::BindType::SAMPLER:
374 case ShaderCreateInfo::Resource::BindType::IMAGE:
380 case ShaderCreateInfo::Resource::BindType::UNIFORM_BUFFER:
381 array_offset = res.
uniformbuf.name.find_first_of(
"[");
382 name_no_array = (array_offset == -1) ? res.
uniformbuf.name :
384 os <<
"uniform _" << name_no_array <<
" { " << res.
uniformbuf.type_name <<
" "
387 case ShaderCreateInfo::Resource::BindType::STORAGE_BUFFER:
388 array_offset = res.
storagebuf.name.find_first_of(
"[");
389 name_no_array = (array_offset == -1) ? res.
storagebuf.name :
419 const std::string &prefix,
424 os <<
"layout(location=" << location <<
") " << prefix <<
" " <<
to_string(inout.interp) <<
" "
425 <<
to_string(inout.type) <<
" " << inout.name <<
";\n";
431 const std::string &prefix,
436 std::string struct_name = prefix + iface.
name;
439 os <<
"struct " << struct_name <<
" {\n";
441 os <<
" " <<
to_string(inout.type) <<
" " << inout.name <<
";\n";
444 os <<
"layout(location=" << location <<
") " << prefix <<
" " <<
to_string(qualifier) <<
" "
445 << struct_name <<
" " << iface.
instance_name << suffix <<
";\n";
453 const std::string &prefix,
469 std::stringstream ss;
472 ss <<
"void main_function_();\n";
474 ss <<
"void main() {\n";
476 ss <<
" main_function_();\n";
480 ss <<
"#define main main_function_\n";
488 std::string
result(sources_combined);
501 vk_interface->
init(info);
502 interface = vk_interface;
505 use_batch_compilation_ = is_batch_compilation;
518 vk_descriptor_set_layout_ = VK_NULL_HANDLE;
522 shaderc_shader_kind
stage,
526 shaderc_vertex_shader,
527 shaderc_geometry_shader,
528 shaderc_fragment_shader,
529 shaderc_compute_shader),
530 "Only forced ShaderC shader kinds are supported.");
535 if (!use_batch_compilation_) {
543 build_shader_module(sources, shaderc_vertex_shader,
vertex_module);
548 build_shader_module(sources, shaderc_geometry_shader,
geometry_module);
553 build_shader_module(sources, shaderc_fragment_shader,
fragment_module);
558 build_shader_module(sources, shaderc_compute_shader,
compute_module);
568 if (!use_batch_compilation_) {
575 if (do_geometry_shader_injection(info)) {
576 std::string source = workaround_geometry_shader_source_create(*info);
578 sources.
append(
"version");
579 sources.
append(source.c_str());
585 if (!finalize_descriptor_set_layouts(device, vk_interface)) {
588 if (!finalize_pipeline_layout(device.
vk_handle(), vk_interface)) {
593 if (use_batch_compilation_) {
601 bool result = finalize_shader_module(
vertex_module,
"vertex") &&
615 if (result && is_compute_shader_) {
621bool VKShader::finalize_shader_module(
VKShaderModule &shader_module,
const char *stage_name)
625 shaderc_compilation_status_null_result_object,
626 shaderc_compilation_status_success);
638 std::string full_name = std::string(name) +
"_" + stage_name;
639 shader_module.
finalize(full_name.c_str());
644 return compilation_succeeded;
652bool VKShader::finalize_pipeline_layout(VkDevice vk_device,
657 const uint32_t layout_count = vk_descriptor_set_layout_ == VK_NULL_HANDLE ? 0 : 1;
658 VkPipelineLayoutCreateInfo pipeline_info = {};
659 VkPushConstantRange push_constant_range = {};
660 pipeline_info.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
661 pipeline_info.flags = 0;
662 pipeline_info.setLayoutCount = layout_count;
663 pipeline_info.pSetLayouts = &vk_descriptor_set_layout_;
669 push_constant_range.offset = 0;
670 push_constant_range.size = push_constants_layout.
size_in_bytes();
671 push_constant_range.stageFlags = is_compute_shader_ ? VK_SHADER_STAGE_COMPUTE_BIT :
672 VK_SHADER_STAGE_ALL_GRAPHICS;
673 pipeline_info.pushConstantRangeCount = 1;
674 pipeline_info.pPushConstantRanges = &push_constant_range;
677 if (vkCreatePipelineLayout(
678 vk_device, &pipeline_info, vk_allocation_callbacks, &
vk_pipeline_layout) != VK_SUCCESS)
686bool VKShader::finalize_descriptor_set_layouts(
VKDevice &vk_device,
698 BLI_assert(vk_descriptor_set_layout_ == VK_NULL_HANDLE);
701 return vk_descriptor_set_layout_ != VK_NULL_HANDLE;
750 std::stringstream ss;
752 ss <<
"\n/* Specialization Constants (pass-through). */\n";
753 uint constant_id = 0;
755 ss <<
"layout (constant_id=" << constant_id++ <<
") const ";
758 ss <<
"int " << sc.name <<
"=" << std::to_string(sc.value.i) <<
";\n";
761 ss <<
"uint " << sc.name <<
"=" << std::to_string(sc.value.u) <<
"u;\n";
764 ss <<
"bool " << sc.name <<
"=" << (sc.value.u ?
"true" :
"false") <<
";\n";
769 ss <<
"uint " << sc.name <<
"_uint=" << std::to_string(sc.value.u) <<
"u;\n";
770 ss <<
"#define " << sc.name <<
" uintBitsToFloat(" << sc.name <<
"_uint)\n";
778 ss <<
"\n/* Pass Resources. */\n";
783 ss <<
"\n/* Batch Resources. */\n";
788 ss <<
"\n/* Geometry Resources. */\n";
798 ss <<
"\n/* Push Constants. */\n";
800 ss <<
"layout(push_constant, std430) uniform constants\n";
804 <<
", std140) uniform constants\n";
808 ss <<
" " <<
to_string(uniform.type) <<
" pc_" << uniform.name;
809 if (uniform.array_size > 0) {
810 ss <<
"[" << uniform.array_size <<
"]";
814 ss <<
"} PushConstants;\n";
816 ss <<
"#define " << uniform.name <<
" (PushConstants.pc_" << uniform.name <<
")\n";
826 std::stringstream ss;
827 std::string post_main;
830 ss <<
"\n/* Inputs. */\n";
832 ss <<
"layout(location = " << attr.index <<
") ";
833 ss <<
"in " <<
to_string(attr.type) <<
" " << attr.name <<
";\n";
835 ss <<
"\n/* Interfaces. */\n";
841 ss <<
"layout(location=" << (location++) <<
") out int gpu_Layer;\n ";
844 bool(info.
builtins_ & BuiltinBits::VIEWPORT_INDEX))
846 ss <<
"layout(location=" << (location++) <<
") out int gpu_ViewportIndex;\n";
852 const bool has_geometry_stage = do_geometry_shader_injection(&info) ||
854 const bool retarget_depth = !has_geometry_stage;
855 if (retarget_depth) {
856 post_main +=
"gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5;\n";
859 if (post_main.empty() ==
false) {
860 std::string pre_main;
906 case Type::VEC3_101010I2:
915 std::stringstream ss;
916 std::string pre_main;
919 ss <<
"\n/* Interfaces. */\n";
928 ss <<
"#define gpu_Layer gl_Layer\n";
931 bool(info.
builtins_ & BuiltinBits::VIEWPORT_INDEX))
933 ss <<
"#define gpu_ViewportIndex gl_ViewportIndex\n";
937 bool(info.
builtins_ & BuiltinBits::BARYCENTRIC_COORD))
939 ss <<
"layout(location=" << (location++) <<
") smooth in vec3 gpu_BaryCoord;\n";
940 ss <<
"layout(location=" << (location++) <<
") noperspective in vec3 gpu_BaryCoordNoPersp;\n";
944 ss <<
"layout(early_fragment_tests) in;\n";
946 const bool use_gl_frag_depth = info.
depth_write_ != DepthWrite::UNCHANGED &&
948 if (use_gl_frag_depth) {
952 ss <<
"\n/* Sub-pass Inputs. */\n";
954 std::string image_name =
"gpu_subpass_img_";
955 image_name += std::to_string(input.index);
958 ss <<
to_string(input.type) <<
" " << input.name <<
";\n";
962 bool is_layered_fb = bool(info.
builtins_ & BuiltinBits::LAYER);
965 ImageType image_type = ImageType::FLOAT_BUFFER;
968 image_type = is_layered_fb ? ImageType::FLOAT_2D_ARRAY : ImageType::FLOAT_2D;
971 image_type = is_layered_fb ? ImageType::INT_2D_ARRAY : ImageType::INT_2D;
974 image_type = is_layered_fb ? ImageType::UINT_2D_ARRAY : ImageType::UINT_2D;
983 Resource res(Resource::BindType::SAMPLER, input.index);
984 res.sampler.type = image_type;
986 res.sampler.name = image_name;
989 char swizzle[] =
"xyzw";
992 std::string texel_co = (is_layered_fb) ?
"ivec3(gl_FragCoord.xy, gpu_Layer)" :
993 "ivec2(gl_FragCoord.xy)";
995 std::stringstream ss_pre;
997 ss_pre <<
" " << input.name <<
" = texelFetch(" << image_name <<
", " << texel_co <<
", 0)."
1000 pre_main += ss_pre.str();
1003 ss <<
"\n/* Outputs. */\n";
1005 ss <<
"layout(location = " << output.index;
1006 switch (output.blend) {
1007 case DualBlend::SRC_0:
1008 ss <<
", index = 0";
1010 case DualBlend::SRC_1:
1011 ss <<
", index = 1";
1017 ss <<
"out " <<
to_string(output.type) <<
" " << output.name <<
";\n";
1021 if (pre_main.empty() ==
false) {
1022 std::string post_main;
1033 std::stringstream ss;
1034 ss <<
"\n/* Geometry Layout. */\n";
1036 if (invocations != -1) {
1037 ss <<
", invocations = " << invocations;
1042 <<
", max_vertices = " << max_verts <<
") out;\n";
1051 if (iface->instance_name == name) {
1060 ss <<
"void gpu_EmitVertex() {\n";
1061 ss <<
" gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5;\n";
1062 ss <<
" EmitVertex();\n";
1068 std::stringstream ss;
1070 ss <<
"\n/* Interfaces. */\n";
1074 iface->instance_name) !=
nullptr;
1075 const char *suffix = (has_matching_output_iface) ?
"_in[]" :
"[]";
1083 iface->instance_name) !=
nullptr;
1084 const char *suffix = (has_matching_input_iface) ?
"_out" :
"";
1096 std::stringstream ss;
1097 ss <<
"\n/* Compute Layout. */\n";
1115std::string VKShader::workaround_geometry_shader_source_create(
1118 std::stringstream ss;
1122 bool(info.
builtins_ & BuiltinBits::LAYER);
1124 bool(info.
builtins_ & BuiltinBits::VIEWPORT_INDEX);
1126 bool(info.
builtins_ & BuiltinBits::BARYCENTRIC_COORD);
1134 info_modified.
geometry_layout(PrimitiveIn::TRIANGLES, PrimitiveOut::TRIANGLE_STRIP, 3);
1145 int location_in = location;
1146 int location_out = location;
1147 if (do_layer_workaround) {
1148 ss <<
"layout(location=" << (location_in++) <<
") in int gpu_Layer[];\n";
1150 if (do_viewport_workaround) {
1151 ss <<
"layout(location=" << (location_in++) <<
") in int gpu_ViewportIndex[];\n";
1153 if (do_barycentric_workaround) {
1154 ss <<
"layout(location=" << (location_out++) <<
") smooth out vec3 gpu_BaryCoord;\n";
1155 ss <<
"layout(location=" << (location_out++)
1156 <<
") noperspective out vec3 gpu_BaryCoordNoPersp;\n";
1160 ss <<
"void main()\n";
1162 if (do_layer_workaround) {
1163 ss <<
" gl_Layer = gpu_Layer[0];\n";
1165 if (do_viewport_workaround) {
1166 ss <<
" gl_ViewportIndex = gpu_ViewportIndex[0];\n";
1170 for (
auto &inout : iface->inouts) {
1171 ss <<
" " << iface->instance_name <<
"_out." << inout.name;
1172 ss <<
" = " << iface->instance_name <<
"_in[" << i <<
"]." << inout.name <<
";\n";
1175 if (do_barycentric_workaround) {
1176 ss <<
" gpu_BaryCoordNoPersp = gpu_BaryCoord =";
1177 ss <<
" vec3(" <<
int(i == 0) <<
", " <<
int(i == 1) <<
", " <<
int(i == 2) <<
");\n";
1179 ss <<
" gl_Position = gl_in[" << i <<
"].gl_Position;\n";
1180 ss <<
" gpu_EmitVertex();\n";
1212 if (
constants.
values.is_empty() && vk_pipeline_base_ != VK_NULL_HANDLE) {
1213 return vk_pipeline_base_;
1224 compute_info, is_static_shader_, vk_pipeline_base_);
1225 if (vk_pipeline_base_ == VK_NULL_HANDLE) {
1226 vk_pipeline_base_ = vk_pipeline;
1239 "GPU_PRIM_POINTS is used with a shader that doesn't set point size before "
1240 "drawing fragments. Calling code should be adapted to use a shader that sets the "
1241 "gl_PointSize before entering the fragment stage. For example `GPU_SHADER_3D_POINT_*`.");
1273 graphics_info, is_static_shader_, vk_pipeline_base_);
1274 if (vk_pipeline_base_ == VK_NULL_HANDLE) {
1275 vk_pipeline_base_ = vk_pipeline;
1288 "Interface can be accessed after the VKShader has been initialized "
1289 "`VKShader::init`");
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
char * BLI_string_join_arrayN(const char *strings[], uint strings_num) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
constexpr const T * data() const
constexpr int64_t size() const
constexpr int64_t find(char c, int64_t pos=0) const
constexpr bool is_empty() const
void append(const T &value)
void extend(Span< T > array)
ShaderInterface * interface
const char *const name_get() const
struct blender::gpu::Shader::Constants constants
void print_log(Span< const char * > sources, const char *log, const char *stage, bool error, GPULogParser *parser)
GPUStateMutable mutable_state
VkDescriptorSetLayout get_or_create(const VKDescriptorSetLayoutInfo &info, bool &r_created, bool &r_needed)
VKDescriptorSetLayouts & descriptor_set_layouts_get()
VkDevice vk_handle() const
VKDiscardPool & discard_pool_for_current_thread()
const char * glsl_patch_get() const
const VKWorkarounds & workarounds_get() const
void discard_pipeline_layout(VkPipelineLayout vk_pipeline_layout)
VkFormat stencil_attachment_format_get() const
VkFormat depth_attachment_format_get() const
Array< VkViewport, 16 > vk_viewports_get() const
Array< VkRect2D, 16 > vk_render_areas_get() const
Span< VkFormat > color_attachment_formats_get() const
VkPipeline get_or_create_compute_pipeline(VKComputeInfo &compute_info, bool is_static_shader, VkPipeline vk_pipeline_base)
VkPipeline get_or_create_graphics_pipeline(VKGraphicsInfo &graphics_info, bool is_static_shader, VkPipeline vk_pipeline_base)
void push_constant_set(int32_t location, int32_t comp_len, int32_t array_size, const T *input_data)
static bool compile_module(VKShader &shader, shaderc_shader_kind stage, VKShaderModule &shader_module)
const VKPushConstants::Layout & push_constants_layout_get() const
const VKDescriptorSetLayoutInfo & descriptor_set_layout_info_get() const
const VKDescriptorSet::Location descriptor_set_location(const shader::ShaderCreateInfo::Resource &resource) const
void init(const shader::ShaderCreateInfo &info)
shaderc::SpvCompilationResult compilation_result
VkShaderModule vk_shader_module
std::string combined_sources
void finalize(StringRefNull name)
Vector< uint32_t > spirv_binary
VKShaderModule compute_module
void init(const shader::ShaderCreateInfo &info, bool is_batch_compilation) override
std::string fragment_interface_declare(const shader::ShaderCreateInfo &info) const override
int program_handle_get() const override
bool compilation_finished
VKShaderModule fragment_module
void transform_feedback_names_set(Span< const char * > name_list, eGPUShaderTFBType geom_type) override
void geometry_shader_from_glsl(MutableSpan< const char * > sources) override
void compute_shader_from_glsl(MutableSpan< const char * > sources) override
std::string geometry_interface_declare(const shader::ShaderCreateInfo &info) const override
void warm_cache(int limit) override
VKPushConstants push_constants
std::string resources_declare(const shader::ShaderCreateInfo &info) const override
std::string compute_layout_declare(const shader::ShaderCreateInfo &info) const override
VkPipelineLayout vk_pipeline_layout
VkPipeline ensure_and_get_compute_pipeline()
void transform_feedback_disable() override
void uniform_int(int location, int comp_len, int array_size, const int *data) override
VKShader(const char *name)
VKShaderModule vertex_module
void vertex_shader_from_glsl(MutableSpan< const char * > sources) override
VKShaderModule geometry_module
VkPipeline ensure_and_get_graphics_pipeline(GPUPrimType primitive, VKVertexAttributeObject &vao, VKStateManager &state_manager, VKFrameBuffer &framebuffer)
std::string geometry_layout_declare(const shader::ShaderCreateInfo &info) const override
void uniform_float(int location, int comp_len, int array_size, const float *data) override
const VKShaderInterface & interface_get() const
bool transform_feedback_enable(VertBuf *) override
void fragment_shader_from_glsl(MutableSpan< const char * > sources) override
bool finalize(const shader::ShaderCreateInfo *info=nullptr) override
std::string vertex_interface_declare(const shader::ShaderCreateInfo &info) const override
Vector< VkVertexInputAttributeDescription > attributes
Vector< VkVertexInputBindingDescription > bindings
additional_info("compositor_sum_float_shared") .push_constant(Type additional_info("compositor_sum_float_shared") .push_constant(Type GPU_RGBA32F
DOF_TILES_FLATTEN_GROUP_SIZE coc_tx GPU_R11F_G11F_B10F
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
out_radiance out_gbuf_normal out_gbuf_closure2 GPU_RG16
SHADOW_TILEMAP_RES tiles_buf[] statistics_buf render_view_buf[SHADOW_VIEW_MAX] GPU_R32UI
RAYTRACE_GROUP_SIZE additional_info("eevee_shared", "eevee_gbuffer_data", "eevee_global_ubo", "eevee_sampling_data", "eevee_utility_texture", "eevee_hiz_data", "draw_view") .specialization_constant(Type RAYTRACE_GROUP_SIZE in_sh_0_tx in_sh_2_tx screen_normal_tx GPU_RGBA8
#define SOURCES_INDEX_VERSION
void MEM_freeN(void *vmemh)
ccl_device_inline float2 interp(const float2 a, const float2 b, float t)
void object_label(GLenum type, GLuint object, const char *name)
BLI_INLINE int to_component_count(const Type &type)
static void print_image_type(std::ostream &os, const ImageType &type, const ShaderCreateInfo::Resource::BindType bind_type)
static std::string combine_sources(Span< const char * > sources)
const char * to_string(ShaderStage stage)
int get_location_count(const Type &type)
static StageInterfaceInfo * find_interface_by_name(const Span< StageInterfaceInfo * > ifaces, const StringRefNull name)
static void print_interface(std::ostream &os, const std::string &prefix, const StageInterfaceInfo &iface, int &location, const StringRefNull &suffix="")
static std::ostream & print_qualifier(std::ostream &os, const Qualifier &qualifiers)
static void print_resource(std::ostream &os, const ShaderCreateInfo::Resource &res)
static Type to_component_type(const Type &type)
static void print_interface_as_struct(std::ostream &os, const std::string &prefix, const StageInterfaceInfo &iface, int &location, const StringRefNull &suffix)
static std::string main_function_wrapper(std::string &pre_main, std::string &post_main)
VkPrimitiveTopology to_vk_primitive_topology(const GPUPrimType prim_type)
static void declare_emit_vertex(std::stringstream &ss)
static void print_interface_as_attributes(std::ostream &os, const std::string &prefix, const StageInterfaceInfo &iface, int &location)
static constexpr GPUSamplerState default_sampler()
Vector< shader::SpecializationConstant::Value > specialization_constants
VkShaderModule vk_shader_module
VkPipelineLayout vk_pipeline_layout
VkFormat stencil_attachment_format
VkFormat depth_attachment_format
Vector< VkFormat > color_attachment_formats
VkShaderModule vk_fragment_module
Vector< VkViewport > viewports
Vector< VkRect2D > scissors
VkShaderModule vk_vertex_module
VkShaderModule vk_geometry_module
Vector< VkVertexInputBindingDescription > bindings
Vector< VkVertexInputAttributeDescription > attributes
VkPrimitiveTopology vk_topology
PreRasterization pre_rasterization
GPUStateMutable mutable_state
VkPipelineLayout vk_pipeline_layout
FragmentShader fragment_shader
Vector< shader::SpecializationConstant::Value > specialization_constants
uint32_t size_in_bytes() const
VKDescriptorSet::Location descriptor_set_location_get() const
StorageType storage_type_get() const
bool shader_output_viewport_index
bool fragment_shader_barycentric
PrimitiveOut primitive_out
Describe inputs & outputs, stage interfaces, resources and sources of a shader. If all data is correc...
Vector< StageInterfaceInfo * > vertex_out_interfaces_
StringRefNull compute_source_
Vector< SubpassIn > subpass_inputs_
Vector< Resource > geometry_resources_
Self & geometry_layout(PrimitiveIn prim_in, PrimitiveOut prim_out, int max_vertices, int invocations=-1)
Vector< VertIn > vertex_inputs_
bool early_fragment_test_
Vector< Resource > batch_resources_
StringRefNull geometry_source_
Vector< StageInterfaceInfo * > geometry_out_interfaces_
Vector< Resource > pass_resources_
GeometryStageLayout geometry_layout_
StringRefNull fragment_source_
bool do_static_compilation_
ComputeStageLayout compute_layout_
std::string compute_source_generated
Vector< SpecializationConstant > specialization_constants_
Vector< PushConst > push_constants_
Vector< FragOut > fragment_outputs_
StringRefNull instance_name
#define NOT_YET_IMPLEMENTED
#define VK_ALLOCATION_CALLBACKS