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:
92 case TextureFormat::UINT_8_8_8_8:
94 case TextureFormat::SINT_8_8_8_8:
96 case TextureFormat::UNORM_8_8_8_8:
98 case TextureFormat::UINT_32_32_32_32:
100 case TextureFormat::SINT_32_32_32_32:
102 case TextureFormat::SFLOAT_32_32_32_32:
104 case TextureFormat::UINT_16_16_16_16:
106 case TextureFormat::SINT_16_16_16_16:
108 case TextureFormat::SFLOAT_16_16_16_16:
110 case TextureFormat::UNORM_16_16_16_16:
112 case TextureFormat::UINT_8_8:
114 case TextureFormat::SINT_8_8:
116 case TextureFormat::UNORM_8_8:
118 case TextureFormat::UINT_32_32:
120 case TextureFormat::SINT_32_32:
122 case TextureFormat::SFLOAT_32_32:
124 case TextureFormat::UINT_16_16:
126 case TextureFormat::SINT_16_16:
128 case TextureFormat::SFLOAT_16_16:
130 case TextureFormat::UNORM_16_16:
132 case TextureFormat::UINT_8:
134 case TextureFormat::SINT_8:
136 case TextureFormat::UNORM_8:
138 case TextureFormat::UINT_32:
140 case TextureFormat::SINT_32:
142 case TextureFormat::SFLOAT_32:
144 case TextureFormat::UINT_16:
146 case TextureFormat::SINT_16:
148 case TextureFormat::SFLOAT_16:
150 case TextureFormat::UNORM_16:
152 case TextureFormat::UFLOAT_11_11_10:
153 return "r11f_g11f_b10f";
154 case TextureFormat::UNORM_10_10_10_2:
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 return fmt::to_string(fmt::join(sources,
""));
499 vk_interface->
init(info);
500 interface = vk_interface;
503 use_batch_compilation_ = is_batch_compilation;
517 vk_descriptor_set_layout_ = VK_NULL_HANDLE;
521 shaderc_shader_kind stage,
526 std::string source_patch;
529 case shaderc_vertex_shader:
532 case shaderc_geometry_shader:
535 case shaderc_fragment_shader:
538 case shaderc_compute_shader:
542 BLI_assert_msg(0,
"Only forced ShaderC shader kinds are supported.");
548 if (!use_batch_compilation_) {
556 build_shader_module(sources, shaderc_vertex_shader,
vertex_module);
561 build_shader_module(sources, shaderc_geometry_shader,
geometry_module);
566 build_shader_module(sources, shaderc_fragment_shader,
fragment_module);
571 build_shader_module(sources, shaderc_compute_shader,
compute_module);
581 if (!use_batch_compilation_) {
589 if (info ==
nullptr) {
593 if (do_geometry_shader_injection(info)) {
594 std::string source = workaround_geometry_shader_source_create(*info);
596 sources.
append(
"version");
603 if (!finalize_descriptor_set_layouts(device, vk_interface)) {
606 if (!finalize_pipeline_layout(device, vk_interface)) {
611 if (use_batch_compilation_) {
633 if (
result && is_compute_shader_) {
641bool VKShader::finalize_shader_module(
VKShaderModule &shader_module,
const char *stage_name)
645 shaderc_compilation_status_null_result_object,
646 shaderc_compilation_status_success);
657 std::string full_name = std::string(
name) +
"_" + stage_name;
658 shader_module.
finalize(full_name.c_str());
663 return compilation_succeeded;
671bool VKShader::finalize_pipeline_layout(
VKDevice &device,
674 const uint32_t layout_count = vk_descriptor_set_layout_ == VK_NULL_HANDLE ? 0 : 1;
675 VkPipelineLayoutCreateInfo pipeline_info = {};
676 VkPushConstantRange push_constant_range = {};
677 pipeline_info.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
678 pipeline_info.flags = 0;
679 pipeline_info.setLayoutCount = layout_count;
680 pipeline_info.pSetLayouts = &vk_descriptor_set_layout_;
686 push_constant_range.offset = 0;
687 push_constant_range.size = push_constants_layout.
size_in_bytes();
688 push_constant_range.stageFlags = is_compute_shader_ ? VK_SHADER_STAGE_COMPUTE_BIT :
689 VK_SHADER_STAGE_ALL_GRAPHICS;
690 pipeline_info.pushConstantRangeCount = 1;
691 pipeline_info.pPushConstantRanges = &push_constant_range;
705bool VKShader::finalize_descriptor_set_layouts(
VKDevice &vk_device,
717 BLI_assert(vk_descriptor_set_layout_ == VK_NULL_HANDLE);
720 return vk_descriptor_set_layout_ != VK_NULL_HANDLE;
748 std::stringstream ss;
750 ss <<
"\n/* Specialization Constants (pass-through). */\n";
751 uint constant_id = 0;
753 ss <<
"layout (constant_id=" << constant_id++ <<
") const ";
756 ss <<
"int " << sc.
name <<
"=" << std::to_string(sc.
value.
i) <<
";\n";
759 ss <<
"uint " << sc.
name <<
"=" << std::to_string(sc.
value.
u) <<
"u;\n";
762 ss <<
"bool " << sc.
name <<
"=" << (sc.
value.
u ?
"true" :
"false") <<
";\n";
767 ss <<
"uint " << sc.
name <<
"_uint=" << std::to_string(sc.
value.
u) <<
"u;\n";
768 ss <<
"#define " << sc.
name <<
" uintBitsToFloat(" << sc.
name <<
"_uint)\n";
776 ss <<
"\n/* Compilation Constants (pass-through). */\n";
781 ss <<
"int " << sc.
name <<
"=" << std::to_string(sc.
value.
i) <<
";\n";
784 ss <<
"uint " << sc.
name <<
"=" << std::to_string(sc.
value.
u) <<
"u;\n";
787 ss <<
"bool " << sc.
name <<
"=" << (sc.
value.
u ?
"true" :
"false") <<
";\n";
795 ss <<
"\n/* Shared Variables. */\n";
800 ss <<
"\n/* Pass Resources. */\n";
805 ss <<
"\n/* Batch Resources. */\n";
810 ss <<
"\n/* Geometry Resources. */\n";
820 ss <<
"\n/* Push Constants. */\n";
822 ss <<
"layout(push_constant, std430) uniform constants\n";
826 <<
", std140) uniform constants\n";
836 ss <<
"} PushConstants;\n";
838 ss <<
"#define " << uniform.
name <<
" (PushConstants.pc_" << uniform.
name <<
")\n";
848 std::stringstream ss;
849 std::string post_main;
851 ss <<
"\n/* Inputs. */\n";
853 ss <<
"layout(location = " << attr.
index <<
") ";
856 ss <<
"\n/* Interfaces. */\n";
862 const bool has_geometry_stage = do_geometry_shader_injection(&info) ||
866 if (has_geometry_stage) {
867 if (do_layer_output) {
868 ss <<
"layout(location=" << (location++) <<
") out int gpu_Layer;\n ";
870 if (do_viewport_output) {
871 ss <<
"layout(location=" << (location++) <<
") out int gpu_ViewportIndex;\n";
875 if (do_layer_output) {
876 ss <<
"#define gpu_Layer gl_Layer\n";
878 if (do_viewport_output) {
879 ss <<
"#define gpu_ViewportIndex gl_ViewportIndex\n";
886 const bool retarget_depth = !has_geometry_stage;
887 if (retarget_depth) {
888 post_main +=
"gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5;\n";
891 if (post_main.empty() ==
false) {
892 std::string pre_main;
947 std::stringstream ss;
948 std::string pre_main;
951 ss <<
"\n/* Interfaces. */\n";
960 ss <<
"#define gpu_Layer gl_Layer\n";
963 ss <<
"#define gpu_ViewportIndex gl_ViewportIndex\n";
969 ss <<
"layout(location=" << (location++) <<
") smooth in vec3 gpu_BaryCoord;\n";
970 ss <<
"layout(location=" << (location++) <<
") noperspective in vec3 gpu_BaryCoordNoPersp;\n";
974 ss <<
"layout(early_fragment_tests) in;\n";
978 if (use_gl_frag_depth) {
982 ss <<
"\n/* Sub-pass Inputs. */\n";
986 if (use_local_read) {
987 uint32_t subpass_input_binding_index = 0;
989 std::string input_attachment_name =
"gpu_input_attachment_";
990 input_attachment_name += std::to_string(
input.index);
997 switch (component_type) {
1008 ss <<
"layout(input_attachment_index = " << (
input.index)
1009 <<
", binding = " << (subpass_input_binding_index++) <<
") uniform " << typePrefix
1010 <<
"subpassInput " << input_attachment_name <<
"; \n";
1012 std::stringstream ss_pre;
1013 static const std::string swizzle =
"xyzw";
1015 ss_pre <<
" " <<
input.name <<
" = " <<
input.type <<
"( subpassLoad("
1019 pre_main += ss_pre.str();
1024 std::string image_name =
"gpu_subpass_img_";
1025 image_name += std::to_string(
input.index);
1033 bool is_layered_input =
ELEM(
1034 input.img_type, ImageType::Uint2DArray, ImageType::Int2DArray, ImageType::Float2DArray);
1039 Resource res(Resource::BindType::SAMPLER,
input.index);
1040 res.sampler.type =
input.img_type;
1042 res.sampler.name = image_name;
1045 char swizzle[] =
"xyzw";
1048 std::string texel_co = (is_layered_input) ?
1049 ((is_layered_fb) ?
"ivec3(gl_FragCoord.xy, gpu_Layer)" :
1053 "ivec3(gl_FragCoord.xy, 0)") :
1054 "ivec2(gl_FragCoord.xy)";
1056 std::stringstream ss_pre;
1058 ss_pre <<
" " <<
input.name <<
" = texelFetch(" << image_name <<
", " << texel_co <<
", 0)."
1059 << swizzle <<
";\n";
1061 pre_main += ss_pre.str();
1065 ss <<
"\n/* Outputs. */\n";
1067 const int location = output.index;
1068 ss <<
"layout(location = " << location;
1069 switch (output.blend) {
1070 case DualBlend::SRC_0:
1071 ss <<
", index = 0";
1073 case DualBlend::SRC_1:
1074 ss <<
", index = 1";
1084 if (pre_main.empty() ==
false) {
1085 std::string post_main;
1086 ss << main_function_wrapper(pre_main, post_main);
1096 std::stringstream ss;
1097 ss <<
"\n/* Geometry Layout. */\n";
1099 if (invocations != -1) {
1100 ss <<
", invocations = " << invocations;
1105 <<
", max_vertices = " << max_verts <<
") out;\n";
1114 if (iface->instance_name ==
name) {
1123 ss <<
"void gpu_EmitVertex() {\n";
1124 ss <<
" gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5;\n";
1125 ss <<
" EmitVertex();\n";
1131 std::stringstream ss;
1133 ss <<
"\n/* Interfaces. */\n";
1138 const char *suffix = (has_matching_output_iface) ?
"_in[]" :
"[]";
1147 const char *suffix = (has_matching_input_iface) ?
"_out" :
"";
1159 std::stringstream ss;
1160 ss <<
"\n/* Compute Layout. */\n";
1175std::string VKShader::workaround_geometry_shader_source_create(
1178 std::stringstream ss;
1194 ss << geometry_layout_declare(info_modified);
1195 ss << geometry_interface_declare(info_modified);
1203 int location_in = location;
1204 int location_out = location;
1205 if (do_layer_output) {
1206 ss <<
"layout(location=" << (location_in++) <<
") in int gpu_Layer[];\n";
1208 if (do_viewport_output) {
1209 ss <<
"layout(location=" << (location_in++) <<
") in int gpu_ViewportIndex[];\n";
1211 if (do_barycentric_workaround) {
1212 ss <<
"layout(location=" << (location_out++) <<
") smooth out vec3 gpu_BaryCoord;\n";
1213 ss <<
"layout(location=" << (location_out++)
1214 <<
") noperspective out vec3 gpu_BaryCoordNoPersp;\n";
1218 ss <<
"void main()\n";
1227 if (do_barycentric_workaround) {
1228 ss <<
" gpu_BaryCoordNoPersp = gpu_BaryCoord =";
1229 ss <<
" vec3(" << int(
i == 0) <<
", " << int(
i == 1) <<
", " << int(
i == 2) <<
");\n";
1231 ss <<
" gl_Position = gl_in[" <<
i <<
"].gl_Position;\n";
1232 if (do_layer_output) {
1233 ss <<
" gl_Layer = gpu_Layer[" <<
i <<
"];\n";
1235 if (do_viewport_output) {
1236 ss <<
" gl_ViewportIndex = gpu_ViewportIndex[" <<
i <<
"];\n";
1238 ss <<
" gpu_EmitVertex();\n";
1244bool VKShader::do_geometry_shader_injection(
const shader::ShaderCreateInfo *info)
const
1246 const VKExtensions &extensions = VKBackend::get().device.extensions_get();
1271 if (constants_state.
values.is_empty() && vk_pipeline_base_ != VK_NULL_HANDLE) {
1272 return vk_pipeline_base_;
1283 compute_info, is_static_shader_, vk_pipeline_base_);
1284 if (vk_pipeline_base_ == VK_NULL_HANDLE) {
1286 vk_pipeline_base_ = vk_pipeline;
1300 "GPU_PRIM_POINTS is used with a shader that doesn't set point size before "
1301 "drawing fragments. Calling code should be adapted to use a shader that sets the "
1302 "gl_PointSize before entering the fragment stage. For example `GPU_SHADER_3D_POINT_*`.");
1334 graphics_info, is_static_shader_, vk_pipeline_base_);
1335 if (vk_pipeline_base_ == VK_NULL_HANDLE) {
1337 vk_pipeline_base_ = vk_pipeline;
1345 "Interface can be accessed after the VKShader has been initialized "
1346 "`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
std::string glsl_fragment_patch_get() const
std::string glsl_vertex_patch_get() const
std::string glsl_geometry_patch_get() const
std::string glsl_compute_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
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
void init(const shader::ShaderCreateInfo &info, bool is_batch_compilation) override
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 interface_get(create_info, _res)
#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
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_
Vector< SharedVariable, 0 > shared_variables_
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