Support for Custom Pitch for gfx103x
Signed-off-by: Mike Li <Tianxinmike.Li@amd.com>
Change-Id: Ica83dff8bb382637010396781190f585754bd150
[ROCm/ROCR-Runtime commit: 93609fd3d4]
Этот коммит содержится в:
коммит произвёл
Mike (Tianxin) Li
родитель
562258ec93
Коммит
c2bed10739
@@ -314,8 +314,6 @@ ADDR_E_RETURNCODE Lib::ComputeSurfaceInfo(
|
||||
}
|
||||
}
|
||||
|
||||
ADDR_ASSERT(pOut->surfSize != 0);
|
||||
|
||||
ValidBaseAlignments(pOut->baseAlign);
|
||||
|
||||
return returnCode;
|
||||
|
||||
@@ -484,7 +484,11 @@ hsa_status_t ImageManagerNv::PopulateImageSrd(Image& image) const {
|
||||
word4.f.DEPTH =
|
||||
(image_array) // Doesn't hurt but isn't array_size already >0?
|
||||
? std::max(image.desc.array_size, static_cast<size_t>(1)) - 1
|
||||
: (image_3d) ? image.desc.depth - 1 : out.pitch - 1;
|
||||
: (image_3d) ? image.desc.depth - 1 : 0;
|
||||
uint32_t minor_ver = MinorVerFromDevID(chip_id_);
|
||||
// For 1d, 2d and 2d-msaa in gfx1030 and beyond this is pitch-1
|
||||
if ((minor_ver >= 3) && !image_array && !image_3d)
|
||||
word4.f.PITCH = out.pitch - 1;
|
||||
|
||||
word5.val = 0;
|
||||
word6.val = 0;
|
||||
@@ -630,6 +634,7 @@ uint32_t ImageManagerNv::GetAddrlibSurfaceInfoNv(
|
||||
const uint32_t num_slice = static_cast<uint32_t>(
|
||||
std::max(kMinNumSlice, std::max(desc.array_size, desc.depth)));
|
||||
|
||||
uint32_t minor_ver = MinorVerFromDevID(chip_id_);
|
||||
ADDR2_COMPUTE_SURFACE_INFO_INPUT in = {0};
|
||||
in.size = sizeof(ADDR2_COMPUTE_SURFACE_INFO_INPUT);
|
||||
in.format = addrlib_format;
|
||||
@@ -637,6 +642,9 @@ uint32_t ImageManagerNv::GetAddrlibSurfaceInfoNv(
|
||||
in.width = width;
|
||||
in.height = height;
|
||||
in.numSlices = num_slice;
|
||||
// Custom Pitch is supported in gfx1030 and beyond
|
||||
if (minor_ver >= 3)
|
||||
in.pitchInElement = image_data_row_pitch / image_prop.element_size;
|
||||
switch (desc.geometry) {
|
||||
case HSA_EXT_IMAGE_GEOMETRY_1D:
|
||||
case HSA_EXT_IMAGE_GEOMETRY_1DB:
|
||||
|
||||
@@ -300,21 +300,34 @@ union SQ_IMG_RSRC_WORD3 {
|
||||
#define SQ_IMG_RSC_WRD4_REG_SZ 32
|
||||
#define SQ_IMG_RSC_WRD4_DEPTH_SZ 13
|
||||
#define SQ_IMG_RSC_WRD4_BASE_ARR_SZ 13
|
||||
struct sq_img_rsrc_word4_t {
|
||||
#define SQ_IMG_RSC_WRD4_PITCH_SZ 14
|
||||
union sq_img_rsrc_word4_t {
|
||||
struct {
|
||||
#if defined(LITTLEENDIAN_CPU)
|
||||
// For arrays this is last slice in view, for 3D this is depth-1, For remaining this is pitch-1
|
||||
unsigned int DEPTH : SQ_IMG_RSC_WRD4_DEPTH_SZ;
|
||||
unsigned int : 1; //Pitch[13] in gfx1030
|
||||
unsigned int : 2;
|
||||
unsigned int BASE_ARRAY : SQ_IMG_RSC_WRD4_BASE_ARR_SZ;
|
||||
unsigned int : 3;
|
||||
// For arrays this is last slice in view, for 3D this is depth-1, For remaining this is pitch-1
|
||||
unsigned int DEPTH : SQ_IMG_RSC_WRD4_DEPTH_SZ;
|
||||
unsigned int : 1; //Pitch[13] in gfx1030
|
||||
unsigned int : 2;
|
||||
unsigned int BASE_ARRAY : SQ_IMG_RSC_WRD4_BASE_ARR_SZ;
|
||||
unsigned int : 3;
|
||||
#elif defined(BIGENDIAN_CPU)
|
||||
unsigned int : 3;
|
||||
unsigned int BASE_ARRAY : SQ_IMG_RSC_WRD4_BASE_ARR_SZ;
|
||||
unsigned int : 2;
|
||||
unsigned int : 1; //Pitch[13] in gfx1030
|
||||
unsigned int DEPTH : SQ_IMG_RSC_WRD4_DEPTH_SZ; //Pitch[0:12] in gfx1030
|
||||
unsigned int : 3;
|
||||
unsigned int BASE_ARRAY : SQ_IMG_RSC_WRD4_BASE_ARR_SZ;
|
||||
unsigned int : 2;
|
||||
unsigned int : 1; //Pitch[13] in gfx1030
|
||||
unsigned int DEPTH : SQ_IMG_RSC_WRD4_DEPTH_SZ; //Pitch[0:12] in gfx1030
|
||||
#endif
|
||||
};
|
||||
struct {
|
||||
#if defined(LITTLEENDIAN_CPU)
|
||||
// For 1d, 2d and 2d-msaa in gfx1030 this is pitch-1
|
||||
unsigned int PITCH : SQ_IMG_RSC_WRD4_PITCH_SZ;
|
||||
unsigned int : SQ_IMG_RSC_WRD4_REG_SZ-SQ_IMG_RSC_WRD4_PITCH_SZ;
|
||||
#elif defined(BIGENDIAN_CPU)
|
||||
unsigned int : SQ_IMG_RSC_WRD4_REG_SZ-SQ_IMG_RSC_WRD4_PITCH_SZ;
|
||||
unsigned int PITCH : SQ_IMG_RSC_WRD4_PITCH_SZ;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
union SQ_IMG_RSRC_WORD4 {
|
||||
sq_img_rsrc_word4_t bitfields, bits, f;
|
||||
|
||||
Ссылка в новой задаче
Block a user