1/****************************************************************************
2* Copyright (C) 2014-2019 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 SurfaceState.h
24*
25* @brief Common definitions for surface state
26*
27******************************************************************************/
28#pragma once
29
30#include "core/state.h"
31
32//////////////////////////////////////////////////////////////////////////
33/// SWR_SURFACE_STATE
34//////////////////////////////////////////////////////////////////////////
35struct SWR_SURFACE_STATE
36{
37    gfxptr_t         xpBaseAddress;
38    SWR_SURFACE_TYPE type;   // @llvm_enum
39    SWR_FORMAT       format; // @llvm_enum
40    uint32_t         width;
41    uint32_t         height;
42    uint32_t         depth;
43    uint32_t         numSamples;
44    uint32_t         samplePattern;
45    uint32_t         pitch;
46    uint32_t         qpitch;
47    uint32_t minLod; // for sampled surfaces, the most detailed LOD that can be accessed by sampler
48    uint32_t maxLod; // for sampled surfaces, the max LOD that can be accessed
49    float    resourceMinLod; // for sampled surfaces, the most detailed fractional mip that can be
50    // accessed by sampler
51    uint32_t lod;            // for render targets, the lod being rendered to
52    uint32_t arrayIndex; // for render targets, the array index being rendered to for arrayed surfaces
53    SWR_TILE_MODE tileMode; // @llvm_enum
54    uint32_t      halign;
55    uint32_t      valign;
56    uint32_t      xOffset;
57    uint32_t      yOffset;
58
59    uint32_t lodOffsets[2][15]; // lod offsets for sampled surfaces
60
61    gfxptr_t     xpAuxBaseAddress; // Used for compression, append/consume counter, etc.
62    SWR_AUX_MODE auxMode;          // @llvm_enum
63
64
65    bool bInterleavedSamples; // are MSAA samples stored interleaved or planar
66};