2 * Mesa 3-D graphics library
4 * Copyright (C) 2015 LunarG, Inc.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
25 * Chia-I Wu <olv@lunarg.com>
28 #ifndef ILO_STATE_SURFACE_H
29 #define ILO_STATE_SURFACE_H
31 #include "genhw/genhw.h"
32 #include "intel_winsys.h"
40 enum ilo_state_surface_access
{
41 ILO_STATE_SURFACE_ACCESS_SAMPLER
, /* sampling engine surfaces */
42 ILO_STATE_SURFACE_ACCESS_DP_RENDER
, /* render target surfaces */
43 ILO_STATE_SURFACE_ACCESS_DP_TYPED
, /* typed surfaces */
44 ILO_STATE_SURFACE_ACCESS_DP_UNTYPED
, /* untyped surfaces */
45 ILO_STATE_SURFACE_ACCESS_DP_DATA
,
46 ILO_STATE_SURFACE_ACCESS_DP_SVB
,
49 struct ilo_state_surface_buffer_info
{
50 const struct ilo_buffer
*buf
;
52 enum ilo_state_surface_access access
;
54 enum gen_surface_format format
;
64 struct ilo_state_surface_image_info
{
65 const struct ilo_image
*img
;
67 enum ilo_state_surface_access access
;
69 enum gen_surface_format format
;
82 struct ilo_state_surface
{
85 enum gen_surface_type type
;
93 /* managed by users */
98 ilo_state_surface_init_for_null(struct ilo_state_surface
*surf
,
99 const struct ilo_dev
*dev
);
102 ilo_state_surface_init_for_buffer(struct ilo_state_surface
*surf
,
103 const struct ilo_dev
*dev
,
104 const struct ilo_state_surface_buffer_info
*info
);
107 ilo_state_surface_init_for_image(struct ilo_state_surface
*surf
,
108 const struct ilo_dev
*dev
,
109 const struct ilo_state_surface_image_info
*info
);
112 ilo_state_surface_set_scs(struct ilo_state_surface
*surf
,
113 const struct ilo_dev
*dev
,
114 enum gen_surface_scs rgba
[4]);
116 #endif /* ILO_STATE_SURFACE_H */