• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright © 2016 Red Hat.
3  * Copyright © 2016 Bas Nieuwenhuizen
4  *
5  * based in part on anv driver which is:
6  * Copyright © 2015 Intel Corporation
7  *
8  * SPDX-License-Identifier: MIT
9  */
10 
11 #ifndef RADV_PIPELINE_COMPUTE_H
12 #define RADV_PIPELINE_COMPUTE_H
13 
14 #include "radv_pipeline.h"
15 
16 struct radv_physical_device;
17 struct radv_shader_binary;
18 struct radv_shader_info;
19 
20 struct radv_compute_pipeline {
21    struct radv_pipeline base;
22 };
23 
24 RADV_DECL_PIPELINE_DOWNCAST(compute, RADV_PIPELINE_COMPUTE)
25 
26 struct radv_compute_pipeline_metadata {
27    uint32_t wave32;
28    uint32_t grid_base_sgpr;
29    uint32_t push_const_sgpr;
30    uint64_t inline_push_const_mask;
31    uint32_t indirect_desc_sets_sgpr;
32 };
33 
34 uint32_t radv_get_compute_resource_limits(const struct radv_physical_device *pdev, const struct radv_shader_info *info);
35 
36 void radv_get_compute_shader_metadata(const struct radv_device *device, const struct radv_shader *cs,
37                                       struct radv_compute_pipeline_metadata *metadata);
38 
39 void radv_compute_pipeline_init(struct radv_compute_pipeline *pipeline, const struct radv_pipeline_layout *layout,
40                                 struct radv_shader *shader);
41 
42 struct radv_shader *radv_compile_cs(struct radv_device *device, struct vk_pipeline_cache *cache,
43                                     struct radv_shader_stage *cs_stage, bool keep_executable_info,
44                                     bool keep_statistic_info, bool is_internal, bool skip_shaders_cache,
45                                     struct radv_shader_binary **cs_binary);
46 
47 VkResult radv_compute_pipeline_create(VkDevice _device, VkPipelineCache _cache,
48                                       const VkComputePipelineCreateInfo *pCreateInfo,
49                                       const VkAllocationCallbacks *pAllocator, VkPipeline *pPipeline);
50 
51 void radv_destroy_compute_pipeline(struct radv_device *device, struct radv_compute_pipeline *pipeline);
52 
53 void radv_compute_pipeline_hash(const struct radv_device *device, const VkComputePipelineCreateInfo *pCreateInfo,
54                                 unsigned char *hash);
55 
56 #endif /* RADV_PIPELINE_COMPUTE_H */
57