1 /****************************************************************************
2  * Copyright (C) 2014-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 backend.h
24  *
25  * @brief Backend handles rasterization, pixel shading and output merger
26  *        operations.
27  *
28  ******************************************************************************/
29 #pragma once
30 
31 #include "common/os.h"
32 #include "core/context.h"
33 #include "core/multisample.h"
34 #include "depthstencil.h"
35 #include "rdtsc_core.h"
36 
37 void ProcessComputeBE(DRAW_CONTEXT* pDC,
38                       uint32_t      workerId,
39                       uint32_t      threadGroupId,
40                       void*&        pSpillFillBuffer,
41                       void*&        pScratchSpace);
42 void ProcessSyncBE(DRAW_CONTEXT* pDC, uint32_t workerId, uint32_t macroTile, void* pUserData);
43 void ProcessClearBE(DRAW_CONTEXT* pDC, uint32_t workerId, uint32_t macroTile, void* pUserData);
44 void ProcessStoreTilesBE(DRAW_CONTEXT* pDC, uint32_t workerId, uint32_t macroTile, void* pData);
45 void ProcessDiscardInvalidateTilesBE(DRAW_CONTEXT* pDC,
46                                      uint32_t      workerId,
47                                      uint32_t      macroTile,
48                                      void*         pData);
49 void ProcessShutdownBE(DRAW_CONTEXT* pDC, uint32_t workerId, uint32_t macroTile, void* pUserData);
50 
51 typedef void (*PFN_CLEAR_TILES)(DRAW_CONTEXT*,
52                                 HANDLE                      hWorkerData,
53                                 SWR_RENDERTARGET_ATTACHMENT rt,
54                                 uint32_t,
55                                 uint32_t,
56                                 uint32_t[4],
57                                 const SWR_RECT& rect);
58 
59 extern PFN_CLEAR_TILES  gClearTilesTable[NUM_SWR_FORMATS];
60 extern PFN_BACKEND_FUNC gBackendNullPs[SWR_MULTISAMPLE_TYPE_COUNT];
61 extern PFN_BACKEND_FUNC gBackendSingleSample[SWR_INPUT_COVERAGE_COUNT][2]     // centroid
62                                             [2];                              // canEarlyZ
63 extern PFN_BACKEND_FUNC gBackendPixelRateTable[SWR_MULTISAMPLE_TYPE_COUNT][2] // isCenterPattern
64                                               [SWR_INPUT_COVERAGE_COUNT][2]   // centroid
65                                               [2]                             // forcedSampleCount
66                                               [2]                             // canEarlyZ
67     ;
68 extern PFN_BACKEND_FUNC gBackendSampleRateTable[SWR_MULTISAMPLE_TYPE_COUNT]
69                                                [SWR_INPUT_COVERAGE_COUNT][2] // centroid
70                                                [2];                          // canEarlyZ
71