• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2 * Copyright (C) 2018 Intel Corporation.   All Rights Reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 *
23 * @file InitMemory.h
24 *
25 * @brief Provide access to tiles table initialization functions
26 *
27 ******************************************************************************/
28 
29 #pragma once
30 
31 #include "common/os.h"
32 #include "memory/SurfaceState.h"
33 
34 //////////////////////////////////////////////////////////////////////////
35 /// @brief Loads a full hottile from a render surface
36 /// @param hPrivateContext - Handle to private DC
37 /// @param dstFormat - Format for hot tile.
38 /// @param renderTargetIndex - Index to src render target
39 /// @param x, y - Coordinates to raster tile.
40 /// @param pDstHotTile - Pointer to Hot Tile
41 SWR_FUNC(void,
42          SwrLoadHotTile,
43          HANDLE                      hWorkerPrivateData,
44          const SWR_SURFACE_STATE*    pSrcSurface,
45          BucketManager*              pBucketManager,
46          SWR_FORMAT                  dstFormat,
47          SWR_RENDERTARGET_ATTACHMENT renderTargetIndex,
48          uint32_t                    x,
49          uint32_t                    y,
50          uint32_t                    renderTargetArrayIndex,
51          uint8_t*                    pDstHotTile);
52 
53 //////////////////////////////////////////////////////////////////////////
54 /// @brief Deswizzles and stores a full hottile to a render surface
55 /// @param hPrivateContext - Handle to private DC
56 /// @param srcFormat - Format for hot tile.
57 /// @param renderTargetIndex - Index to destination render target
58 /// @param x, y - Coordinates to raster tile.
59 /// @param pSrcHotTile - Pointer to Hot Tile
60 SWR_FUNC(void,
61          SwrStoreHotTileToSurface,
62          HANDLE                      hWorkerPrivateData,
63          SWR_SURFACE_STATE*          pDstSurface,
64          BucketManager*              pBucketManager,
65          SWR_FORMAT                  srcFormat,
66          SWR_RENDERTARGET_ATTACHMENT renderTargetIndex,
67          uint32_t                    x,
68          uint32_t                    y,
69          uint32_t                    renderTargetArrayIndex,
70          uint8_t*                    pSrcHotTile);
71 
72 struct SWR_TILE_INTERFACE {
73     PFNSwrLoadHotTile           pfnSwrLoadHotTile;
74     PFNSwrStoreHotTileToSurface pfnSwrStoreHotTileToSurface;
75 };
76 
77 extern "C"
78 {
79     SWR_VISIBLE void SWR_API InitTilesTable();
80 
81     typedef void(SWR_API* PFNSwrGetTileInterface)(SWR_TILE_INTERFACE& out_funcs);
82     SWR_VISIBLE void SWR_API SwrGetTileIterface(SWR_TILE_INTERFACE &out_funcs);
83 }
84