1/* -*- c++ -*- */
2/*
3 * Copyright © 2013-2015 Intel Corporation
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
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 DEALINGS
22 * IN THE SOFTWARE.
23 */
24
25#ifndef BRW_FS_SURFACE_BUILDER_H
26#define BRW_FS_SURFACE_BUILDER_H
27
28#include "brw_fs_builder.h"
29#include "brw_context.h"
30
31namespace brw {
32   namespace surface_access {
33      fs_reg
34      emit_untyped_read(const fs_builder &bld,
35                        const fs_reg &surface, const fs_reg &addr,
36                        unsigned dims, unsigned size,
37                        brw_predicate pred = BRW_PREDICATE_NONE);
38
39      void
40      emit_untyped_write(const fs_builder &bld, const fs_reg &surface,
41                         const fs_reg &addr, const fs_reg &src,
42                         unsigned dims, unsigned size,
43                         brw_predicate pred = BRW_PREDICATE_NONE);
44
45      fs_reg
46      emit_untyped_atomic(const fs_builder &bld,
47                          const fs_reg &surface, const fs_reg &addr,
48                          const fs_reg &src0, const fs_reg &src1,
49                          unsigned dims, unsigned rsize, unsigned op,
50                          brw_predicate pred = BRW_PREDICATE_NONE);
51
52      fs_reg
53      emit_typed_read(const fs_builder &bld, const fs_reg &surface,
54                      const fs_reg &addr, unsigned dims, unsigned size);
55
56      void
57      emit_typed_write(const fs_builder &bld, const fs_reg &surface,
58                       const fs_reg &addr, const fs_reg &src,
59                       unsigned dims, unsigned size);
60
61      fs_reg
62      emit_typed_atomic(const fs_builder &bld, const fs_reg &surface,
63                        const fs_reg &addr,
64                        const fs_reg &src0, const fs_reg &src1,
65                        unsigned dims, unsigned rsize, unsigned op,
66                        brw_predicate pred = BRW_PREDICATE_NONE);
67   }
68
69   namespace image_access {
70      fs_reg
71      emit_image_load(const fs_builder &bld,
72                      const fs_reg &image, const fs_reg &addr,
73                      unsigned surf_dims, unsigned arr_dims,
74                      unsigned gl_format);
75
76      void
77      emit_image_store(const fs_builder &bld, const fs_reg &image,
78                       const fs_reg &addr, const fs_reg &src,
79                       unsigned surf_dims, unsigned arr_dims,
80                       unsigned gl_format);
81      fs_reg
82      emit_image_atomic(const fs_builder &bld,
83                        const fs_reg &image, const fs_reg &addr,
84                        const fs_reg &src0, const fs_reg &src1,
85                        unsigned surf_dims, unsigned arr_dims,
86                        unsigned rsize, unsigned op);
87   }
88}
89#endif
90