| 1941 | } |
| 1942 | |
| 1943 | static void CreateLayout(VkDescriptorSetLayout* set_layouts, uint32_t* set_layouts_num, VkPushConstantRange* push_constant_info, |
| 1944 | uint32_t* push_constant_info_num, const ShaderBindResources& bind, VkShaderStageFlags vk_stage, |
| 1945 | DescriptorCache::Stage stage) |
| 1946 | { |
| 1947 | EXIT_IF(set_layouts == nullptr); |
| 1948 | EXIT_IF(set_layouts_num == nullptr); |
| 1949 | EXIT_IF(push_constant_info == nullptr); |
| 1950 | EXIT_IF(push_constant_info_num == nullptr); |
| 1951 | |
| 1952 | bool need_descriptor = (bind.storage_buffers.buffers_num > 0 || bind.textures2D.textures_num > 0 || bind.samplers.samplers_num > 0 || |
| 1953 | bind.gds_pointers.pointers_num > 0); |
| 1954 | |
| 1955 | EXIT_IF(need_descriptor && bind.push_constant_size == 0); |
| 1956 | |
| 1957 | if (bind.push_constant_size != 0) |
| 1958 | { |
| 1959 | auto index = *push_constant_info_num; |
| 1960 | |
| 1961 | push_constant_info[index].stageFlags = vk_stage; |
| 1962 | push_constant_info[index].offset = bind.push_constant_offset; |
| 1963 | push_constant_info[index].size = bind.push_constant_size; |
| 1964 | (*push_constant_info_num)++; |
| 1965 | } |
| 1966 | |
| 1967 | if (need_descriptor) |
| 1968 | { |
| 1969 | EXIT_IF(bind.descriptor_set_slot != *set_layouts_num); |
| 1970 | |
| 1971 | set_layouts[*set_layouts_num] = g_render_ctx->GetDescriptorCache()->GetDescriptorSetLayout(stage, bind /*, bind_params*/); |
| 1972 | (*set_layouts_num)++; |
| 1973 | } |
| 1974 | } |
| 1975 | |
| 1976 | // NOLINTNEXTLINE(readability-function-cognitive-complexity) |
| 1977 | static VulkanPipeline* CreatePipelineInternal(VkRenderPass render_pass, const ShaderVertexInputInfo* vs_input_info, |
no test coverage detected