/*========================== begin_copyright_notice ============================
Copyright (C) 2025 Intel Corporation

SPDX-License-Identifier: MIT
============================= end_copyright_notice ===========================*/

/*!
 * @file An header definisions for block 2d
 */

#ifndef BLOCK_2D_H_
#define BLOCK_2D_H_

// Structure describing load/store block2d message header
// See https://gfxspecs.intel.com/Predator/Home/Index/53567
typedef struct Block2D
{
    uint64_t surface_base_address;
    uint32_t surface_width;  // width-1 (in bytes).  Bits [31:24] are ignored. 
    uint32_t surface_height; // height-1 (in bytes). Bits [31:24] are ignored. 
    uint32_t surface_pitch;  // pitch-1. Bits [31:24] are ignored. 
    int32_t  block_start_x;  // Specifies the signed X offset (in number of data elements) from the 2D surface base address for this rectangular region.
    int32_t  block_start_y;  // Specifies the signed Y offset (in number of data elements) from the 2D surface base address for this rectangular region.
    uint8_t  block_width;    // Specifies the width  minus 1 (in number of data elements) for this rectangular region. Encoded range of [0, 255] represents a width of [1, 256].
    uint8_t  block_height;   // Specifies the height minus 1 (in number of data elements) for this rectangular region. Encoded range of [0, 255] represents a width of [1, 256].
    uint8_t  array_length;   // Specifies Array Length minus 1 for Load2DBlockArray messages.Encoded range of [0, 15] represents a array length of [1, 16].
                             // The range of this field must be in 0-3.
                             // This field must be zero for 2D Block Store messages.
} Block2D;

#endif // BLOCK_2D_H_
