xref: /aosp_15_r20/external/mesa3d/src/gallium/drivers/svga/svga_image_view.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright (c) 2022-2024 Broadcom. All Rights Reserved.
3  * The term “Broadcom” refers to Broadcom Inc.
4  * and/or its subsidiaries.
5  * SPDX-License-Identifier: MIT
6  */
7 
8 #ifndef SVGA_IMAGE_VIEW_H
9 #define SVGA_IMAGE_VIEW_H
10 
11 struct svga_image_view {
12    struct pipe_image_view desc;
13    struct pipe_resource *resource;
14    unsigned uav_index;
15 };
16 
17 void
18 svga_init_shader_image_functions(struct svga_context *svga);
19 
20 void
21 svga_cleanup_shader_image_state(struct svga_context *svga);
22 
23 SVGA3dUAViewId
24 svga_create_uav(struct svga_context *svga,
25                 SVGA3dUAViewDesc *desc,
26                 SVGA3dSurfaceFormat svga_format,
27                 unsigned resourceDim,
28                 struct svga_winsys_surface *surf);
29 
30 void
31 svga_destroy_uav(struct svga_context *svga);
32 
33 enum pipe_error
34 svga_rebind_uav(struct svga_context *svga);
35 
36 enum pipe_error
37 svga_validate_image_view_resources(struct svga_context *svga, unsigned count,
38                                    struct svga_image_view *images,
39                                    bool rebind);
40 
41 SVGA3dUAViewId
42 svga_create_uav_image(struct svga_context *svga,
43                       const struct pipe_image_view *image);
44 
45 void
46 svga_uav_cache_purge_image_views(struct svga_context *svga);
47 
48 #endif /* SVGA_IMAGE_VIEW_H */
49