27#include <fmt/format.h>
40 case Interpolation::SMOOTH:
42 case Interpolation::FLAT:
44 case Interpolation::NO_PERSPECTIVE:
45 return "noperspective";
62 case Type::float3x3_t:
64 case Type::float4x4_t:
153 return "r11f_g11f_b10f";
169 return "lines_adjacency";
173 return "triangles_adjacency";
182 case PrimitiveOut::POINTS:
184 case PrimitiveOut::LINE_STRIP:
186 case PrimitiveOut::TRIANGLE_STRIP:
187 return "triangle_strip";
199 return "depth_greater";
203 return "depth_unchanged";
212 case ImageType::IntBuffer:
213 case ImageType::Int1D:
214 case ImageType::Int1DArray:
215 case ImageType::Int2D:
216 case ImageType::Int2DArray:
217 case ImageType::Int3D:
218 case ImageType::IntCube:
219 case ImageType::IntCubeArray:
220 case ImageType::AtomicInt2D:
221 case ImageType::AtomicInt2DArray:
222 case ImageType::AtomicInt3D:
225 case ImageType::UintBuffer:
226 case ImageType::Uint1D:
227 case ImageType::Uint1DArray:
228 case ImageType::Uint2D:
229 case ImageType::Uint2DArray:
230 case ImageType::Uint3D:
231 case ImageType::UintCube:
232 case ImageType::UintCubeArray:
233 case ImageType::AtomicUint2D:
234 case ImageType::AtomicUint2DArray:
235 case ImageType::AtomicUint3D:
250 case ImageType::FloatBuffer:
251 case ImageType::IntBuffer:
252 case ImageType::UintBuffer:
255 case ImageType::Float1D:
256 case ImageType::Float1DArray:
257 case ImageType::Int1D:
258 case ImageType::Int1DArray:
259 case ImageType::Uint1D:
260 case ImageType::Uint1DArray:
263 case ImageType::Float2D:
264 case ImageType::Float2DArray:
265 case ImageType::Int2D:
266 case ImageType::Int2DArray:
267 case ImageType::Uint2D:
268 case ImageType::Uint2DArray:
269 case ImageType::Shadow2D:
270 case ImageType::Shadow2DArray:
271 case ImageType::Depth2D:
272 case ImageType::Depth2DArray:
273 case ImageType::AtomicInt2D:
274 case ImageType::AtomicInt2DArray:
275 case ImageType::AtomicUint2D:
276 case ImageType::AtomicUint2DArray:
279 case ImageType::Float3D:
280 case ImageType::Int3D:
281 case ImageType::AtomicInt3D:
282 case ImageType::Uint3D:
283 case ImageType::AtomicUint3D:
286 case ImageType::FloatCube:
287 case ImageType::FloatCubeArray:
288 case ImageType::IntCube:
289 case ImageType::IntCubeArray:
290 case ImageType::UintCube:
291 case ImageType::UintCubeArray:
292 case ImageType::ShadowCube:
293 case ImageType::ShadowCubeArray:
294 case ImageType::DepthCube:
295 case ImageType::DepthCubeArray:
303 case ImageType::Float1DArray:
304 case ImageType::Float2DArray:
305 case ImageType::FloatCubeArray:
306 case ImageType::Int1DArray:
307 case ImageType::Int2DArray:
308 case ImageType::IntCubeArray:
309 case ImageType::Uint1DArray:
310 case ImageType::Uint2DArray:
311 case ImageType::UintCubeArray:
312 case ImageType::Shadow2DArray:
313 case ImageType::ShadowCubeArray:
314 case ImageType::Depth2DArray:
315 case ImageType::DepthCubeArray:
316 case ImageType::AtomicUint2DArray:
324 case ImageType::Shadow2D:
325 case ImageType::Shadow2DArray:
326 case ImageType::ShadowCube:
327 case ImageType::ShadowCubeArray:
354 os <<
"layout(binding = " << uint32_t(location);
382 array_offset = res.
uniformbuf.name.find_first_of(
"[");
383 name_no_array = (array_offset == -1) ? res.
uniformbuf.name :
385 os <<
"uniform _" << name_no_array <<
" { " << res.
uniformbuf.type_name <<
" "
389 array_offset = res.
storagebuf.name.find_first_of(
"[");
390 name_no_array = (array_offset == -1) ? res.
storagebuf.name :
420 const std::string &prefix,
425 os <<
"layout(location=" << location <<
") " << prefix <<
" " <<
to_string(
inout.interp) <<
" "
432 const std::string &prefix,
437 std::string struct_name = prefix + iface.
name;
440 os <<
"struct " << struct_name <<
" {\n";
445 os <<
"layout(location=" << location <<
") " << prefix <<
" " <<
to_string(qualifier) <<
" "
446 << struct_name <<
" " << iface.
instance_name << suffix <<
";\n";
454 const std::string &prefix,
470 std::stringstream ss;
473 ss <<
"void main_function_();\n";
475 ss <<
"void main() {\n";
477 ss <<
" main_function_();\n";
481 ss <<
"#define main main_function_\n";
488 std::string
result = fmt::to_string(fmt::join(sources,
""));
496 size_t start_pos = 0;
497 while ((start_pos =
result.find(
"#line ", start_pos)) != std::string::npos) {
499 result[start_pos + 1] =
'/';
513 vk_interface->
init(info);
514 interface = vk_interface;
517 use_batch_compilation_ = is_batch_compilation;
531 vk_descriptor_set_layout_ = VK_NULL_HANDLE;
535 shaderc_shader_kind stage,
540 const char *source_patch =
nullptr;
543 case shaderc_vertex_shader:
546 case shaderc_geometry_shader:
549 case shaderc_fragment_shader:
552 case shaderc_compute_shader:
556 BLI_assert_msg(0,
"Only forced ShaderC shader kinds are supported.");
562 if (!use_batch_compilation_) {
570 build_shader_module(sources, shaderc_vertex_shader,
vertex_module);
575 build_shader_module(sources, shaderc_geometry_shader,
geometry_module);
580 build_shader_module(sources, shaderc_fragment_shader,
fragment_module);
585 build_shader_module(sources, shaderc_compute_shader,
compute_module);
595 if (!use_batch_compilation_) {
603 if (info ==
nullptr) {
607 if (do_geometry_shader_injection(info)) {
608 std::string source = workaround_geometry_shader_source_create(*info);
610 sources.
append(
"version");
617 if (!finalize_descriptor_set_layouts(device, vk_interface)) {
620 if (!finalize_pipeline_layout(device, vk_interface)) {
625 if (use_batch_compilation_) {
647 if (
result && is_compute_shader_) {
655bool VKShader::finalize_shader_module(
VKShaderModule &shader_module,
const char *stage_name)
659 shaderc_compilation_status_null_result_object,
660 shaderc_compilation_status_success);
671 std::string full_name = std::string(
name) +
"_" + stage_name;
672 shader_module.
finalize(full_name.c_str());
677 return compilation_succeeded;
685bool VKShader::finalize_pipeline_layout(
VKDevice &device,
688 const uint32_t layout_count = vk_descriptor_set_layout_ == VK_NULL_HANDLE ? 0 : 1;
689 VkPipelineLayoutCreateInfo pipeline_info = {};
690 VkPushConstantRange push_constant_range = {};
691 pipeline_info.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
692 pipeline_info.flags = 0;
693 pipeline_info.setLayoutCount = layout_count;
694 pipeline_info.pSetLayouts = &vk_descriptor_set_layout_;
700 push_constant_range.offset = 0;
701 push_constant_range.size = push_constants_layout.
size_in_bytes();
702 push_constant_range.stageFlags = is_compute_shader_ ? VK_SHADER_STAGE_COMPUTE_BIT :
703 VK_SHADER_STAGE_ALL_GRAPHICS;
704 pipeline_info.pushConstantRangeCount = 1;
705 pipeline_info.pPushConstantRanges = &push_constant_range;
719bool VKShader::finalize_descriptor_set_layouts(
VKDevice &vk_device,
731 BLI_assert(vk_descriptor_set_layout_ == VK_NULL_HANDLE);
734 return vk_descriptor_set_layout_ != VK_NULL_HANDLE;
762 std::stringstream ss;
764 ss <<
"\n/* Specialization Constants (pass-through). */\n";
765 uint constant_id = 0;
767 ss <<
"layout (constant_id=" << constant_id++ <<
") const ";
770 ss <<
"int " << sc.
name <<
"=" << std::to_string(sc.
value.
i) <<
";\n";
773 ss <<
"uint " << sc.
name <<
"=" << std::to_string(sc.
value.
u) <<
"u;\n";
776 ss <<
"bool " << sc.
name <<
"=" << (sc.
value.
u ?
"true" :
"false") <<
";\n";
781 ss <<
"uint " << sc.
name <<
"_uint=" << std::to_string(sc.
value.
u) <<
"u;\n";
782 ss <<
"#define " << sc.
name <<
" uintBitsToFloat(" << sc.
name <<
"_uint)\n";
790 ss <<
"\n/* Compilation Constants (pass-through). */\n";
795 ss <<
"int " << sc.
name <<
"=" << std::to_string(sc.
value.
i) <<
";\n";
798 ss <<
"uint " << sc.
name <<
"=" << std::to_string(sc.
value.
u) <<
"u;\n";
801 ss <<
"bool " << sc.
name <<
"=" << (sc.
value.
u ?
"true" :
"false") <<
";\n";
809 ss <<
"\n/* Pass Resources. */\n";
814 ss <<
"\n/* Batch Resources. */\n";
819 ss <<
"\n/* Geometry Resources. */\n";
829 ss <<
"\n/* Push Constants. */\n";
831 ss <<
"layout(push_constant, std430) uniform constants\n";
835 <<
", std140) uniform constants\n";
845 ss <<
"} PushConstants;\n";
847 ss <<
"#define " << uniform.
name <<
" (PushConstants.pc_" << uniform.
name <<
")\n";
857 std::stringstream ss;
858 std::string post_main;
860 ss <<
"\n/* Inputs. */\n";
862 ss <<
"layout(location = " << attr.
index <<
") ";
865 ss <<
"\n/* Interfaces. */\n";
871 const bool has_geometry_stage = do_geometry_shader_injection(&info) ||
875 if (has_geometry_stage) {
876 if (do_layer_output) {
877 ss <<
"layout(location=" << (location++) <<
") out int gpu_Layer;\n ";
879 if (do_viewport_output) {
880 ss <<
"layout(location=" << (location++) <<
") out int gpu_ViewportIndex;\n";
884 if (do_layer_output) {
885 ss <<
"#define gpu_Layer gl_Layer\n";
887 if (do_viewport_output) {
888 ss <<
"#define gpu_ViewportIndex gl_ViewportIndex\n";
895 const bool retarget_depth = !has_geometry_stage;
896 if (retarget_depth) {
897 post_main +=
"gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5;\n";
900 if (post_main.empty() ==
false) {
901 std::string pre_main;
956 std::stringstream ss;
957 std::string pre_main;
960 ss <<
"\n/* Interfaces. */\n";
969 ss <<
"#define gpu_Layer gl_Layer\n";
972 ss <<
"#define gpu_ViewportIndex gl_ViewportIndex\n";
978 ss <<
"layout(location=" << (location++) <<
") smooth in vec3 gpu_BaryCoord;\n";
979 ss <<
"layout(location=" << (location++) <<
") noperspective in vec3 gpu_BaryCoordNoPersp;\n";
983 ss <<
"layout(early_fragment_tests) in;\n";
987 if (use_gl_frag_depth) {
991 ss <<
"\n/* Sub-pass Inputs. */\n";
996 if (use_local_read) {
997 uint32_t subpass_input_binding_index = 0;
999 std::string input_attachment_name =
"gpu_input_attachment_";
1000 input_attachment_name += std::to_string(
input.index);
1007 switch (component_type) {
1018 ss <<
"layout(input_attachment_index = " << (
input.index)
1019 <<
", binding = " << (subpass_input_binding_index++) <<
") uniform " << typePrefix
1020 <<
"subpassInput " << input_attachment_name <<
"; \n";
1022 std::stringstream ss_pre;
1023 static const std::string swizzle =
"xyzw";
1025 ss_pre <<
" " <<
input.name <<
" = " <<
input.type <<
"( subpassLoad("
1029 pre_main += ss_pre.str();
1032 else if (use_dynamic_rendering) {
1034 std::string image_name =
"gpu_subpass_img_";
1035 image_name += std::to_string(
input.index);
1043 bool is_layered_input =
ELEM(
1044 input.img_type, ImageType::Uint2DArray, ImageType::Int2DArray, ImageType::Float2DArray);
1049 Resource res(Resource::BindType::SAMPLER,
input.index);
1050 res.sampler.type =
input.img_type;
1052 res.sampler.name = image_name;
1055 char swizzle[] =
"xyzw";
1058 std::string texel_co = (is_layered_input) ?
1059 ((is_layered_fb) ?
"ivec3(gl_FragCoord.xy, gpu_Layer)" :
1063 "ivec3(gl_FragCoord.xy, 0)") :
1064 "ivec2(gl_FragCoord.xy)";
1066 std::stringstream ss_pre;
1068 ss_pre <<
" " <<
input.name <<
" = texelFetch(" << image_name <<
", " << texel_co <<
", 0)."
1069 << swizzle <<
";\n";
1071 pre_main += ss_pre.str();
1078 Resource res(Resource::BindType::SAMPLER,
input.index);
1081 std::string image_name =
"gpu_subpass_img_" + std::to_string(
input.index);
1086 ss <<
"layout(input_attachment_index=" <<
input.index <<
", set=0, binding=" << location
1090 ss <<
"isubpassInput";
1093 ss <<
"usubpassInput";
1097 ss <<
"subpassInput";
1100 ss <<
" " << image_name <<
";";
1103 char swizzle[] =
"xyzw";
1105 std::stringstream ss_pre;
1106 ss_pre <<
" " <<
input.name <<
" = subpassLoad(" << image_name <<
")." << swizzle <<
";\n";
1107 pre_main += ss_pre.str();
1111 ss <<
"\n/* Outputs. */\n";
1112 int fragment_out_location = 0;
1119 const bool use_dual_blending = output.blend != DualBlend::NONE;
1120 BLI_assert_msg(!(use_dual_blending && !info.subpass_inputs_.is_empty()),
1121 "Dual source blending are not supported with subpass inputs when using render "
1122 "passes. It can be supported, but wasn't for code readability.");
1123 const int location = (use_dynamic_rendering || use_dual_blending) ? output.index :
1124 fragment_out_location++;
1125 ss <<
"layout(location = " << location;
1126 switch (output.blend) {
1127 case DualBlend::SRC_0:
1128 ss <<
", index = 0";
1130 case DualBlend::SRC_1:
1131 ss <<
", index = 1";
1141 if (pre_main.empty() ==
false) {
1142 std::string post_main;
1143 ss << main_function_wrapper(pre_main, post_main);
1153 std::stringstream ss;
1154 ss <<
"\n/* Geometry Layout. */\n";
1156 if (invocations != -1) {
1157 ss <<
", invocations = " << invocations;
1162 <<
", max_vertices = " << max_verts <<
") out;\n";
1171 if (iface->instance_name == name) {
1180 ss <<
"void gpu_EmitVertex() {\n";
1181 ss <<
" gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5;\n";
1182 ss <<
" EmitVertex();\n";
1188 std::stringstream ss;
1190 ss <<
"\n/* Interfaces. */\n";
1195 const char *suffix = (has_matching_output_iface) ?
"_in[]" :
"[]";
1204 const char *suffix = (has_matching_input_iface) ?
"_out" :
"";
1216 std::stringstream ss;
1217 ss <<
"\n/* Compute Layout. */\n";
1232std::string VKShader::workaround_geometry_shader_source_create(
1235 std::stringstream ss;
1251 ss << geometry_layout_declare(info_modified);
1252 ss << geometry_interface_declare(info_modified);
1260 int location_in = location;
1261 int location_out = location;
1262 if (do_layer_output) {
1263 ss <<
"layout(location=" << (location_in++) <<
") in int gpu_Layer[];\n";
1265 if (do_viewport_output) {
1266 ss <<
"layout(location=" << (location_in++) <<
") in int gpu_ViewportIndex[];\n";
1268 if (do_barycentric_workaround) {
1269 ss <<
"layout(location=" << (location_out++) <<
") smooth out vec3 gpu_BaryCoord;\n";
1270 ss <<
"layout(location=" << (location_out++)
1271 <<
") noperspective out vec3 gpu_BaryCoordNoPersp;\n";
1275 ss <<
"void main()\n";
1284 if (do_barycentric_workaround) {
1285 ss <<
" gpu_BaryCoordNoPersp = gpu_BaryCoord =";
1286 ss <<
" vec3(" << int(
i == 0) <<
", " << int(
i == 1) <<
", " << int(
i == 2) <<
");\n";
1288 ss <<
" gl_Position = gl_in[" <<
i <<
"].gl_Position;\n";
1289 if (do_layer_output) {
1290 ss <<
" gl_Layer = gpu_Layer[" <<
i <<
"];\n";
1292 if (do_viewport_output) {
1293 ss <<
" gl_ViewportIndex = gpu_ViewportIndex[" <<
i <<
"];\n";
1295 ss <<
" gpu_EmitVertex();\n";
1301bool VKShader::do_geometry_shader_injection(
const shader::ShaderCreateInfo *info)
const
1303 const VKExtensions &extensions = VKBackend::get().device.extensions_get();
1328 if (constants_state.
values.is_empty() && vk_pipeline_base_ != VK_NULL_HANDLE) {
1329 return vk_pipeline_base_;
1340 compute_info, is_static_shader_, vk_pipeline_base_);
1341 if (vk_pipeline_base_ == VK_NULL_HANDLE) {
1343 vk_pipeline_base_ = vk_pipeline;
1357 "GPU_PRIM_POINTS is used with a shader that doesn't set point size before "
1358 "drawing fragments. Calling code should be adapted to use a shader that sets the "
1359 "gl_PointSize before entering the fragment stage. For example `GPU_SHADER_3D_POINT_*`.");
1392 graphics_info, is_static_shader_, vk_pipeline_base_);
1393 if (vk_pipeline_base_ == VK_NULL_HANDLE) {
1395 vk_pipeline_base_ = vk_pipeline;
1403 "Interface can be accessed after the VKShader has been initialized "
1404 "`VKShader::init`");
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
BMesh const char void * data
void extend(Span< T > array)
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)
std::unique_ptr< const shader::SpecializationConstants > constants
ShaderInterface * interface
StringRefNull name_get() const
void print_log(Span< StringRefNull > sources, const char *log, const char *stage, bool error, GPULogParser *parser)
GPUStateMutable mutable_state
void specialization_constants_set(const shader::SpecializationConstants *constants_state)
VkDescriptorSetLayout get_or_create(const VKDescriptorSetLayoutInfo &info, bool &r_created, bool &r_needed)
VKDescriptorSetLayouts & descriptor_set_layouts_get()
VkDevice vk_handle() const
const VKExtensions & extensions_get() const
const char * glsl_geometry_patch_get() const
const char * glsl_fragment_patch_get() const
const char * glsl_compute_patch_get() const
const char * glsl_vertex_patch_get() const
static VKDiscardPool & discard_pool_get()
void discard_pipeline_layout(VkPipelineLayout vk_pipeline_layout)
void vk_render_areas_append(Vector< VkRect2D > &r_render_areas) const
uint32_t color_attachment_size
VkFormat stencil_attachment_format_get() const
VkFormat depth_attachment_format_get() const
VkRenderPass vk_render_pass
void vk_viewports_append(Vector< VkViewport > &r_viewports) 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 discard(VKDiscardPool &discard_pool, VkPipelineLayout vk_pipeline_layout)
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
std::string combined_sources
void finalize(StringRefNull name)
Vector< uint32_t > spirv_binary
VKShaderModule compute_module
std::string fragment_interface_declare(const shader::ShaderCreateInfo &info) const override
bool compilation_finished
VkPipeline ensure_and_get_graphics_pipeline(GPUPrimType primitive, VKVertexAttributeObject &vao, VKStateManager &state_manager, VKFrameBuffer &framebuffer, shader::SpecializationConstants &constants_state)
void geometry_shader_from_glsl(MutableSpan< StringRefNull > sources) override
VkPipeline ensure_and_get_compute_pipeline(const shader::SpecializationConstants &constants_state)
VKShaderModule fragment_module
void vertex_shader_from_glsl(MutableSpan< StringRefNull > sources) override
std::string geometry_interface_declare(const shader::ShaderCreateInfo &info) const override
void warm_cache(int limit) override
VKPushConstants push_constants
void compute_shader_from_glsl(MutableSpan< StringRefNull > sources) override
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
void uniform_int(int location, int comp_len, int array_size, const int *data) override
void fragment_shader_from_glsl(MutableSpan< StringRefNull > sources) override
VKShader(const char *name)
VKShaderModule vertex_module
void bind(const shader::SpecializationConstants *constants_state) override
VKShaderModule geometry_module
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 finalize(const shader::ShaderCreateInfo *info=nullptr) override
std::string vertex_interface_declare(const shader::ShaderCreateInfo &info) const override
Vector< VkVertexInputAttributeDescription > attributes
Vector< VkVertexInputBindingDescription > bindings
static void print_interface(std::ostream &os, const StringRefNull &prefix, const StageInterfaceInfo &iface, const StringRefNull &suffix="")
static const char * to_string(const Interpolation &interp)
static StageInterfaceInfo * find_interface_by_name(const Span< StageInterfaceInfo * > ifaces, const StringRefNull &name)
#define SOURCES_INDEX_VERSION
ccl_device_inline float interp(const float a, const float b, const 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)
const char * to_string(ShaderStage stage)
int get_location_count(const Type &type)
static void print_interface(std::ostream &os, const std::string &prefix, const StageInterfaceInfo &iface, int &location, const StringRefNull &suffix="")
static std::string combine_sources(Span< StringRefNull > sources)
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
bool fragment_shader_barycentric
bool dynamic_rendering_local_read
bool shader_output_viewport_index
VkRenderPass vk_render_pass
uint32_t color_attachment_size
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
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< CompilationConstant, 0 > compilation_constants_
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_
Vector< SpecializationConstant::Value, 8 > values
StringRefNull instance_name
#define NOT_YET_IMPLEMENTED