1/* 2 * Copyright (C) 2016 Intel Corporation 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 24 25/* Instructions, enums and structures for GFX125. 26 * 27 * This file has been generated, do not hand edit. 28 */ 29 30#ifndef GFX125_PACK_H 31#define GFX125_PACK_H 32 33#include <stdio.h> 34#include <stdint.h> 35#include <stdbool.h> 36#include <assert.h> 37#include <math.h> 38 39#ifndef __gen_validate_value 40#define __gen_validate_value(x) 41#endif 42 43#ifndef __intel_field_functions 44#define __intel_field_functions 45 46#ifdef NDEBUG 47#define NDEBUG_UNUSED __attribute__((unused)) 48#else 49#define NDEBUG_UNUSED 50#endif 51 52union __intel_value { 53 float f; 54 uint32_t dw; 55}; 56 57static inline __attribute__((always_inline)) uint64_t 58__gen_mbo(uint32_t start, uint32_t end) 59{ 60 return (~0ull >> (64 - (end - start + 1))) << start; 61} 62 63static inline __attribute__((always_inline)) uint64_t 64__gen_uint(uint64_t v, uint32_t start, NDEBUG_UNUSED uint32_t end) 65{ 66 __gen_validate_value(v); 67 68#ifndef NDEBUG 69 const int width = end - start + 1; 70 if (width < 64) { 71 const uint64_t max = (1ull << width) - 1; 72 assert(v <= max); 73 } 74#endif 75 76 return v << start; 77} 78 79static inline __attribute__((always_inline)) uint64_t 80__gen_sint(int64_t v, uint32_t start, uint32_t end) 81{ 82 const int width = end - start + 1; 83 84 __gen_validate_value(v); 85 86#ifndef NDEBUG 87 if (width < 64) { 88 const int64_t max = (1ll << (width - 1)) - 1; 89 const int64_t min = -(1ll << (width - 1)); 90 assert(min <= v && v <= max); 91 } 92#endif 93 94 const uint64_t mask = ~0ull >> (64 - width); 95 96 return (v & mask) << start; 97} 98 99static inline __attribute__((always_inline)) uint64_t 100__gen_offset(uint64_t v, NDEBUG_UNUSED uint32_t start, NDEBUG_UNUSED uint32_t end) 101{ 102 __gen_validate_value(v); 103#ifndef NDEBUG 104 uint64_t mask = (~0ull >> (64 - (end - start + 1))) << start; 105 106 assert((v & ~mask) == 0); 107#endif 108 109 return v; 110} 111 112static inline __attribute__((always_inline)) uint64_t 113__gen_address(__gen_user_data *data, void *location, 114 __gen_address_type address, uint32_t delta, 115 __attribute__((unused)) uint32_t start, uint32_t end) 116{ 117 uint64_t addr_u64 = __gen_combine_address(data, location, address, delta); 118 if (end == 31) { 119 return addr_u64; 120 } else if (end < 63) { 121 const unsigned shift = 63 - end; 122 return (addr_u64 << shift) >> shift; 123 } else { 124 return addr_u64; 125 } 126} 127 128static inline __attribute__((always_inline)) uint32_t 129__gen_float(float v) 130{ 131 __gen_validate_value(v); 132 return ((union __intel_value) { .f = (v) }).dw; 133} 134 135static inline __attribute__((always_inline)) uint64_t 136__gen_sfixed(float v, uint32_t start, uint32_t end, uint32_t fract_bits) 137{ 138 __gen_validate_value(v); 139 140 const float factor = (1 << fract_bits); 141 142#ifndef NDEBUG 143 const float max = ((1 << (end - start)) - 1) / factor; 144 const float min = -(1 << (end - start)) / factor; 145 assert(min <= v && v <= max); 146#endif 147 148 const int64_t int_val = llroundf(v * factor); 149 const uint64_t mask = ~0ull >> (64 - (end - start + 1)); 150 151 return (int_val & mask) << start; 152} 153 154static inline __attribute__((always_inline)) uint64_t 155__gen_ufixed(float v, uint32_t start, NDEBUG_UNUSED uint32_t end, uint32_t fract_bits) 156{ 157 __gen_validate_value(v); 158 159 const float factor = (1 << fract_bits); 160 161#ifndef NDEBUG 162 const float max = ((1 << (end - start + 1)) - 1) / factor; 163 const float min = 0.0f; 164 assert(min <= v && v <= max); 165#endif 166 167 const uint64_t uint_val = llroundf(v * factor); 168 169 return uint_val << start; 170} 171 172#ifndef __gen_address_type 173#error #define __gen_address_type before including this file 174#endif 175 176#ifndef __gen_user_data 177#error #define __gen_combine_address before including this file 178#endif 179 180#undef NDEBUG_UNUSED 181 182#endif 183 184 185enum GFX125_3D_Color_Buffer_Blend_Factor { 186 BLENDFACTOR_ONE = 1, 187 BLENDFACTOR_SRC_COLOR = 2, 188 BLENDFACTOR_SRC_ALPHA = 3, 189 BLENDFACTOR_DST_ALPHA = 4, 190 BLENDFACTOR_DST_COLOR = 5, 191 BLENDFACTOR_SRC_ALPHA_SATURATE = 6, 192 BLENDFACTOR_CONST_COLOR = 7, 193 BLENDFACTOR_CONST_ALPHA = 8, 194 BLENDFACTOR_SRC1_COLOR = 9, 195 BLENDFACTOR_SRC1_ALPHA = 10, 196 BLENDFACTOR_ZERO = 17, 197 BLENDFACTOR_INV_SRC_COLOR = 18, 198 BLENDFACTOR_INV_SRC_ALPHA = 19, 199 BLENDFACTOR_INV_DST_ALPHA = 20, 200 BLENDFACTOR_INV_DST_COLOR = 21, 201 BLENDFACTOR_INV_CONST_COLOR = 23, 202 BLENDFACTOR_INV_CONST_ALPHA = 24, 203 BLENDFACTOR_INV_SRC1_COLOR = 25, 204 BLENDFACTOR_INV_SRC1_ALPHA = 26, 205}; 206 207enum GFX125_3D_Color_Buffer_Blend_Function { 208 BLENDFUNCTION_ADD = 0, 209 BLENDFUNCTION_SUBTRACT = 1, 210 BLENDFUNCTION_REVERSE_SUBTRACT = 2, 211 BLENDFUNCTION_MIN = 3, 212 BLENDFUNCTION_MAX = 4, 213}; 214 215enum GFX125_3D_Compare_Function { 216 COMPAREFUNCTION_ALWAYS = 0, 217 COMPAREFUNCTION_NEVER = 1, 218 COMPAREFUNCTION_LESS = 2, 219 COMPAREFUNCTION_EQUAL = 3, 220 COMPAREFUNCTION_LEQUAL = 4, 221 COMPAREFUNCTION_GREATER = 5, 222 COMPAREFUNCTION_NOTEQUAL = 6, 223 COMPAREFUNCTION_GEQUAL = 7, 224}; 225 226enum GFX125_3D_Logic_Op_Function { 227 LOGICOP_CLEAR = 0, 228 LOGICOP_NOR = 1, 229 LOGICOP_AND_INVERTED = 2, 230 LOGICOP_COPY_INVERTED = 3, 231 LOGICOP_AND_REVERSE = 4, 232 LOGICOP_INVERT = 5, 233 LOGICOP_XOR = 6, 234 LOGICOP_NAND = 7, 235 LOGICOP_AND = 8, 236 LOGICOP_EQUIV = 9, 237 LOGICOP_NOOP = 10, 238 LOGICOP_OR_INVERTED = 11, 239 LOGICOP_COPY = 12, 240 LOGICOP_OR_REVERSE = 13, 241 LOGICOP_OR = 14, 242 LOGICOP_SET = 15, 243}; 244 245enum GFX125_3D_Prim_Topo_Type { 246 _3DPRIM_POINTLIST = 1, 247 _3DPRIM_LINELIST = 2, 248 _3DPRIM_LINESTRIP = 3, 249 _3DPRIM_TRILIST = 4, 250 _3DPRIM_TRISTRIP = 5, 251 _3DPRIM_TRIFAN = 6, 252 _3DPRIM_QUADLIST = 7, 253 _3DPRIM_QUADSTRIP = 8, 254 _3DPRIM_LINELIST_ADJ = 9, 255 _3DPRIM_LINESTRIP_ADJ = 10, 256 _3DPRIM_TRILIST_ADJ = 11, 257 _3DPRIM_TRISTRIP_ADJ = 12, 258 _3DPRIM_TRISTRIP_REVERSE = 13, 259 _3DPRIM_POLYGON = 14, 260 _3DPRIM_RECTLIST = 15, 261 _3DPRIM_LINELOOP = 16, 262 _3DPRIM_POINTLIST_BF = 17, 263 _3DPRIM_LINESTRIP_CONT = 18, 264 _3DPRIM_LINESTRIP_BF = 19, 265 _3DPRIM_LINESTRIP_CONT_BF = 20, 266 _3DPRIM_TRIFAN_NOSTIPPLE = 22, 267 _3DPRIM_PATCHLIST_1 = 32, 268 _3DPRIM_PATCHLIST_2 = 33, 269 _3DPRIM_PATCHLIST_3 = 34, 270 _3DPRIM_PATCHLIST_4 = 35, 271 _3DPRIM_PATCHLIST_5 = 36, 272 _3DPRIM_PATCHLIST_6 = 37, 273 _3DPRIM_PATCHLIST_7 = 38, 274 _3DPRIM_PATCHLIST_8 = 39, 275 _3DPRIM_PATCHLIST_9 = 40, 276 _3DPRIM_PATCHLIST_10 = 41, 277 _3DPRIM_PATCHLIST_11 = 42, 278 _3DPRIM_PATCHLIST_12 = 43, 279 _3DPRIM_PATCHLIST_13 = 44, 280 _3DPRIM_PATCHLIST_14 = 45, 281 _3DPRIM_PATCHLIST_15 = 46, 282 _3DPRIM_PATCHLIST_16 = 47, 283 _3DPRIM_PATCHLIST_17 = 48, 284 _3DPRIM_PATCHLIST_18 = 49, 285 _3DPRIM_PATCHLIST_19 = 50, 286 _3DPRIM_PATCHLIST_20 = 51, 287 _3DPRIM_PATCHLIST_21 = 52, 288 _3DPRIM_PATCHLIST_22 = 53, 289 _3DPRIM_PATCHLIST_23 = 54, 290 _3DPRIM_PATCHLIST_24 = 55, 291 _3DPRIM_PATCHLIST_25 = 56, 292 _3DPRIM_PATCHLIST_26 = 57, 293 _3DPRIM_PATCHLIST_27 = 58, 294 _3DPRIM_PATCHLIST_28 = 59, 295 _3DPRIM_PATCHLIST_29 = 60, 296 _3DPRIM_PATCHLIST_30 = 61, 297 _3DPRIM_PATCHLIST_31 = 62, 298 _3DPRIM_PATCHLIST_32 = 63, 299}; 300 301enum GFX125_3D_Stencil_Operation { 302 STENCILOP_KEEP = 0, 303 STENCILOP_ZERO = 1, 304 STENCILOP_REPLACE = 2, 305 STENCILOP_INCRSAT = 3, 306 STENCILOP_DECRSAT = 4, 307 STENCILOP_INCR = 5, 308 STENCILOP_DECR = 6, 309 STENCILOP_INVERT = 7, 310}; 311 312enum GFX125_3D_Vertex_Component_Control { 313 VFCOMP_NOSTORE = 0, 314 VFCOMP_STORE_SRC = 1, 315 VFCOMP_STORE_0 = 2, 316 VFCOMP_STORE_1_FP = 3, 317 VFCOMP_STORE_1_INT = 4, 318 VFCOMP_STORE_PID = 7, 319}; 320 321enum GFX125_Atomic_OPCODE { 322 MI_ATOMIC_OP_AND = 1, 323 MI_ATOMIC_OP_OR = 2, 324 MI_ATOMIC_OP_XOR = 3, 325 MI_ATOMIC_OP_MOVE = 4, 326 MI_ATOMIC_OP_INC = 5, 327 MI_ATOMIC_OP_DEC = 6, 328 MI_ATOMIC_OP_ADD = 7, 329 MI_ATOMIC_OP_SUB = 8, 330 MI_ATOMIC_OP_RSUB = 9, 331 MI_ATOMIC_OP_IMAX = 10, 332 MI_ATOMIC_OP_IMIN = 11, 333 MI_ATOMIC_OP_UMAX = 12, 334 MI_ATOMIC_OP_UMIN = 13, 335 MI_ATOMIC_OP_CMP_WR = 14, 336 MI_ATOMIC_OP_PREDEC = 15, 337 MI_ATOMIC_OP_AND8B = 33, 338 MI_ATOMIC_OP_OR8B = 34, 339 MI_ATOMIC_OP_XOR8B = 35, 340 MI_ATOMIC_OP_MOVE8B = 36, 341 MI_ATOMIC_OP_INC8B = 37, 342 MI_ATOMIC_OP_DEC8B = 38, 343 MI_ATOMIC_OP_ADD8B = 39, 344 MI_ATOMIC_OP_SUB8B = 40, 345 MI_ATOMIC_OP_RSUB8B = 41, 346 MI_ATOMIC_OP_IMAX8B = 42, 347 MI_ATOMIC_OP_IMIN8B = 43, 348 MI_ATOMIC_OP_UMAX8B = 44, 349 MI_ATOMIC_OP_UMIN8B = 45, 350 MI_ATOMIC_OP_CMP_WR8B = 46, 351 MI_ATOMIC_OP_PREDEC8B = 47, 352 MI_ATOMIC_OP_CMP_WR16B = 78, 353}; 354 355enum GFX125_Attribute_Component_Format { 356 ACF_DISABLED = 0, 357 ACF_XY = 1, 358 ACF_XYZ = 2, 359 ACF_XYZW = 3, 360}; 361 362enum GFX125_COMPONENT_ENABLES { 363 CE_NONE = 0, 364 CE_X = 1, 365 CE_Y = 2, 366 CE_XY = 3, 367 CE_Z = 4, 368 CE_XZ = 5, 369 CE_YZ = 6, 370 CE_XYZ = 7, 371 CE_W = 8, 372 CE_XW = 9, 373 CE_YW = 10, 374 CE_XYW = 11, 375 CE_ZW = 12, 376 CE_XZW = 13, 377 CE_YZW = 14, 378 CE_XYZW = 15, 379}; 380 381enum GFX125_ShaderChannelSelect { 382 SCS_ZERO = 0, 383 SCS_ONE = 1, 384 SCS_RED = 4, 385 SCS_GREEN = 5, 386 SCS_BLUE = 6, 387 SCS_ALPHA = 7, 388}; 389 390enum GFX125_TextureCoordinateMode { 391 TCM_WRAP = 0, 392 TCM_MIRROR = 1, 393 TCM_CLAMP = 2, 394 TCM_CUBE = 3, 395 TCM_CLAMP_BORDER = 4, 396 TCM_MIRROR_ONCE = 5, 397 TCM_HALF_BORDER = 6, 398 TCM_MIRROR_101 = 7, 399}; 400 401enum GFX125_WRAP_SHORTEST_ENABLE { 402 WSE_X = 1, 403 WSE_Y = 2, 404 WSE_XY = 3, 405 WSE_Z = 4, 406 WSE_XZ = 5, 407 WSE_YZ = 6, 408 WSE_XYZ = 7, 409 WSE_W = 8, 410 WSE_XW = 9, 411 WSE_YW = 10, 412 WSE_XYW = 11, 413 WSE_ZW = 12, 414 WSE_XZW = 13, 415 WSE_YZW = 14, 416 WSE_XYZW = 15, 417}; 418 419#define GFX125_3DSTATE_CONSTANT_ALL_DATA_length 2 420struct GFX125_3DSTATE_CONSTANT_ALL_DATA { 421 uint32_t ConstantBufferReadLength; 422 __gen_address_type PointerToConstantBuffer; 423}; 424 425static inline __attribute__((always_inline)) void 426GFX125_3DSTATE_CONSTANT_ALL_DATA_pack(__attribute__((unused)) __gen_user_data *data, 427 __attribute__((unused)) void * restrict dst, 428 __attribute__((unused)) const struct GFX125_3DSTATE_CONSTANT_ALL_DATA * restrict values) 429{ 430 uint32_t * restrict dw = (uint32_t * restrict) dst; 431 432 const uint64_t v0 = 433 __gen_uint(values->ConstantBufferReadLength, 0, 4); 434 const uint64_t v0_address = 435 __gen_address(data, &dw[0], values->PointerToConstantBuffer, v0, 5, 63); 436 dw[0] = v0_address; 437 dw[1] = (v0_address >> 32) | (v0 >> 32); 438} 439 440#define GFX125_3DSTATE_CONSTANT_BODY_length 10 441struct GFX125_3DSTATE_CONSTANT_BODY { 442 uint32_t ReadLength[4]; 443 __gen_address_type Buffer[4]; 444}; 445 446static inline __attribute__((always_inline)) void 447GFX125_3DSTATE_CONSTANT_BODY_pack(__attribute__((unused)) __gen_user_data *data, 448 __attribute__((unused)) void * restrict dst, 449 __attribute__((unused)) const struct GFX125_3DSTATE_CONSTANT_BODY * restrict values) 450{ 451 uint32_t * restrict dw = (uint32_t * restrict) dst; 452 453 dw[0] = 454 __gen_uint(values->ReadLength[0], 0, 15) | 455 __gen_uint(values->ReadLength[1], 16, 31); 456 457 dw[1] = 458 __gen_uint(values->ReadLength[2], 0, 15) | 459 __gen_uint(values->ReadLength[3], 16, 31); 460 461 const uint64_t v2_address = 462 __gen_address(data, &dw[2], values->Buffer[0], 0, 5, 63); 463 dw[2] = v2_address; 464 dw[3] = v2_address >> 32; 465 466 const uint64_t v4_address = 467 __gen_address(data, &dw[4], values->Buffer[1], 0, 5, 63); 468 dw[4] = v4_address; 469 dw[5] = v4_address >> 32; 470 471 const uint64_t v6_address = 472 __gen_address(data, &dw[6], values->Buffer[2], 0, 5, 63); 473 dw[6] = v6_address; 474 dw[7] = v6_address >> 32; 475 476 const uint64_t v8_address = 477 __gen_address(data, &dw[8], values->Buffer[3], 0, 5, 63); 478 dw[8] = v8_address; 479 dw[9] = v8_address >> 32; 480} 481 482#define GFX125_3DSTATE_SO_BUFFER_INDEX_BODY_length 7 483struct GFX125_3DSTATE_SO_BUFFER_INDEX_BODY { 484 bool StreamOutputBufferOffsetAddressEnable; 485 bool StreamOffsetWriteEnable; 486 uint32_t MOCS; 487 bool SOBufferEnable; 488 __gen_address_type SurfaceBaseAddress; 489 uint32_t SurfaceSize; 490 __gen_address_type StreamOutputBufferOffsetAddress; 491 uint32_t StreamOffset; 492}; 493 494static inline __attribute__((always_inline)) void 495GFX125_3DSTATE_SO_BUFFER_INDEX_BODY_pack(__attribute__((unused)) __gen_user_data *data, 496 __attribute__((unused)) void * restrict dst, 497 __attribute__((unused)) const struct GFX125_3DSTATE_SO_BUFFER_INDEX_BODY * restrict values) 498{ 499 uint32_t * restrict dw = (uint32_t * restrict) dst; 500 501 dw[0] = 502 __gen_uint(values->StreamOutputBufferOffsetAddressEnable, 20, 20) | 503 __gen_uint(values->StreamOffsetWriteEnable, 21, 21) | 504 __gen_uint(values->MOCS, 22, 28) | 505 __gen_uint(values->SOBufferEnable, 31, 31); 506 507 const uint64_t v1_address = 508 __gen_address(data, &dw[1], values->SurfaceBaseAddress, 0, 2, 47); 509 dw[1] = v1_address; 510 dw[2] = v1_address >> 32; 511 512 dw[3] = 513 __gen_uint(values->SurfaceSize, 0, 29); 514 515 const uint64_t v4_address = 516 __gen_address(data, &dw[4], values->StreamOutputBufferOffsetAddress, 0, 2, 47); 517 dw[4] = v4_address; 518 dw[5] = v4_address >> 32; 519 520 dw[6] = 521 __gen_uint(values->StreamOffset, 0, 31); 522} 523 524#define GFX125_BINDING_TABLE_EDIT_ENTRY_length 1 525struct GFX125_BINDING_TABLE_EDIT_ENTRY { 526 uint64_t SurfaceStatePointer; 527 uint32_t BindingTableIndex; 528}; 529 530static inline __attribute__((always_inline)) void 531GFX125_BINDING_TABLE_EDIT_ENTRY_pack(__attribute__((unused)) __gen_user_data *data, 532 __attribute__((unused)) void * restrict dst, 533 __attribute__((unused)) const struct GFX125_BINDING_TABLE_EDIT_ENTRY * restrict values) 534{ 535 uint32_t * restrict dw = (uint32_t * restrict) dst; 536 537 dw[0] = 538 __gen_offset(values->SurfaceStatePointer, 0, 15) | 539 __gen_uint(values->BindingTableIndex, 16, 23); 540} 541 542#define GFX125_BINDING_TABLE_STATE_length 1 543struct GFX125_BINDING_TABLE_STATE { 544 uint64_t SurfaceStatePointer; 545}; 546 547static inline __attribute__((always_inline)) void 548GFX125_BINDING_TABLE_STATE_pack(__attribute__((unused)) __gen_user_data *data, 549 __attribute__((unused)) void * restrict dst, 550 __attribute__((unused)) const struct GFX125_BINDING_TABLE_STATE * restrict values) 551{ 552 uint32_t * restrict dw = (uint32_t * restrict) dst; 553 554 dw[0] = 555 __gen_offset(values->SurfaceStatePointer, 6, 31); 556} 557 558#define GFX125_BLEND_STATE_ENTRY_length 2 559struct GFX125_BLEND_STATE_ENTRY { 560 bool WriteDisableBlue; 561 bool WriteDisableGreen; 562 bool WriteDisableRed; 563 bool WriteDisableAlpha; 564 enum GFX125_3D_Color_Buffer_Blend_Function AlphaBlendFunction; 565 enum GFX125_3D_Color_Buffer_Blend_Factor DestinationAlphaBlendFactor; 566 enum GFX125_3D_Color_Buffer_Blend_Factor SourceAlphaBlendFactor; 567 enum GFX125_3D_Color_Buffer_Blend_Function ColorBlendFunction; 568 enum GFX125_3D_Color_Buffer_Blend_Factor DestinationBlendFactor; 569 enum GFX125_3D_Color_Buffer_Blend_Factor SourceBlendFactor; 570 bool ColorBufferBlendEnable; 571 bool PostBlendColorClampEnable; 572 bool PreBlendColorClampEnable; 573 uint32_t ColorClampRange; 574#define COLORCLAMP_UNORM 0 575#define COLORCLAMP_SNORM 1 576#define COLORCLAMP_RTFORMAT 2 577 bool PreBlendSourceOnlyClampEnable; 578 enum GFX125_3D_Logic_Op_Function LogicOpFunction; 579 bool LogicOpEnable; 580}; 581 582static inline __attribute__((always_inline)) void 583GFX125_BLEND_STATE_ENTRY_pack(__attribute__((unused)) __gen_user_data *data, 584 __attribute__((unused)) void * restrict dst, 585 __attribute__((unused)) const struct GFX125_BLEND_STATE_ENTRY * restrict values) 586{ 587 uint32_t * restrict dw = (uint32_t * restrict) dst; 588 589 dw[0] = 590 __gen_uint(values->WriteDisableBlue, 0, 0) | 591 __gen_uint(values->WriteDisableGreen, 1, 1) | 592 __gen_uint(values->WriteDisableRed, 2, 2) | 593 __gen_uint(values->WriteDisableAlpha, 3, 3) | 594 __gen_uint(values->AlphaBlendFunction, 5, 7) | 595 __gen_uint(values->DestinationAlphaBlendFactor, 8, 12) | 596 __gen_uint(values->SourceAlphaBlendFactor, 13, 17) | 597 __gen_uint(values->ColorBlendFunction, 18, 20) | 598 __gen_uint(values->DestinationBlendFactor, 21, 25) | 599 __gen_uint(values->SourceBlendFactor, 26, 30) | 600 __gen_uint(values->ColorBufferBlendEnable, 31, 31); 601 602 dw[1] = 603 __gen_uint(values->PostBlendColorClampEnable, 0, 0) | 604 __gen_uint(values->PreBlendColorClampEnable, 1, 1) | 605 __gen_uint(values->ColorClampRange, 2, 3) | 606 __gen_uint(values->PreBlendSourceOnlyClampEnable, 4, 4) | 607 __gen_uint(values->LogicOpFunction, 27, 30) | 608 __gen_uint(values->LogicOpEnable, 31, 31); 609} 610 611#define GFX125_BLEND_STATE_length 1 612struct GFX125_BLEND_STATE { 613 uint32_t YDitherOffset; 614 uint32_t XDitherOffset; 615 bool ColorDitherEnable; 616 enum GFX125_3D_Compare_Function AlphaTestFunction; 617 bool AlphaTestEnable; 618 bool AlphaToCoverageDitherEnable; 619 bool AlphaToOneEnable; 620 bool IndependentAlphaBlendEnable; 621 bool AlphaToCoverageEnable; 622 /* variable length fields follow */ 623}; 624 625static inline __attribute__((always_inline)) void 626GFX125_BLEND_STATE_pack(__attribute__((unused)) __gen_user_data *data, 627 __attribute__((unused)) void * restrict dst, 628 __attribute__((unused)) const struct GFX125_BLEND_STATE * restrict values) 629{ 630 uint32_t * restrict dw = (uint32_t * restrict) dst; 631 632 dw[0] = 633 __gen_uint(values->YDitherOffset, 19, 20) | 634 __gen_uint(values->XDitherOffset, 21, 22) | 635 __gen_uint(values->ColorDitherEnable, 23, 23) | 636 __gen_uint(values->AlphaTestFunction, 24, 26) | 637 __gen_uint(values->AlphaTestEnable, 27, 27) | 638 __gen_uint(values->AlphaToCoverageDitherEnable, 28, 28) | 639 __gen_uint(values->AlphaToOneEnable, 29, 29) | 640 __gen_uint(values->IndependentAlphaBlendEnable, 30, 30) | 641 __gen_uint(values->AlphaToCoverageEnable, 31, 31); 642} 643 644#define GFX125_CC_VIEWPORT_length 2 645struct GFX125_CC_VIEWPORT { 646 float MinimumDepth; 647 float MaximumDepth; 648}; 649 650static inline __attribute__((always_inline)) void 651GFX125_CC_VIEWPORT_pack(__attribute__((unused)) __gen_user_data *data, 652 __attribute__((unused)) void * restrict dst, 653 __attribute__((unused)) const struct GFX125_CC_VIEWPORT * restrict values) 654{ 655 uint32_t * restrict dw = (uint32_t * restrict) dst; 656 657 dw[0] = 658 __gen_float(values->MinimumDepth); 659 660 dw[1] = 661 __gen_float(values->MaximumDepth); 662} 663 664#define GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_length 2 665struct GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY { 666 float Table1XFilterCoefficientn2; 667 float Table1YFilterCoefficientn2; 668 float Table1XFilterCoefficientn3; 669 float Table1YFilterCoefficientn3; 670 float Table1XFilterCoefficientn4; 671 float Table1YFilterCoefficientn4; 672 float Table1XFilterCoefficientn5; 673 float Table1YFilterCoefficientn5; 674}; 675 676static inline __attribute__((always_inline)) void 677GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(__attribute__((unused)) __gen_user_data *data, 678 __attribute__((unused)) void * restrict dst, 679 __attribute__((unused)) const struct GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY * restrict values) 680{ 681 uint32_t * restrict dw = (uint32_t * restrict) dst; 682 683 dw[0] = 684 __gen_sfixed(values->Table1XFilterCoefficientn2, 0, 7, 6) | 685 __gen_sfixed(values->Table1YFilterCoefficientn2, 8, 15, 6) | 686 __gen_sfixed(values->Table1XFilterCoefficientn3, 16, 23, 6) | 687 __gen_sfixed(values->Table1YFilterCoefficientn3, 24, 31, 6); 688 689 dw[1] = 690 __gen_sfixed(values->Table1XFilterCoefficientn4, 0, 7, 6) | 691 __gen_sfixed(values->Table1YFilterCoefficientn4, 8, 15, 6) | 692 __gen_sfixed(values->Table1XFilterCoefficientn5, 16, 23, 6) | 693 __gen_sfixed(values->Table1YFilterCoefficientn5, 24, 31, 6); 694} 695 696#define GFX125_CLEAR_COLOR_length 8 697struct GFX125_CLEAR_COLOR { 698 int32_t RawClearColorRed; 699 int32_t RawClearColorGreen; 700 int32_t RawClearColorBlue; 701 int32_t RawClearColorAlpha; 702 uint64_t ConvertedClearValueHiLow; 703}; 704 705static inline __attribute__((always_inline)) void 706GFX125_CLEAR_COLOR_pack(__attribute__((unused)) __gen_user_data *data, 707 __attribute__((unused)) void * restrict dst, 708 __attribute__((unused)) const struct GFX125_CLEAR_COLOR * restrict values) 709{ 710 uint32_t * restrict dw = (uint32_t * restrict) dst; 711 712 dw[0] = 713 __gen_sint(values->RawClearColorRed, 0, 31); 714 715 dw[1] = 716 __gen_sint(values->RawClearColorGreen, 0, 31); 717 718 dw[2] = 719 __gen_sint(values->RawClearColorBlue, 0, 31); 720 721 dw[3] = 722 __gen_sint(values->RawClearColorAlpha, 0, 31); 723 724 const uint64_t v4 = 725 __gen_uint(values->ConvertedClearValueHiLow, 0, 63); 726 dw[4] = v4; 727 dw[5] = v4 >> 32; 728 729 dw[6] = 0; 730 731 dw[7] = 0; 732} 733 734#define GFX125_COLOR_CALC_STATE_length 6 735struct GFX125_COLOR_CALC_STATE { 736 uint32_t AlphaTestFormat; 737#define ALPHATEST_UNORM8 0 738#define ALPHATEST_FLOAT32 1 739 bool RoundDisableFunctionDisable; 740 uint32_t AlphaReferenceValueAsUNORM8; 741 float AlphaReferenceValueAsFLOAT32; 742 float BlendConstantColorRed; 743 float BlendConstantColorGreen; 744 float BlendConstantColorBlue; 745 float BlendConstantColorAlpha; 746}; 747 748static inline __attribute__((always_inline)) void 749GFX125_COLOR_CALC_STATE_pack(__attribute__((unused)) __gen_user_data *data, 750 __attribute__((unused)) void * restrict dst, 751 __attribute__((unused)) const struct GFX125_COLOR_CALC_STATE * restrict values) 752{ 753 uint32_t * restrict dw = (uint32_t * restrict) dst; 754 755 dw[0] = 756 __gen_uint(values->AlphaTestFormat, 0, 0) | 757 __gen_uint(values->RoundDisableFunctionDisable, 15, 15); 758 759 dw[1] = 760 __gen_uint(values->AlphaReferenceValueAsUNORM8, 0, 31) | 761 __gen_float(values->AlphaReferenceValueAsFLOAT32); 762 763 dw[2] = 764 __gen_float(values->BlendConstantColorRed); 765 766 dw[3] = 767 __gen_float(values->BlendConstantColorGreen); 768 769 dw[4] = 770 __gen_float(values->BlendConstantColorBlue); 771 772 dw[5] = 773 __gen_float(values->BlendConstantColorAlpha); 774} 775 776#define GFX125_CPS_STATE_length 8 777struct GFX125_CPS_STATE { 778 float MinCPSizeX; 779 bool StatisticsEnable; 780 uint32_t CoarsePixelShadingMode; 781#define CPS_MODE_NONE 0 782#define CPS_MODE_CONSTANT 1 783#define CPS_MODE_RADIAL 2 784 uint32_t ScaleAxis; 785#define SCALE_AXIS_XAxis 0 786#define SCALE_AXIS_YAxis 1 787 float MinCPSizeY; 788 float MaxCPSizeX; 789 float MaxCPSizeY; 790 float YFocal; 791 float XFocal; 792 float My; 793 float Mx; 794 float Rmin; 795 float Aspect; 796}; 797 798static inline __attribute__((always_inline)) void 799GFX125_CPS_STATE_pack(__attribute__((unused)) __gen_user_data *data, 800 __attribute__((unused)) void * restrict dst, 801 __attribute__((unused)) const struct GFX125_CPS_STATE * restrict values) 802{ 803 uint32_t * restrict dw = (uint32_t * restrict) dst; 804 805 dw[0] = 806 __gen_sfixed(values->MinCPSizeX, 0, 10, 7) | 807 __gen_uint(values->StatisticsEnable, 11, 11) | 808 __gen_uint(values->CoarsePixelShadingMode, 12, 13) | 809 __gen_uint(values->ScaleAxis, 14, 14) | 810 __gen_sfixed(values->MinCPSizeY, 16, 26, 7); 811 812 dw[1] = 813 __gen_sfixed(values->MaxCPSizeX, 0, 10, 7) | 814 __gen_sfixed(values->MaxCPSizeY, 16, 26, 7); 815 816 dw[2] = 817 __gen_sfixed(values->YFocal, 0, 15, 0); 818 819 dw[3] = 820 __gen_sfixed(values->XFocal, 0, 15, 0); 821 822 dw[4] = 823 __gen_float(values->My); 824 825 dw[5] = 826 __gen_float(values->Mx); 827 828 dw[6] = 829 __gen_float(values->Rmin); 830 831 dw[7] = 832 __gen_float(values->Aspect); 833} 834 835#define GFX125_EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_length 1 836struct GFX125_EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR { 837 uint32_t TargetFunctionID; 838 uint32_t EndOfThread; 839#define NoTermination 0 840#define EOT 1 841 uint32_t ExtendedMessageLength; 842}; 843 844static inline __attribute__((always_inline)) void 845GFX125_EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_pack(__attribute__((unused)) __gen_user_data *data, 846 __attribute__((unused)) void * restrict dst, 847 __attribute__((unused)) const struct GFX125_EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR * restrict values) 848{ 849 uint32_t * restrict dw = (uint32_t * restrict) dst; 850 851 dw[0] = 852 __gen_uint(values->TargetFunctionID, 0, 3) | 853 __gen_uint(values->EndOfThread, 5, 5) | 854 __gen_uint(values->ExtendedMessageLength, 6, 9); 855} 856 857#define GFX125_FILTER_COEFFICIENT_length 1 858struct GFX125_FILTER_COEFFICIENT { 859 float FilterCoefficient; 860}; 861 862static inline __attribute__((always_inline)) void 863GFX125_FILTER_COEFFICIENT_pack(__attribute__((unused)) __gen_user_data *data, 864 __attribute__((unused)) void * restrict dst, 865 __attribute__((unused)) const struct GFX125_FILTER_COEFFICIENT * restrict values) 866{ 867 uint32_t * restrict dw = (uint32_t * restrict) dst; 868 869 dw[0] = 870 __gen_sfixed(values->FilterCoefficient, 0, 7, 6); 871} 872 873#define GFX125_FRAMEDELTAQP_length 2 874struct GFX125_FRAMEDELTAQP { 875 int32_t FrameDeltaQP[8]; 876}; 877 878static inline __attribute__((always_inline)) void 879GFX125_FRAMEDELTAQP_pack(__attribute__((unused)) __gen_user_data *data, 880 __attribute__((unused)) void * restrict dst, 881 __attribute__((unused)) const struct GFX125_FRAMEDELTAQP * restrict values) 882{ 883 uint32_t * restrict dw = (uint32_t * restrict) dst; 884 885 dw[0] = 886 __gen_sint(values->FrameDeltaQP[0], 0, 7) | 887 __gen_sint(values->FrameDeltaQP[1], 8, 15) | 888 __gen_sint(values->FrameDeltaQP[2], 16, 23) | 889 __gen_sint(values->FrameDeltaQP[3], 24, 31); 890 891 dw[1] = 892 __gen_sint(values->FrameDeltaQP[4], 0, 7) | 893 __gen_sint(values->FrameDeltaQP[5], 8, 15) | 894 __gen_sint(values->FrameDeltaQP[6], 16, 23) | 895 __gen_sint(values->FrameDeltaQP[7], 24, 31); 896} 897 898#define GFX125_FRAMEDELTAQPRANGE_length 2 899struct GFX125_FRAMEDELTAQPRANGE { 900 uint32_t FrameDeltaQPRange[8]; 901}; 902 903static inline __attribute__((always_inline)) void 904GFX125_FRAMEDELTAQPRANGE_pack(__attribute__((unused)) __gen_user_data *data, 905 __attribute__((unused)) void * restrict dst, 906 __attribute__((unused)) const struct GFX125_FRAMEDELTAQPRANGE * restrict values) 907{ 908 uint32_t * restrict dw = (uint32_t * restrict) dst; 909 910 dw[0] = 911 __gen_uint(values->FrameDeltaQPRange[0], 0, 7) | 912 __gen_uint(values->FrameDeltaQPRange[1], 8, 15) | 913 __gen_uint(values->FrameDeltaQPRange[2], 16, 23) | 914 __gen_uint(values->FrameDeltaQPRange[3], 24, 31); 915 916 dw[1] = 917 __gen_uint(values->FrameDeltaQPRange[4], 0, 7) | 918 __gen_uint(values->FrameDeltaQPRange[5], 8, 15) | 919 __gen_uint(values->FrameDeltaQPRange[6], 16, 23) | 920 __gen_uint(values->FrameDeltaQPRange[7], 24, 31); 921} 922 923#define GFX125_GATHER_CONSTANT_ENTRY_length 1 924struct GFX125_GATHER_CONSTANT_ENTRY { 925 uint32_t BindingTableIndexOffset; 926 uint32_t ChannelMask; 927 uint64_t ConstantBufferOffset; 928}; 929 930static inline __attribute__((always_inline)) void 931GFX125_GATHER_CONSTANT_ENTRY_pack(__attribute__((unused)) __gen_user_data *data, 932 __attribute__((unused)) void * restrict dst, 933 __attribute__((unused)) const struct GFX125_GATHER_CONSTANT_ENTRY * restrict values) 934{ 935 uint32_t * restrict dw = (uint32_t * restrict) dst; 936 937 dw[0] = 938 __gen_uint(values->BindingTableIndexOffset, 0, 3) | 939 __gen_uint(values->ChannelMask, 4, 7) | 940 __gen_offset(values->ConstantBufferOffset, 8, 15); 941} 942 943#define GFX125_HEVC_ARBITRATION_PRIORITY_length 1 944struct GFX125_HEVC_ARBITRATION_PRIORITY { 945 uint32_t Priority; 946#define Highestpriority 0 947#define Secondhighestpriority 1 948#define Thirdhighestpriority 2 949#define Lowestpriority 3 950}; 951 952static inline __attribute__((always_inline)) void 953GFX125_HEVC_ARBITRATION_PRIORITY_pack(__attribute__((unused)) __gen_user_data *data, 954 __attribute__((unused)) void * restrict dst, 955 __attribute__((unused)) const struct GFX125_HEVC_ARBITRATION_PRIORITY * restrict values) 956{ 957 uint32_t * restrict dw = (uint32_t * restrict) dst; 958 959 dw[0] = 960 __gen_uint(values->Priority, 0, 1); 961} 962 963#define GFX125_MEMORYADDRESSATTRIBUTES_length 1 964struct GFX125_MEMORYADDRESSATTRIBUTES { 965 uint32_t MOCS; 966 struct GFX125_HEVC_ARBITRATION_PRIORITY ArbitrationPriorityControl; 967 bool MemoryCompressionEnable; 968 uint32_t MemoryCompressionMode; 969 uint32_t RowStoreScratchBufferCacheSelect; 970 uint32_t TiledResourceMode; 971#define TRMODE_NONE 0 972#define TRMODE_TILEYF 1 973#define TRMODE_TILEYS 2 974}; 975 976static inline __attribute__((always_inline)) void 977GFX125_MEMORYADDRESSATTRIBUTES_pack(__attribute__((unused)) __gen_user_data *data, 978 __attribute__((unused)) void * restrict dst, 979 __attribute__((unused)) const struct GFX125_MEMORYADDRESSATTRIBUTES * restrict values) 980{ 981 uint32_t * restrict dw = (uint32_t * restrict) dst; 982 983 uint32_t v0_0; 984 GFX125_HEVC_ARBITRATION_PRIORITY_pack(data, &v0_0, &values->ArbitrationPriorityControl); 985 986 dw[0] = 987 __gen_uint(values->MOCS, 1, 6) | 988 __gen_uint(v0_0, 7, 8) | 989 __gen_uint(values->MemoryCompressionEnable, 9, 9) | 990 __gen_uint(values->MemoryCompressionMode, 10, 10) | 991 __gen_uint(values->RowStoreScratchBufferCacheSelect, 12, 12) | 992 __gen_uint(values->TiledResourceMode, 13, 14); 993} 994 995#define GFX125_HCP_PAK_INSERT_OBJECT_INDIRECT_PAYLOAD_length 4 996struct GFX125_HCP_PAK_INSERT_OBJECT_INDIRECT_PAYLOAD { 997 uint32_t IndirectPayloadDataSizeinbits; 998 __gen_address_type IndirectPayloadBaseAddress; 999 struct GFX125_MEMORYADDRESSATTRIBUTES IndirectPayloadBaseAddress2; 1000}; 1001 1002static inline __attribute__((always_inline)) void 1003GFX125_HCP_PAK_INSERT_OBJECT_INDIRECT_PAYLOAD_pack(__attribute__((unused)) __gen_user_data *data, 1004 __attribute__((unused)) void * restrict dst, 1005 __attribute__((unused)) const struct GFX125_HCP_PAK_INSERT_OBJECT_INDIRECT_PAYLOAD * restrict values) 1006{ 1007 uint32_t * restrict dw = (uint32_t * restrict) dst; 1008 1009 dw[0] = 1010 __gen_uint(values->IndirectPayloadDataSizeinbits, 0, 31); 1011 1012 const uint64_t v1_address = 1013 __gen_address(data, &dw[1], values->IndirectPayloadBaseAddress, 0, 0, 63); 1014 dw[1] = v1_address; 1015 dw[2] = v1_address >> 32; 1016 1017 GFX125_MEMORYADDRESSATTRIBUTES_pack(data, &dw[3], &values->IndirectPayloadBaseAddress2); 1018} 1019 1020#define GFX125_HCP_REF_LIST_ENTRY_length 1 1021struct GFX125_HCP_REF_LIST_ENTRY { 1022 uint32_t ReferencePicturetbValue; 1023 uint32_t ListEntry; 1024 uint32_t ChromaWeightedPrediction; 1025#define Default 0 1026#define Explicit 1 1027 uint32_t LumaWeightedPrediction; 1028#define Default 0 1029#define Explicit 1 1030 bool LongTermReference; 1031 bool FieldPic; 1032 bool TopField; 1033}; 1034 1035static inline __attribute__((always_inline)) void 1036GFX125_HCP_REF_LIST_ENTRY_pack(__attribute__((unused)) __gen_user_data *data, 1037 __attribute__((unused)) void * restrict dst, 1038 __attribute__((unused)) const struct GFX125_HCP_REF_LIST_ENTRY * restrict values) 1039{ 1040 uint32_t * restrict dw = (uint32_t * restrict) dst; 1041 1042 dw[0] = 1043 __gen_uint(values->ReferencePicturetbValue, 0, 7) | 1044 __gen_uint(values->ListEntry, 8, 10) | 1045 __gen_uint(values->ChromaWeightedPrediction, 11, 11) | 1046 __gen_uint(values->LumaWeightedPrediction, 12, 12) | 1047 __gen_uint(values->LongTermReference, 13, 13) | 1048 __gen_uint(values->FieldPic, 14, 14) | 1049 __gen_uint(values->TopField, 15, 15); 1050} 1051 1052#define GFX125_HCP_TILE_POSITION_IN_CTB_length 1 1053struct GFX125_HCP_TILE_POSITION_IN_CTB { 1054 uint32_t CtbPos0i; 1055 uint32_t CtbPos1i; 1056 uint32_t CtbPos2i; 1057 uint32_t CtbPos3i; 1058}; 1059 1060static inline __attribute__((always_inline)) void 1061GFX125_HCP_TILE_POSITION_IN_CTB_pack(__attribute__((unused)) __gen_user_data *data, 1062 __attribute__((unused)) void * restrict dst, 1063 __attribute__((unused)) const struct GFX125_HCP_TILE_POSITION_IN_CTB * restrict values) 1064{ 1065 uint32_t * restrict dw = (uint32_t * restrict) dst; 1066 1067 dw[0] = 1068 __gen_uint(values->CtbPos0i, 0, 7) | 1069 __gen_uint(values->CtbPos1i, 8, 15) | 1070 __gen_uint(values->CtbPos2i, 16, 23) | 1071 __gen_uint(values->CtbPos3i, 24, 31); 1072} 1073 1074#define GFX125_HCP_TILE_POSITION_IN_CTB_MSB_length 2 1075struct GFX125_HCP_TILE_POSITION_IN_CTB_MSB { 1076 uint32_t CtbRowPositionofTileColumn[22]; 1077}; 1078 1079static inline __attribute__((always_inline)) void 1080GFX125_HCP_TILE_POSITION_IN_CTB_MSB_pack(__attribute__((unused)) __gen_user_data *data, 1081 __attribute__((unused)) void * restrict dst, 1082 __attribute__((unused)) const struct GFX125_HCP_TILE_POSITION_IN_CTB_MSB * restrict values) 1083{ 1084 uint32_t * restrict dw = (uint32_t * restrict) dst; 1085 1086 dw[0] = 1087 __gen_uint(values->CtbRowPositionofTileColumn[0], 0, 1) | 1088 __gen_uint(values->CtbRowPositionofTileColumn[1], 2, 3) | 1089 __gen_uint(values->CtbRowPositionofTileColumn[2], 4, 5) | 1090 __gen_uint(values->CtbRowPositionofTileColumn[3], 6, 7) | 1091 __gen_uint(values->CtbRowPositionofTileColumn[4], 8, 9) | 1092 __gen_uint(values->CtbRowPositionofTileColumn[5], 10, 11) | 1093 __gen_uint(values->CtbRowPositionofTileColumn[6], 12, 13) | 1094 __gen_uint(values->CtbRowPositionofTileColumn[7], 14, 15) | 1095 __gen_uint(values->CtbRowPositionofTileColumn[8], 16, 17) | 1096 __gen_uint(values->CtbRowPositionofTileColumn[9], 18, 19) | 1097 __gen_uint(values->CtbRowPositionofTileColumn[10], 20, 21) | 1098 __gen_uint(values->CtbRowPositionofTileColumn[11], 22, 23) | 1099 __gen_uint(values->CtbRowPositionofTileColumn[12], 24, 25) | 1100 __gen_uint(values->CtbRowPositionofTileColumn[13], 26, 27) | 1101 __gen_uint(values->CtbRowPositionofTileColumn[14], 28, 29) | 1102 __gen_uint(values->CtbRowPositionofTileColumn[15], 30, 31); 1103 1104 dw[1] = 1105 __gen_uint(values->CtbRowPositionofTileColumn[16], 0, 1) | 1106 __gen_uint(values->CtbRowPositionofTileColumn[17], 2, 3) | 1107 __gen_uint(values->CtbRowPositionofTileColumn[18], 4, 5) | 1108 __gen_uint(values->CtbRowPositionofTileColumn[19], 6, 7) | 1109 __gen_uint(values->CtbRowPositionofTileColumn[20], 8, 9) | 1110 __gen_uint(values->CtbRowPositionofTileColumn[21], 10, 11); 1111} 1112 1113#define GFX125_HCP_WEIGHTOFFSET_CHROMA_ENTRY_length 1 1114struct GFX125_HCP_WEIGHTOFFSET_CHROMA_ENTRY { 1115 int32_t DeltaChromaWeightLX0; 1116 uint32_t ChromaOffsetLX0; 1117 int32_t DeltaChromaWeightLX1; 1118 uint32_t ChromaOffsetLX1; 1119}; 1120 1121static inline __attribute__((always_inline)) void 1122GFX125_HCP_WEIGHTOFFSET_CHROMA_ENTRY_pack(__attribute__((unused)) __gen_user_data *data, 1123 __attribute__((unused)) void * restrict dst, 1124 __attribute__((unused)) const struct GFX125_HCP_WEIGHTOFFSET_CHROMA_ENTRY * restrict values) 1125{ 1126 uint32_t * restrict dw = (uint32_t * restrict) dst; 1127 1128 dw[0] = 1129 __gen_sint(values->DeltaChromaWeightLX0, 0, 7) | 1130 __gen_uint(values->ChromaOffsetLX0, 8, 15) | 1131 __gen_sint(values->DeltaChromaWeightLX1, 16, 23) | 1132 __gen_uint(values->ChromaOffsetLX1, 24, 31); 1133} 1134 1135#define GFX125_HCP_WEIGHTOFFSET_CHROMA_EXT_ENTRY_length 1 1136struct GFX125_HCP_WEIGHTOFFSET_CHROMA_EXT_ENTRY { 1137 uint32_t ChromaOffsetLX0MSBytei; 1138 uint32_t ChromaOffsetLX0MSBytei1; 1139 uint32_t ChromaOffsetLX1MSBytei; 1140 uint32_t ChromaOffsetLX1MSBytei1; 1141}; 1142 1143static inline __attribute__((always_inline)) void 1144GFX125_HCP_WEIGHTOFFSET_CHROMA_EXT_ENTRY_pack(__attribute__((unused)) __gen_user_data *data, 1145 __attribute__((unused)) void * restrict dst, 1146 __attribute__((unused)) const struct GFX125_HCP_WEIGHTOFFSET_CHROMA_EXT_ENTRY * restrict values) 1147{ 1148 uint32_t * restrict dw = (uint32_t * restrict) dst; 1149 1150 dw[0] = 1151 __gen_uint(values->ChromaOffsetLX0MSBytei, 0, 7) | 1152 __gen_uint(values->ChromaOffsetLX0MSBytei1, 8, 15) | 1153 __gen_uint(values->ChromaOffsetLX1MSBytei, 16, 23) | 1154 __gen_uint(values->ChromaOffsetLX1MSBytei1, 24, 31); 1155} 1156 1157#define GFX125_HCP_WEIGHTOFFSET_LUMA_ENTRY_length 1 1158struct GFX125_HCP_WEIGHTOFFSET_LUMA_ENTRY { 1159 int32_t DeltaLumaWeightLX; 1160 uint32_t LumaOffsetLX; 1161 uint32_t LumaOffsetLXMSByte; 1162}; 1163 1164static inline __attribute__((always_inline)) void 1165GFX125_HCP_WEIGHTOFFSET_LUMA_ENTRY_pack(__attribute__((unused)) __gen_user_data *data, 1166 __attribute__((unused)) void * restrict dst, 1167 __attribute__((unused)) const struct GFX125_HCP_WEIGHTOFFSET_LUMA_ENTRY * restrict values) 1168{ 1169 uint32_t * restrict dw = (uint32_t * restrict) dst; 1170 1171 dw[0] = 1172 __gen_sint(values->DeltaLumaWeightLX, 0, 7) | 1173 __gen_uint(values->LumaOffsetLX, 8, 15) | 1174 __gen_uint(values->LumaOffsetLXMSByte, 24, 31); 1175} 1176 1177#define GFX125_HEVC_VP9_RDOQ_LAMBDA_FIELDS_length 1 1178struct GFX125_HEVC_VP9_RDOQ_LAMBDA_FIELDS { 1179 uint32_t LambdaValue0; 1180 uint32_t LambdaValue1; 1181}; 1182 1183static inline __attribute__((always_inline)) void 1184GFX125_HEVC_VP9_RDOQ_LAMBDA_FIELDS_pack(__attribute__((unused)) __gen_user_data *data, 1185 __attribute__((unused)) void * restrict dst, 1186 __attribute__((unused)) const struct GFX125_HEVC_VP9_RDOQ_LAMBDA_FIELDS * restrict values) 1187{ 1188 uint32_t * restrict dw = (uint32_t * restrict) dst; 1189 1190 dw[0] = 1191 __gen_uint(values->LambdaValue0, 0, 15) | 1192 __gen_uint(values->LambdaValue1, 16, 31); 1193} 1194 1195#define GFX125_HUC_VIRTUAL_ADDR_REGION_length 3 1196struct GFX125_HUC_VIRTUAL_ADDR_REGION { 1197 __gen_address_type Address; 1198 struct GFX125_MEMORYADDRESSATTRIBUTES MemoryAddressAttributes; 1199}; 1200 1201static inline __attribute__((always_inline)) void 1202GFX125_HUC_VIRTUAL_ADDR_REGION_pack(__attribute__((unused)) __gen_user_data *data, 1203 __attribute__((unused)) void * restrict dst, 1204 __attribute__((unused)) const struct GFX125_HUC_VIRTUAL_ADDR_REGION * restrict values) 1205{ 1206 uint32_t * restrict dw = (uint32_t * restrict) dst; 1207 1208 const uint64_t v0_address = 1209 __gen_address(data, &dw[0], values->Address, 0, 0, 63); 1210 dw[0] = v0_address; 1211 dw[1] = v0_address >> 32; 1212 1213 GFX125_MEMORYADDRESSATTRIBUTES_pack(data, &dw[2], &values->MemoryAddressAttributes); 1214} 1215 1216#define GFX125_IMAGE_STATE_COST_length 2 1217struct GFX125_IMAGE_STATE_COST { 1218 uint32_t MV0Cost; 1219 uint32_t MV1Cost; 1220 uint32_t MV2Cost; 1221 uint32_t MV3Cost; 1222 uint32_t MV4Cost; 1223 uint32_t MV5Cost; 1224 uint32_t MV6Cost; 1225 uint32_t MV7Cost; 1226}; 1227 1228static inline __attribute__((always_inline)) void 1229GFX125_IMAGE_STATE_COST_pack(__attribute__((unused)) __gen_user_data *data, 1230 __attribute__((unused)) void * restrict dst, 1231 __attribute__((unused)) const struct GFX125_IMAGE_STATE_COST * restrict values) 1232{ 1233 uint32_t * restrict dw = (uint32_t * restrict) dst; 1234 1235 dw[0] = 1236 __gen_uint(values->MV0Cost, 0, 7) | 1237 __gen_uint(values->MV1Cost, 8, 15) | 1238 __gen_uint(values->MV2Cost, 16, 23) | 1239 __gen_uint(values->MV3Cost, 24, 31); 1240 1241 dw[1] = 1242 __gen_uint(values->MV4Cost, 0, 7) | 1243 __gen_uint(values->MV5Cost, 8, 15) | 1244 __gen_uint(values->MV6Cost, 16, 23) | 1245 __gen_uint(values->MV7Cost, 24, 31); 1246} 1247 1248#define GFX125_INLINE_DATA_DESCRIPTION_FOR_MFD_AVC_BSD_OBJECT_length 3 1249struct GFX125_INLINE_DATA_DESCRIPTION_FOR_MFD_AVC_BSD_OBJECT { 1250 bool MBErrorConcealmentPSliceWeightPredictionDisable; 1251 bool MBErrorConcealmentPSliceMotionVectorsOverrideDisable; 1252 bool MBErrorConcealmentBSpatialWeightPredictionDisable; 1253 bool MBErrorConcealmentBSpatialMotionVectorsOverrideDisable; 1254 uint32_t MBErrorConcealmentBSpatialPredictionMode; 1255 bool MBHeaderErrorHandling; 1256 bool EntropyErrorHandling; 1257 bool MPRErrorHandling; 1258 bool BSDPrematureCompleteErrorHandling; 1259 uint32_t ConcealmentPictureID; 1260 bool MBErrorConcealmentBTemporalWeightPredictionDisable; 1261 bool MBErrorConcealmentBTemporalMotionVectorsOverrideEnable; 1262 uint32_t MBErrorConcealmentBTemporalPredictionMode; 1263 bool IntraPredMode4x48x8LumaErrorControl; 1264 bool InitCurrentMBNumber; 1265 uint32_t ConcealmentMethod; 1266 uint32_t FirstMBBitOffset; 1267 bool LastSlice; 1268 bool EmulationPreventionBytePresent; 1269 bool FixPrevMBSkipped; 1270 uint32_t FirstMBByteOffsetofSliceDataorSliceHeader; 1271 bool IntraPredictionErrorControl; 1272 bool Intra8x84x4PredictionErrorConcealmentControl; 1273 uint32_t BSliceTemporalInterConcealmentMode; 1274 uint32_t BSliceSpatialInterConcealmentMode; 1275 uint32_t BSliceInterDirectTypeConcealmentMode; 1276 uint32_t BSliceConcealmentMode; 1277#define IntraConcealment 1 1278#define InterConcealment 0 1279 uint32_t PSliceInterConcealmentMode; 1280 uint32_t PSliceConcealmentMode; 1281#define IntraConcealment 1 1282#define InterConcealment 0 1283 uint32_t ConcealmentReferencePictureFieldBit; 1284 uint32_t ISliceConcealmentMode; 1285#define IntraConcealment 1 1286#define InterConcealment 0 1287}; 1288 1289static inline __attribute__((always_inline)) void 1290GFX125_INLINE_DATA_DESCRIPTION_FOR_MFD_AVC_BSD_OBJECT_pack(__attribute__((unused)) __gen_user_data *data, 1291 __attribute__((unused)) void * restrict dst, 1292 __attribute__((unused)) const struct GFX125_INLINE_DATA_DESCRIPTION_FOR_MFD_AVC_BSD_OBJECT * restrict values) 1293{ 1294 uint32_t * restrict dw = (uint32_t * restrict) dst; 1295 1296 dw[0] = 1297 __gen_uint(values->MBErrorConcealmentPSliceWeightPredictionDisable, 0, 0) | 1298 __gen_uint(values->MBErrorConcealmentPSliceMotionVectorsOverrideDisable, 1, 1) | 1299 __gen_uint(values->MBErrorConcealmentBSpatialWeightPredictionDisable, 3, 3) | 1300 __gen_uint(values->MBErrorConcealmentBSpatialMotionVectorsOverrideDisable, 4, 4) | 1301 __gen_uint(values->MBErrorConcealmentBSpatialPredictionMode, 6, 7) | 1302 __gen_uint(values->MBHeaderErrorHandling, 8, 8) | 1303 __gen_uint(values->EntropyErrorHandling, 10, 10) | 1304 __gen_uint(values->MPRErrorHandling, 12, 12) | 1305 __gen_uint(values->BSDPrematureCompleteErrorHandling, 14, 14) | 1306 __gen_uint(values->ConcealmentPictureID, 16, 21) | 1307 __gen_uint(values->MBErrorConcealmentBTemporalWeightPredictionDisable, 24, 24) | 1308 __gen_uint(values->MBErrorConcealmentBTemporalMotionVectorsOverrideEnable, 25, 25) | 1309 __gen_uint(values->MBErrorConcealmentBTemporalPredictionMode, 27, 28) | 1310 __gen_uint(values->IntraPredMode4x48x8LumaErrorControl, 29, 29) | 1311 __gen_uint(values->InitCurrentMBNumber, 30, 30) | 1312 __gen_uint(values->ConcealmentMethod, 31, 31); 1313 1314 dw[1] = 1315 __gen_uint(values->FirstMBBitOffset, 0, 2) | 1316 __gen_uint(values->LastSlice, 3, 3) | 1317 __gen_uint(values->EmulationPreventionBytePresent, 4, 4) | 1318 __gen_uint(values->FixPrevMBSkipped, 7, 7) | 1319 __gen_uint(values->FirstMBByteOffsetofSliceDataorSliceHeader, 16, 31); 1320 1321 dw[2] = 1322 __gen_uint(values->IntraPredictionErrorControl, 0, 0) | 1323 __gen_uint(values->Intra8x84x4PredictionErrorConcealmentControl, 1, 1) | 1324 __gen_uint(values->BSliceTemporalInterConcealmentMode, 4, 6) | 1325 __gen_uint(values->BSliceSpatialInterConcealmentMode, 8, 10) | 1326 __gen_uint(values->BSliceInterDirectTypeConcealmentMode, 12, 13) | 1327 __gen_uint(values->BSliceConcealmentMode, 15, 15) | 1328 __gen_uint(values->PSliceInterConcealmentMode, 16, 18) | 1329 __gen_uint(values->PSliceConcealmentMode, 23, 23) | 1330 __gen_uint(values->ConcealmentReferencePictureFieldBit, 24, 29) | 1331 __gen_uint(values->ISliceConcealmentMode, 31, 31); 1332} 1333 1334#define GFX125_INTERFACE_DESCRIPTOR_DATA_length 8 1335struct GFX125_INTERFACE_DESCRIPTOR_DATA { 1336 uint64_t KernelStartPointer; 1337 bool SoftwareExceptionEnable; 1338 bool MaskStackExceptionEnable; 1339 bool IllegalOpcodeExceptionEnable; 1340 uint32_t FloatingPointMode; 1341#define IEEE754 0 1342#define Alternate 1 1343 bool SingleProgramFlow; 1344 uint32_t DenormMode; 1345#define Ftz 0 1346#define SetByKernel 1 1347 uint32_t ThreadPreemptionDisable; 1348 uint32_t SamplerCount; 1349#define Nosamplersused 0 1350#define Between1and4samplersused 1 1351#define Between5and8samplersused 2 1352#define Between9and12samplersused 3 1353#define Between13and16samplersused 4 1354 uint64_t SamplerStatePointer; 1355 uint32_t BindingTableEntryCount; 1356 uint64_t BindingTablePointer; 1357 uint32_t NumberofThreadsinGPGPUThreadGroup; 1358 uint32_t SharedLocalMemorySize; 1359#define Encodes0K 0 1360#define Encodes1K 1 1361#define Encodes2K 2 1362#define Encodes4K 3 1363#define Encodes8K 4 1364#define Encodes16K 5 1365#define Encodes32K 6 1366#define Encodes64K 7 1367 bool BarrierEnable; 1368 uint32_t RoundingMode; 1369#define RTNE 0 1370#define RU 1 1371#define RD 2 1372#define RTZ 3 1373 uint32_t Threadgroupdispatchsize; 1374#define TGsize8 0 1375#define TGsize16 1 1376 uint32_t NumberOfBarriers; 1377#define BARRIER_SIZE_NONE 0 1378#define BARRIER_SIZE_B1 1 1379#define BARRIER_SIZE_B2 2 1380#define BARRIER_SIZE_B4 3 1381#define BARRIER_SIZE_B8 4 1382#define BARRIER_SIZE_B16 5 1383#define BARRIER_SIZE_B24 6 1384#define BARRIER_SIZE_B32 7 1385 uint32_t BTDMode; 1386}; 1387 1388static inline __attribute__((always_inline)) void 1389GFX125_INTERFACE_DESCRIPTOR_DATA_pack(__attribute__((unused)) __gen_user_data *data, 1390 __attribute__((unused)) void * restrict dst, 1391 __attribute__((unused)) const struct GFX125_INTERFACE_DESCRIPTOR_DATA * restrict values) 1392{ 1393 uint32_t * restrict dw = (uint32_t * restrict) dst; 1394 1395 dw[0] = 1396 __gen_offset(values->KernelStartPointer, 6, 31); 1397 1398 dw[1] = 0; 1399 1400 dw[2] = 1401 __gen_uint(values->SoftwareExceptionEnable, 7, 7) | 1402 __gen_uint(values->MaskStackExceptionEnable, 11, 11) | 1403 __gen_uint(values->IllegalOpcodeExceptionEnable, 13, 13) | 1404 __gen_uint(values->FloatingPointMode, 16, 16) | 1405 __gen_uint(values->SingleProgramFlow, 18, 18) | 1406 __gen_uint(values->DenormMode, 19, 19) | 1407 __gen_uint(values->ThreadPreemptionDisable, 20, 20); 1408 1409 dw[3] = 1410 __gen_uint(values->SamplerCount, 2, 4) | 1411 __gen_offset(values->SamplerStatePointer, 5, 31); 1412 1413 dw[4] = 1414 __gen_uint(values->BindingTableEntryCount, 0, 4) | 1415 __gen_offset(values->BindingTablePointer, 5, 20); 1416 1417 dw[5] = 1418 __gen_uint(values->NumberofThreadsinGPGPUThreadGroup, 0, 9) | 1419 __gen_uint(values->SharedLocalMemorySize, 16, 20) | 1420 __gen_uint(values->BarrierEnable, 21, 21) | 1421 __gen_uint(values->RoundingMode, 22, 23) | 1422 __gen_uint(values->Threadgroupdispatchsize, 27, 27) | 1423 __gen_uint(values->NumberOfBarriers, 28, 30) | 1424 __gen_uint(values->BTDMode, 31, 31); 1425 1426 dw[6] = 0; 1427 1428 dw[7] = 0; 1429} 1430 1431#define GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_length 4 1432struct GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY { 1433 float Table0XFilterCoefficientn0; 1434 float Table0YFilterCoefficientn0; 1435 float Table0XFilterCoefficientn1; 1436 float Table0YFilterCoefficientn1; 1437 float Table0XFilterCoefficientn2; 1438 float Table0YFilterCoefficientn2; 1439 float Table0XFilterCoefficientn3; 1440 float Table0YFilterCoefficientn3; 1441 float Table0XFilterCoefficientn4; 1442 float Table0YFilterCoefficientn4; 1443 float Table0XFilterCoefficientn5; 1444 float Table0YFilterCoefficientn5; 1445 float Table0XFilterCoefficientn6; 1446 float Table0YFilterCoefficientn6; 1447 float Table0XFilterCoefficientn7; 1448 float Table0YFilterCoefficientn7; 1449}; 1450 1451static inline __attribute__((always_inline)) void 1452GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(__attribute__((unused)) __gen_user_data *data, 1453 __attribute__((unused)) void * restrict dst, 1454 __attribute__((unused)) const struct GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY * restrict values) 1455{ 1456 uint32_t * restrict dw = (uint32_t * restrict) dst; 1457 1458 dw[0] = 1459 __gen_sfixed(values->Table0XFilterCoefficientn0, 0, 7, 6) | 1460 __gen_sfixed(values->Table0YFilterCoefficientn0, 8, 15, 6) | 1461 __gen_sfixed(values->Table0XFilterCoefficientn1, 16, 23, 6) | 1462 __gen_sfixed(values->Table0YFilterCoefficientn1, 24, 31, 6); 1463 1464 dw[1] = 1465 __gen_sfixed(values->Table0XFilterCoefficientn2, 0, 7, 6) | 1466 __gen_sfixed(values->Table0YFilterCoefficientn2, 8, 15, 6) | 1467 __gen_sfixed(values->Table0XFilterCoefficientn3, 16, 23, 6) | 1468 __gen_sfixed(values->Table0YFilterCoefficientn3, 24, 31, 6); 1469 1470 dw[2] = 1471 __gen_sfixed(values->Table0XFilterCoefficientn4, 0, 7, 6) | 1472 __gen_sfixed(values->Table0YFilterCoefficientn4, 8, 15, 6) | 1473 __gen_sfixed(values->Table0XFilterCoefficientn5, 16, 23, 6) | 1474 __gen_sfixed(values->Table0YFilterCoefficientn5, 24, 31, 6); 1475 1476 dw[3] = 1477 __gen_sfixed(values->Table0XFilterCoefficientn6, 0, 7, 6) | 1478 __gen_sfixed(values->Table0YFilterCoefficientn6, 8, 15, 6) | 1479 __gen_sfixed(values->Table0XFilterCoefficientn7, 16, 23, 6) | 1480 __gen_sfixed(values->Table0YFilterCoefficientn7, 24, 31, 6); 1481} 1482 1483#define GFX125_MFD_MPEG2_BSD_OBJECT_INLINE_DATA_DESCRIPTION_length 2 1484struct GFX125_MFD_MPEG2_BSD_OBJECT_INLINE_DATA_DESCRIPTION { 1485 uint32_t FirstMBBitOffset; 1486 bool LastMB; 1487 bool LastPicSlice; 1488 uint32_t SliceConcealmentType; 1489 uint32_t SliceConcealmentOverride; 1490 uint32_t MBCount; 1491 uint32_t SliceVerticalPosition; 1492 uint32_t SliceHorizontalPosition; 1493 uint32_t NextSliceHorizontalPosition; 1494 uint32_t NextSliceVerticalPosition; 1495 uint32_t QuantizerScaleCode; 1496}; 1497 1498static inline __attribute__((always_inline)) void 1499GFX125_MFD_MPEG2_BSD_OBJECT_INLINE_DATA_DESCRIPTION_pack(__attribute__((unused)) __gen_user_data *data, 1500 __attribute__((unused)) void * restrict dst, 1501 __attribute__((unused)) const struct GFX125_MFD_MPEG2_BSD_OBJECT_INLINE_DATA_DESCRIPTION * restrict values) 1502{ 1503 uint32_t * restrict dw = (uint32_t * restrict) dst; 1504 1505 dw[0] = 1506 __gen_uint(values->FirstMBBitOffset, 0, 2) | 1507 __gen_uint(values->LastMB, 3, 3) | 1508 __gen_uint(values->LastPicSlice, 5, 5) | 1509 __gen_uint(values->SliceConcealmentType, 6, 6) | 1510 __gen_uint(values->SliceConcealmentOverride, 7, 7) | 1511 __gen_uint(values->MBCount, 8, 15) | 1512 __gen_uint(values->SliceVerticalPosition, 16, 23) | 1513 __gen_uint(values->SliceHorizontalPosition, 24, 31); 1514 1515 dw[1] = 1516 __gen_uint(values->NextSliceHorizontalPosition, 0, 7) | 1517 __gen_uint(values->NextSliceVerticalPosition, 8, 16) | 1518 __gen_uint(values->QuantizerScaleCode, 24, 28); 1519} 1520 1521#define GFX125_MI_MATH_ALU_INSTRUCTION_length 1 1522struct GFX125_MI_MATH_ALU_INSTRUCTION { 1523 uint32_t Operand2; 1524#define MI_ALU_REG0 0 1525#define MI_ALU_REG1 1 1526#define MI_ALU_REG2 2 1527#define MI_ALU_REG3 3 1528#define MI_ALU_REG4 4 1529#define MI_ALU_REG5 5 1530#define MI_ALU_REG6 6 1531#define MI_ALU_REG7 7 1532#define MI_ALU_REG8 8 1533#define MI_ALU_REG9 9 1534#define MI_ALU_REG10 10 1535#define MI_ALU_REG11 11 1536#define MI_ALU_REG12 12 1537#define MI_ALU_REG13 13 1538#define MI_ALU_REG14 14 1539#define MI_ALU_REG15 15 1540#define MI_ALU_SRCA 32 1541#define MI_ALU_SRCB 33 1542#define MI_ALU_ACCU 49 1543#define MI_ALU_ZF 50 1544#define MI_ALU_CF 51 1545 uint32_t Operand1; 1546#define MI_ALU_REG0 0 1547#define MI_ALU_REG1 1 1548#define MI_ALU_REG2 2 1549#define MI_ALU_REG3 3 1550#define MI_ALU_REG4 4 1551#define MI_ALU_REG5 5 1552#define MI_ALU_REG6 6 1553#define MI_ALU_REG7 7 1554#define MI_ALU_REG8 8 1555#define MI_ALU_REG9 9 1556#define MI_ALU_REG10 10 1557#define MI_ALU_REG11 11 1558#define MI_ALU_REG12 12 1559#define MI_ALU_REG13 13 1560#define MI_ALU_REG14 14 1561#define MI_ALU_REG15 15 1562#define MI_ALU_SRCA 32 1563#define MI_ALU_SRCB 33 1564#define MI_ALU_ACCU 49 1565#define MI_ALU_ZF 50 1566#define MI_ALU_CF 51 1567 uint32_t ALUOpcode; 1568#define MI_ALU_NOOP 0 1569#define MI_ALU_FENCE_RD 1 1570#define MI_ALU_FENCE_WR 2 1571#define MI_ALU_LOAD 128 1572#define MI_ALU_LOADINV 1152 1573#define MI_ALU_LOAD0 129 1574#define MI_ALU_LOAD1 1153 1575#define MI_ALU_LOADIND 130 1576#define MI_ALU_ADD 256 1577#define MI_ALU_SUB 257 1578#define MI_ALU_AND 258 1579#define MI_ALU_OR 259 1580#define MI_ALU_XOR 260 1581#define MI_ALU_SHL 261 1582#define MI_ALU_SHR 262 1583#define MI_ALU_SAR 263 1584#define MI_ALU_STORE 384 1585#define MI_ALU_STOREINV 1408 1586#define MI_ALU_STOREIND 385 1587}; 1588 1589static inline __attribute__((always_inline)) void 1590GFX125_MI_MATH_ALU_INSTRUCTION_pack(__attribute__((unused)) __gen_user_data *data, 1591 __attribute__((unused)) void * restrict dst, 1592 __attribute__((unused)) const struct GFX125_MI_MATH_ALU_INSTRUCTION * restrict values) 1593{ 1594 uint32_t * restrict dw = (uint32_t * restrict) dst; 1595 1596 dw[0] = 1597 __gen_uint(values->Operand2, 0, 9) | 1598 __gen_uint(values->Operand1, 10, 19) | 1599 __gen_uint(values->ALUOpcode, 20, 31); 1600} 1601 1602#define GFX125_PALETTE_ENTRY_length 1 1603struct GFX125_PALETTE_ENTRY { 1604 uint32_t Blue; 1605 uint32_t Green; 1606 uint32_t Red; 1607 uint32_t Alpha; 1608}; 1609 1610static inline __attribute__((always_inline)) void 1611GFX125_PALETTE_ENTRY_pack(__attribute__((unused)) __gen_user_data *data, 1612 __attribute__((unused)) void * restrict dst, 1613 __attribute__((unused)) const struct GFX125_PALETTE_ENTRY * restrict values) 1614{ 1615 uint32_t * restrict dw = (uint32_t * restrict) dst; 1616 1617 dw[0] = 1618 __gen_uint(values->Blue, 0, 7) | 1619 __gen_uint(values->Green, 8, 15) | 1620 __gen_uint(values->Red, 16, 23) | 1621 __gen_uint(values->Alpha, 24, 31); 1622} 1623 1624#define GFX125_POSTSYNC_DATA_length 5 1625struct GFX125_POSTSYNC_DATA { 1626 uint32_t MOCS[2]; 1627 bool L3flush[2]; 1628 bool HDCPipelineFlush[2]; 1629 uint32_t Operation[2]; 1630 __gen_address_type DestinationAddress; 1631 uint64_t ImmediateData; 1632}; 1633 1634static inline __attribute__((always_inline)) void 1635GFX125_POSTSYNC_DATA_pack(__attribute__((unused)) __gen_user_data *data, 1636 __attribute__((unused)) void * restrict dst, 1637 __attribute__((unused)) const struct GFX125_POSTSYNC_DATA * restrict values) 1638{ 1639 uint32_t * restrict dw = (uint32_t * restrict) dst; 1640 1641 dw[0] = 1642 __gen_uint(values->MOCS[0], 4, 10) | 1643 __gen_uint(values->L3flush[0], 3, 3) | 1644 __gen_uint(values->HDCPipelineFlush[0], 2, 2) | 1645 __gen_uint(values->Operation[0], 0, 1) | 1646 __gen_uint(values->MOCS[1], 15, 21) | 1647 __gen_uint(values->L3flush[1], 14, 14) | 1648 __gen_uint(values->HDCPipelineFlush[1], 13, 13) | 1649 __gen_uint(values->Operation[1], 11, 12); 1650 1651 const uint64_t v1_address = 1652 __gen_address(data, &dw[1], values->DestinationAddress, 0, 0, 63); 1653 dw[1] = v1_address; 1654 dw[2] = v1_address >> 32; 1655 1656 const uint64_t v3 = 1657 __gen_uint(values->ImmediateData, 0, 63); 1658 dw[3] = v3; 1659 dw[4] = v3 >> 32; 1660} 1661 1662#define GFX125_RENDER_SURFACE_STATE_length 16 1663struct GFX125_RENDER_SURFACE_STATE { 1664 bool CubeFaceEnablePositiveZ; 1665 bool CubeFaceEnableNegativeZ; 1666 bool CubeFaceEnablePositiveY; 1667 bool CubeFaceEnableNegativeY; 1668 bool CubeFaceEnablePositiveX; 1669 bool CubeFaceEnableNegativeX; 1670 uint32_t MediaBoundaryPixelMode; 1671#define NORMAL_MODE 0 1672#define PROGRESSIVE_FRAME 2 1673#define INTERLACED_FRAME 3 1674 uint32_t RenderCacheReadWriteMode; 1675#define WriteOnlyCache 0 1676#define ReadWriteCache 1 1677 bool SamplerL2BypassModeDisable; 1678 uint32_t VerticalLineStrideOffset; 1679 uint32_t VerticalLineStride; 1680 uint32_t TileMode; 1681#define LINEAR 0 1682#define TILE64 1 1683#define XMAJOR 2 1684#define TILE4 3 1685 uint32_t SurfaceHorizontalAlignment; 1686#define HALIGN_16 0 1687#define HALIGN_32 1 1688#define HALIGN_64 2 1689#define HALIGN_128 3 1690 uint32_t SurfaceVerticalAlignment; 1691#define VALIGN_4 1 1692#define VALIGN_8 2 1693#define VALIGN_16 3 1694 uint32_t SurfaceFormat; 1695 bool SurfaceArray; 1696 uint32_t SurfaceType; 1697#define SURFTYPE_1D 0 1698#define SURFTYPE_2D 1 1699#define SURFTYPE_3D 2 1700#define SURFTYPE_CUBE 3 1701#define SURFTYPE_BUFFER 4 1702#define SURFTYPE_STRBUF 5 1703#define SURFTYPE_SCRATCH 6 1704#define SURFTYPE_NULL 7 1705 uint32_t SurfaceQPitch; 1706 bool SampleTapDiscardDisable; 1707 bool DoubleFetchDisable; 1708 uint32_t CornerTexelMode; 1709 float BaseMipLevel; 1710 uint32_t MOCS; 1711 bool EnableUnormPathInColorPipe; 1712 uint32_t Width; 1713 uint32_t Height; 1714 bool DepthStencilResource; 1715 uint32_t SurfacePitch; 1716 uint32_t NullProbingEnable; 1717 uint32_t StandardTilingModeExtensions; 1718 uint32_t TileAddressMappingMode; 1719#define Gfx9 0 1720#define Gfx10 1 1721 uint32_t Depth; 1722 uint32_t MultisamplePositionPaletteIndex; 1723 uint32_t NumberofMultisamples; 1724#define MULTISAMPLECOUNT_1 0 1725#define MULTISAMPLECOUNT_2 1 1726#define MULTISAMPLECOUNT_4 2 1727#define MULTISAMPLECOUNT_8 3 1728#define MULTISAMPLECOUNT_16 4 1729 uint32_t MultisampledSurfaceStorageFormat; 1730#define MSFMT_MSS 0 1731#define MSFMT_DEPTH_STENCIL 1 1732 uint32_t RenderTargetViewExtent; 1733 uint32_t MinimumArrayElement; 1734 uint32_t RenderTargetAndSampleUnormRotation; 1735#define _0DEG 0 1736#define _90DEG 1 1737#define _180DEG 2 1738#define _270DEG 3 1739 uint32_t MIPCountLOD; 1740 uint32_t SurfaceMinLOD; 1741 uint32_t MipTailStartLOD; 1742 uint32_t CoherencyType; 1743#define GPUcoherent 0 1744#define IAcoherent 1 1745 uint32_t TiledResourceMode; 1746#define NONE 0 1747#define _4KB 1 1748#define _64KB 2 1749#define TILEYF 1 1750#define TILEYS 2 1751 bool EWADisableForCube; 1752 uint32_t YOffset; 1753 uint32_t XOffset; 1754 uint32_t AuxiliarySurfaceMode; 1755#define AUX_NONE 0 1756#define AUX_CCS_D 1 1757#define AUX_APPEND 2 1758#define AUX_MCS_LCE 4 1759#define AUX_CCS_E 5 1760 uint32_t YOffsetforUorUVPlane; 1761 uint32_t AuxiliarySurfacePitch; 1762 bool YUVInterpolationEnable; 1763 uint32_t AuxiliarySurfaceQPitch; 1764 uint32_t XOffsetforUorUVPlane; 1765 uint32_t HalfPitchforChroma; 1766 bool SeparateUVPlaneEnable; 1767 float ResourceMinLOD; 1768 enum GFX125_ShaderChannelSelect ShaderChannelSelectAlpha; 1769 enum GFX125_ShaderChannelSelect ShaderChannelSelectBlue; 1770 enum GFX125_ShaderChannelSelect ShaderChannelSelectGreen; 1771 enum GFX125_ShaderChannelSelect ShaderChannelSelectRed; 1772 bool MemoryCompressionEnable; 1773 uint32_t MemoryCompressionMode; 1774#define Horizontal 0 1775 __gen_address_type SurfaceBaseAddress; 1776 uint32_t QuiltWidth; 1777 uint32_t QuiltHeight; 1778 bool ClearValueAddressEnable; 1779 uint32_t CachingExpandedFormats; 1780 __gen_address_type AuxiliarySurfaceBaseAddress; 1781 uint32_t RenderCompressionFormat; 1782 __gen_address_type ClearValueAddress; 1783}; 1784 1785static inline __attribute__((always_inline)) void 1786GFX125_RENDER_SURFACE_STATE_pack(__attribute__((unused)) __gen_user_data *data, 1787 __attribute__((unused)) void * restrict dst, 1788 __attribute__((unused)) const struct GFX125_RENDER_SURFACE_STATE * restrict values) 1789{ 1790 uint32_t * restrict dw = (uint32_t * restrict) dst; 1791 1792 dw[0] = 1793 __gen_uint(values->CubeFaceEnablePositiveZ, 0, 0) | 1794 __gen_uint(values->CubeFaceEnableNegativeZ, 1, 1) | 1795 __gen_uint(values->CubeFaceEnablePositiveY, 2, 2) | 1796 __gen_uint(values->CubeFaceEnableNegativeY, 3, 3) | 1797 __gen_uint(values->CubeFaceEnablePositiveX, 4, 4) | 1798 __gen_uint(values->CubeFaceEnableNegativeX, 5, 5) | 1799 __gen_uint(values->MediaBoundaryPixelMode, 6, 7) | 1800 __gen_uint(values->RenderCacheReadWriteMode, 8, 8) | 1801 __gen_uint(values->SamplerL2BypassModeDisable, 9, 9) | 1802 __gen_uint(values->VerticalLineStrideOffset, 10, 10) | 1803 __gen_uint(values->VerticalLineStride, 11, 11) | 1804 __gen_uint(values->TileMode, 12, 13) | 1805 __gen_uint(values->SurfaceHorizontalAlignment, 14, 15) | 1806 __gen_uint(values->SurfaceVerticalAlignment, 16, 17) | 1807 __gen_uint(values->SurfaceFormat, 18, 26) | 1808 __gen_uint(values->SurfaceArray, 28, 28) | 1809 __gen_uint(values->SurfaceType, 29, 31); 1810 1811 dw[1] = 1812 __gen_uint(values->SurfaceQPitch, 0, 14) | 1813 __gen_uint(values->SampleTapDiscardDisable, 15, 15) | 1814 __gen_uint(values->DoubleFetchDisable, 17, 17) | 1815 __gen_uint(values->CornerTexelMode, 18, 18) | 1816 __gen_ufixed(values->BaseMipLevel, 19, 23, 1) | 1817 __gen_uint(values->MOCS, 24, 30) | 1818 __gen_uint(values->EnableUnormPathInColorPipe, 31, 31); 1819 1820 dw[2] = 1821 __gen_uint(values->Width, 0, 13) | 1822 __gen_uint(values->Height, 16, 29) | 1823 __gen_uint(values->DepthStencilResource, 31, 31); 1824 1825 dw[3] = 1826 __gen_uint(values->SurfacePitch, 0, 17) | 1827 __gen_uint(values->NullProbingEnable, 18, 18) | 1828 __gen_uint(values->StandardTilingModeExtensions, 19, 19) | 1829 __gen_uint(values->TileAddressMappingMode, 20, 20) | 1830 __gen_uint(values->Depth, 21, 31); 1831 1832 dw[4] = 1833 __gen_uint(values->MultisamplePositionPaletteIndex, 0, 2) | 1834 __gen_uint(values->NumberofMultisamples, 3, 5) | 1835 __gen_uint(values->MultisampledSurfaceStorageFormat, 6, 6) | 1836 __gen_uint(values->RenderTargetViewExtent, 7, 17) | 1837 __gen_uint(values->MinimumArrayElement, 18, 28) | 1838 __gen_uint(values->RenderTargetAndSampleUnormRotation, 29, 30); 1839 1840 dw[5] = 1841 __gen_uint(values->MIPCountLOD, 0, 3) | 1842 __gen_uint(values->SurfaceMinLOD, 4, 7) | 1843 __gen_uint(values->MipTailStartLOD, 8, 11) | 1844 __gen_uint(values->CoherencyType, 14, 14) | 1845 __gen_uint(values->TiledResourceMode, 18, 19) | 1846 __gen_uint(values->EWADisableForCube, 20, 20) | 1847 __gen_uint(values->YOffset, 21, 23) | 1848 __gen_uint(values->XOffset, 25, 31); 1849 1850 dw[6] = 1851 __gen_uint(values->AuxiliarySurfaceMode, 0, 2) | 1852 __gen_uint(values->YOffsetforUorUVPlane, 0, 13) | 1853 __gen_uint(values->AuxiliarySurfacePitch, 3, 11) | 1854 __gen_uint(values->YUVInterpolationEnable, 15, 15) | 1855 __gen_uint(values->AuxiliarySurfaceQPitch, 16, 30) | 1856 __gen_uint(values->XOffsetforUorUVPlane, 16, 29) | 1857 __gen_uint(values->HalfPitchforChroma, 30, 30) | 1858 __gen_uint(values->SeparateUVPlaneEnable, 31, 31); 1859 1860 dw[7] = 1861 __gen_ufixed(values->ResourceMinLOD, 0, 11, 8) | 1862 __gen_uint(values->ShaderChannelSelectAlpha, 16, 18) | 1863 __gen_uint(values->ShaderChannelSelectBlue, 19, 21) | 1864 __gen_uint(values->ShaderChannelSelectGreen, 22, 24) | 1865 __gen_uint(values->ShaderChannelSelectRed, 25, 27) | 1866 __gen_uint(values->MemoryCompressionEnable, 30, 30) | 1867 __gen_uint(values->MemoryCompressionMode, 31, 31); 1868 1869 const uint64_t v8_address = 1870 __gen_address(data, &dw[8], values->SurfaceBaseAddress, 0, 0, 63); 1871 dw[8] = v8_address; 1872 dw[9] = v8_address >> 32; 1873 1874 const uint64_t v10 = 1875 __gen_uint(values->QuiltWidth, 0, 4) | 1876 __gen_uint(values->QuiltHeight, 5, 9) | 1877 __gen_uint(values->ClearValueAddressEnable, 10, 10) | 1878 __gen_uint(values->CachingExpandedFormats, 11, 11); 1879 const uint64_t v10_address = 1880 __gen_address(data, &dw[10], values->AuxiliarySurfaceBaseAddress, v10, 12, 63); 1881 dw[10] = v10_address; 1882 dw[11] = (v10_address >> 32) | (v10 >> 32); 1883 1884 const uint64_t v12 = 1885 __gen_uint(values->RenderCompressionFormat, 0, 4); 1886 const uint64_t v12_address = 1887 __gen_address(data, &dw[12], values->ClearValueAddress, v12, 6, 47); 1888 dw[12] = v12_address; 1889 dw[13] = (v12_address >> 32) | (v12 >> 32); 1890 1891 dw[14] = 0; 1892 1893 dw[15] = 0; 1894} 1895 1896#define GFX125_ROUNDINGPRECISIONTABLE_3_BITS_length 1 1897struct GFX125_ROUNDINGPRECISIONTABLE_3_BITS { 1898 uint32_t RoundingPrecision; 1899#define _116 0 1900#define _216 1 1901#define _316 2 1902#define _416 3 1903#define _516 4 1904#define _616 5 1905#define _716 6 1906#define _816 7 1907}; 1908 1909static inline __attribute__((always_inline)) void 1910GFX125_ROUNDINGPRECISIONTABLE_3_BITS_pack(__attribute__((unused)) __gen_user_data *data, 1911 __attribute__((unused)) void * restrict dst, 1912 __attribute__((unused)) const struct GFX125_ROUNDINGPRECISIONTABLE_3_BITS * restrict values) 1913{ 1914 uint32_t * restrict dw = (uint32_t * restrict) dst; 1915 1916 dw[0] = 1917 __gen_uint(values->RoundingPrecision, 0, 2); 1918} 1919 1920#define GFX125_SAMPLER_BORDER_COLOR_STATE_length 4 1921struct GFX125_SAMPLER_BORDER_COLOR_STATE { 1922 float BorderColorFloatRed; 1923 uint32_t BorderColor32bitRed; 1924 float BorderColorFloatGreen; 1925 uint32_t BorderColor32bitGreen; 1926 float BorderColorFloatBlue; 1927 uint32_t BorderColor32bitBlue; 1928 float BorderColorFloatAlpha; 1929 uint32_t BorderColor32bitAlpha; 1930}; 1931 1932static inline __attribute__((always_inline)) void 1933GFX125_SAMPLER_BORDER_COLOR_STATE_pack(__attribute__((unused)) __gen_user_data *data, 1934 __attribute__((unused)) void * restrict dst, 1935 __attribute__((unused)) const struct GFX125_SAMPLER_BORDER_COLOR_STATE * restrict values) 1936{ 1937 uint32_t * restrict dw = (uint32_t * restrict) dst; 1938 1939 dw[0] = 1940 __gen_float(values->BorderColorFloatRed) | 1941 __gen_uint(values->BorderColor32bitRed, 0, 31); 1942 1943 dw[1] = 1944 __gen_float(values->BorderColorFloatGreen) | 1945 __gen_uint(values->BorderColor32bitGreen, 0, 31); 1946 1947 dw[2] = 1948 __gen_float(values->BorderColorFloatBlue) | 1949 __gen_uint(values->BorderColor32bitBlue, 0, 31); 1950 1951 dw[3] = 1952 __gen_float(values->BorderColorFloatAlpha) | 1953 __gen_uint(values->BorderColor32bitAlpha, 0, 31); 1954} 1955 1956#define GFX125_SAMPLER_INDIRECT_STATE_BORDER_COLOR_length 4 1957struct GFX125_SAMPLER_INDIRECT_STATE_BORDER_COLOR { 1958 int32_t BorderColorRedAsS31; 1959 uint32_t BorderColorRedAsU32; 1960 float BorderColorRedAsFloat; 1961 uint32_t BorderColorRedAsU8; 1962 uint32_t BorderColorGreenAsU8; 1963 uint32_t BorderColorBlueAsU8; 1964 uint32_t BorderColorAlphaAsU8; 1965 int32_t BorderColorGreenAsS31; 1966 uint32_t BorderColorGreenAsU32; 1967 float BorderColorGreenAsFloat; 1968 int32_t BorderColorBlueAsS31; 1969 uint32_t BorderColorBlueAsU32; 1970 float BorderColorBlueAsFloat; 1971 int32_t BorderColorAlphaAsS31; 1972 uint32_t BorderColorAlphaAsU32; 1973 float BorderColorAlphaAsFloat; 1974}; 1975 1976static inline __attribute__((always_inline)) void 1977GFX125_SAMPLER_INDIRECT_STATE_BORDER_COLOR_pack(__attribute__((unused)) __gen_user_data *data, 1978 __attribute__((unused)) void * restrict dst, 1979 __attribute__((unused)) const struct GFX125_SAMPLER_INDIRECT_STATE_BORDER_COLOR * restrict values) 1980{ 1981 uint32_t * restrict dw = (uint32_t * restrict) dst; 1982 1983 dw[0] = 1984 __gen_sint(values->BorderColorRedAsS31, 0, 31) | 1985 __gen_uint(values->BorderColorRedAsU32, 0, 31) | 1986 __gen_float(values->BorderColorRedAsFloat) | 1987 __gen_uint(values->BorderColorRedAsU8, 0, 7) | 1988 __gen_uint(values->BorderColorGreenAsU8, 8, 15) | 1989 __gen_uint(values->BorderColorBlueAsU8, 16, 23) | 1990 __gen_uint(values->BorderColorAlphaAsU8, 24, 31); 1991 1992 dw[1] = 1993 __gen_sint(values->BorderColorGreenAsS31, 0, 31) | 1994 __gen_uint(values->BorderColorGreenAsU32, 0, 31) | 1995 __gen_float(values->BorderColorGreenAsFloat); 1996 1997 dw[2] = 1998 __gen_sint(values->BorderColorBlueAsS31, 0, 31) | 1999 __gen_uint(values->BorderColorBlueAsU32, 0, 31) | 2000 __gen_float(values->BorderColorBlueAsFloat); 2001 2002 dw[3] = 2003 __gen_sint(values->BorderColorAlphaAsS31, 0, 31) | 2004 __gen_uint(values->BorderColorAlphaAsU32, 0, 31) | 2005 __gen_float(values->BorderColorAlphaAsFloat); 2006} 2007 2008#define GFX125_SAMPLER_STATE_length 4 2009struct GFX125_SAMPLER_STATE { 2010 uint32_t AnisotropicAlgorithm; 2011#define LEGACY 0 2012#define EWAApproximation 1 2013 float TextureLODBias; 2014 uint32_t MinModeFilter; 2015#define MAPFILTER_NEAREST 0 2016#define MAPFILTER_LINEAR 1 2017#define MAPFILTER_ANISOTROPIC 2 2018#define MAPFILTER_MONO 6 2019 uint32_t MagModeFilter; 2020#define MAPFILTER_NEAREST 0 2021#define MAPFILTER_LINEAR 1 2022#define MAPFILTER_ANISOTROPIC 2 2023#define MAPFILTER_MONO 6 2024 uint32_t MipModeFilter; 2025#define MIPFILTER_NONE 0 2026#define MIPFILTER_NEAREST 1 2027#define MIPFILTER_LINEAR 3 2028 uint32_t CoarseLODQualityMode; 2029 uint32_t LODPreClampMode; 2030#define CLAMP_MODE_NONE 0 2031#define CLAMP_MODE_OGL 2 2032 uint32_t TextureBorderColorMode; 2033#define DX10OGL 0 2034#define DX9 1 2035 bool CPSLODCompensationEnable; 2036 bool SamplerDisable; 2037 uint32_t CubeSurfaceControlMode; 2038#define PROGRAMMED 0 2039#define OVERRIDE 1 2040 uint32_t ShadowFunction; 2041#define PREFILTEROP_ALWAYS 0 2042#define PREFILTEROP_NEVER 1 2043#define PREFILTEROP_LESS 2 2044#define PREFILTEROP_EQUAL 3 2045#define PREFILTEROP_LEQUAL 4 2046#define PREFILTEROP_GREATER 5 2047#define PREFILTEROP_NOTEQUAL 6 2048#define PREFILTEROP_GEQUAL 7 2049 uint32_t ChromaKeyMode; 2050#define KEYFILTER_KILL_ON_ANY_MATCH 0 2051#define KEYFILTER_REPLACE_BLACK 1 2052 uint32_t ChromaKeyIndex; 2053 bool ChromaKeyEnable; 2054 float MaxLOD; 2055 float MinLOD; 2056 uint32_t LODClampMagnificationMode; 2057#define MIPNONE 0 2058#define MIPFILTER 1 2059 uint32_t SRGBDECODE; 2060#define DECODE_EXT 0 2061#define SKIP_DECODE_EXT 1 2062 uint32_t ReturnFilterWeightforNullTexels; 2063 uint32_t ReturnFilterWeightforBorderTexels; 2064 bool Forcegather4Behavior; 2065 uint64_t BorderColorPointer; 2066 enum GFX125_TextureCoordinateMode TCZAddressControlMode; 2067 enum GFX125_TextureCoordinateMode TCYAddressControlMode; 2068 enum GFX125_TextureCoordinateMode TCXAddressControlMode; 2069 bool ReductionTypeEnable; 2070 bool NonnormalizedCoordinateEnable; 2071 uint32_t TrilinearFilterQuality; 2072#define FULL 0 2073#define HIGH 1 2074#define MED 2 2075#define LOW 3 2076 bool RAddressMinFilterRoundingEnable; 2077 bool RAddressMagFilterRoundingEnable; 2078 bool VAddressMinFilterRoundingEnable; 2079 bool VAddressMagFilterRoundingEnable; 2080 bool UAddressMinFilterRoundingEnable; 2081 bool UAddressMagFilterRoundingEnable; 2082 uint32_t MaximumAnisotropy; 2083#define RATIO21 0 2084#define RATIO41 1 2085#define RATIO61 2 2086#define RATIO81 3 2087#define RATIO101 4 2088#define RATIO121 5 2089#define RATIO141 6 2090#define RATIO161 7 2091 uint32_t ReductionType; 2092#define STD_FILTER 0 2093#define COMPARISON 1 2094#define MINIMUM 2 2095#define MAXIMUM 3 2096}; 2097 2098static inline __attribute__((always_inline)) void 2099GFX125_SAMPLER_STATE_pack(__attribute__((unused)) __gen_user_data *data, 2100 __attribute__((unused)) void * restrict dst, 2101 __attribute__((unused)) const struct GFX125_SAMPLER_STATE * restrict values) 2102{ 2103 uint32_t * restrict dw = (uint32_t * restrict) dst; 2104 2105 dw[0] = 2106 __gen_uint(values->AnisotropicAlgorithm, 0, 0) | 2107 __gen_sfixed(values->TextureLODBias, 1, 13, 8) | 2108 __gen_uint(values->MinModeFilter, 14, 16) | 2109 __gen_uint(values->MagModeFilter, 17, 19) | 2110 __gen_uint(values->MipModeFilter, 20, 21) | 2111 __gen_uint(values->CoarseLODQualityMode, 22, 26) | 2112 __gen_uint(values->LODPreClampMode, 27, 28) | 2113 __gen_uint(values->TextureBorderColorMode, 29, 29) | 2114 __gen_uint(values->CPSLODCompensationEnable, 30, 30) | 2115 __gen_uint(values->SamplerDisable, 31, 31); 2116 2117 dw[1] = 2118 __gen_uint(values->CubeSurfaceControlMode, 0, 0) | 2119 __gen_uint(values->ShadowFunction, 1, 3) | 2120 __gen_uint(values->ChromaKeyMode, 4, 4) | 2121 __gen_uint(values->ChromaKeyIndex, 5, 6) | 2122 __gen_uint(values->ChromaKeyEnable, 7, 7) | 2123 __gen_ufixed(values->MaxLOD, 8, 19, 8) | 2124 __gen_ufixed(values->MinLOD, 20, 31, 8); 2125 2126 dw[2] = 2127 __gen_uint(values->LODClampMagnificationMode, 0, 0) | 2128 __gen_uint(values->SRGBDECODE, 1, 1) | 2129 __gen_uint(values->ReturnFilterWeightforNullTexels, 2, 2) | 2130 __gen_uint(values->ReturnFilterWeightforBorderTexels, 3, 3) | 2131 __gen_uint(values->Forcegather4Behavior, 5, 5) | 2132 __gen_offset(values->BorderColorPointer, 6, 23); 2133 2134 dw[3] = 2135 __gen_uint(values->TCZAddressControlMode, 0, 2) | 2136 __gen_uint(values->TCYAddressControlMode, 3, 5) | 2137 __gen_uint(values->TCXAddressControlMode, 6, 8) | 2138 __gen_uint(values->ReductionTypeEnable, 9, 9) | 2139 __gen_uint(values->NonnormalizedCoordinateEnable, 10, 10) | 2140 __gen_uint(values->TrilinearFilterQuality, 11, 12) | 2141 __gen_uint(values->RAddressMinFilterRoundingEnable, 13, 13) | 2142 __gen_uint(values->RAddressMagFilterRoundingEnable, 14, 14) | 2143 __gen_uint(values->VAddressMinFilterRoundingEnable, 15, 15) | 2144 __gen_uint(values->VAddressMagFilterRoundingEnable, 16, 16) | 2145 __gen_uint(values->UAddressMinFilterRoundingEnable, 17, 17) | 2146 __gen_uint(values->UAddressMagFilterRoundingEnable, 18, 18) | 2147 __gen_uint(values->MaximumAnisotropy, 19, 21) | 2148 __gen_uint(values->ReductionType, 22, 23); 2149} 2150 2151#define GFX125_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_length 8 2152struct GFX125_SAMPLER_STATE_8X8_AVS_COEFFICIENTS { 2153 float Table0FilterCoefficient[4]; 2154 float Table1FilterCoefficient0[4]; 2155 float Table1FilterCoefficient1[4]; 2156}; 2157 2158static inline __attribute__((always_inline)) void 2159GFX125_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_pack(__attribute__((unused)) __gen_user_data *data, 2160 __attribute__((unused)) void * restrict dst, 2161 __attribute__((unused)) const struct GFX125_SAMPLER_STATE_8X8_AVS_COEFFICIENTS * restrict values) 2162{ 2163 uint32_t * restrict dw = (uint32_t * restrict) dst; 2164 2165 dw[0] = 2166 __gen_sfixed(values->Table0FilterCoefficient[0], 0, 7, 6) | 2167 __gen_sfixed(values->Table0FilterCoefficient[1], 8, 15, 6) | 2168 __gen_sfixed(values->Table0FilterCoefficient[2], 16, 23, 6) | 2169 __gen_sfixed(values->Table0FilterCoefficient[3], 24, 31, 6) | 2170 __gen_sfixed(values->Table1FilterCoefficient0[0], 0, 7, 6) | 2171 __gen_sfixed(values->Table1FilterCoefficient1[0], 8, 15, 6); 2172 2173 dw[1] = 2174 __gen_sfixed(values->Table1FilterCoefficient0[1], 0, 7, 6) | 2175 __gen_sfixed(values->Table1FilterCoefficient1[1], 8, 15, 6); 2176 2177 dw[2] = 2178 __gen_sfixed(values->Table1FilterCoefficient0[2], 0, 7, 6) | 2179 __gen_sfixed(values->Table1FilterCoefficient1[2], 8, 15, 6); 2180 2181 dw[3] = 2182 __gen_sfixed(values->Table1FilterCoefficient0[3], 0, 7, 6) | 2183 __gen_sfixed(values->Table1FilterCoefficient1[3], 8, 15, 6); 2184 2185 dw[4] = 0; 2186 2187 dw[5] = 0; 2188 2189 dw[6] = 0; 2190 2191 dw[7] = 0; 2192} 2193 2194#define GFX125_SCISSOR_RECT_length 2 2195struct GFX125_SCISSOR_RECT { 2196 uint32_t ScissorRectangleXMin; 2197 uint32_t ScissorRectangleYMin; 2198 uint32_t ScissorRectangleXMax; 2199 uint32_t ScissorRectangleYMax; 2200}; 2201 2202static inline __attribute__((always_inline)) void 2203GFX125_SCISSOR_RECT_pack(__attribute__((unused)) __gen_user_data *data, 2204 __attribute__((unused)) void * restrict dst, 2205 __attribute__((unused)) const struct GFX125_SCISSOR_RECT * restrict values) 2206{ 2207 uint32_t * restrict dw = (uint32_t * restrict) dst; 2208 2209 dw[0] = 2210 __gen_uint(values->ScissorRectangleXMin, 0, 15) | 2211 __gen_uint(values->ScissorRectangleYMin, 16, 31); 2212 2213 dw[1] = 2214 __gen_uint(values->ScissorRectangleXMax, 0, 15) | 2215 __gen_uint(values->ScissorRectangleYMax, 16, 31); 2216} 2217 2218#define GFX125_SFC_AVS_CHROMA_COEFF_TABLE_BODY_length 64 2219struct GFX125_SFC_AVS_CHROMA_COEFF_TABLE_BODY { 2220 float Table1XFilterCoefficientn2; 2221 float Table1YFilterCoefficientn2; 2222 float Table1XFilterCoefficientn3; 2223 float Table1YFilterCoefficientn3; 2224 float Table1XFilterCoefficientn4; 2225 float Table1YFilterCoefficientn4; 2226 float Table1XFilterCoefficientn5; 2227 float Table1YFilterCoefficientn5; 2228 struct GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY FilterCoefficients[31]; 2229}; 2230 2231static inline __attribute__((always_inline)) void 2232GFX125_SFC_AVS_CHROMA_COEFF_TABLE_BODY_pack(__attribute__((unused)) __gen_user_data *data, 2233 __attribute__((unused)) void * restrict dst, 2234 __attribute__((unused)) const struct GFX125_SFC_AVS_CHROMA_COEFF_TABLE_BODY * restrict values) 2235{ 2236 uint32_t * restrict dw = (uint32_t * restrict) dst; 2237 2238 dw[0] = 2239 __gen_sfixed(values->Table1XFilterCoefficientn2, 0, 7, 6) | 2240 __gen_sfixed(values->Table1YFilterCoefficientn2, 8, 15, 6) | 2241 __gen_sfixed(values->Table1XFilterCoefficientn3, 16, 23, 6) | 2242 __gen_sfixed(values->Table1YFilterCoefficientn3, 24, 31, 6); 2243 2244 dw[1] = 2245 __gen_sfixed(values->Table1XFilterCoefficientn4, 0, 7, 6) | 2246 __gen_sfixed(values->Table1YFilterCoefficientn4, 8, 15, 6) | 2247 __gen_sfixed(values->Table1XFilterCoefficientn5, 16, 23, 6) | 2248 __gen_sfixed(values->Table1YFilterCoefficientn5, 24, 31, 6); 2249 2250 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[2], &values->FilterCoefficients[0]); 2251 2252 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[4], &values->FilterCoefficients[1]); 2253 2254 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[6], &values->FilterCoefficients[2]); 2255 2256 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[8], &values->FilterCoefficients[3]); 2257 2258 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[10], &values->FilterCoefficients[4]); 2259 2260 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[12], &values->FilterCoefficients[5]); 2261 2262 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[14], &values->FilterCoefficients[6]); 2263 2264 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[16], &values->FilterCoefficients[7]); 2265 2266 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[18], &values->FilterCoefficients[8]); 2267 2268 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[20], &values->FilterCoefficients[9]); 2269 2270 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[22], &values->FilterCoefficients[10]); 2271 2272 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[24], &values->FilterCoefficients[11]); 2273 2274 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[26], &values->FilterCoefficients[12]); 2275 2276 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[28], &values->FilterCoefficients[13]); 2277 2278 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[30], &values->FilterCoefficients[14]); 2279 2280 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[32], &values->FilterCoefficients[15]); 2281 2282 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[34], &values->FilterCoefficients[16]); 2283 2284 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[36], &values->FilterCoefficients[17]); 2285 2286 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[38], &values->FilterCoefficients[18]); 2287 2288 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[40], &values->FilterCoefficients[19]); 2289 2290 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[42], &values->FilterCoefficients[20]); 2291 2292 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[44], &values->FilterCoefficients[21]); 2293 2294 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[46], &values->FilterCoefficients[22]); 2295 2296 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[48], &values->FilterCoefficients[23]); 2297 2298 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[50], &values->FilterCoefficients[24]); 2299 2300 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[52], &values->FilterCoefficients[25]); 2301 2302 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[54], &values->FilterCoefficients[26]); 2303 2304 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[56], &values->FilterCoefficients[27]); 2305 2306 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[58], &values->FilterCoefficients[28]); 2307 2308 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[60], &values->FilterCoefficients[29]); 2309 2310 GFX125_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[62], &values->FilterCoefficients[30]); 2311} 2312 2313#define GFX125_SFC_AVS_LUMA_COEFF_TABLE_BODY_length 128 2314struct GFX125_SFC_AVS_LUMA_COEFF_TABLE_BODY { 2315 float Table0XFilterCoefficientn0; 2316 float Table0YFilterCoefficientn0; 2317 float Table0XFilterCoefficientn1; 2318 float Table0YFilterCoefficientn1; 2319 float Table0XFilterCoefficientn2; 2320 float Table0YFilterCoefficientn2; 2321 float Table0XFilterCoefficientn3; 2322 float Table0YFilterCoefficientn3; 2323 float Table0XFilterCoefficientn4; 2324 float Table0YFilterCoefficientn4; 2325 float Table0XFilterCoefficientn5; 2326 float Table0YFilterCoefficientn5; 2327 float Table0XFilterCoefficientn6; 2328 float Table0YFilterCoefficientn6; 2329 float Table0XFilterCoefficientn7; 2330 float Table0YFilterCoefficientn7; 2331 struct GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY FilterCoefficients[31]; 2332}; 2333 2334static inline __attribute__((always_inline)) void 2335GFX125_SFC_AVS_LUMA_COEFF_TABLE_BODY_pack(__attribute__((unused)) __gen_user_data *data, 2336 __attribute__((unused)) void * restrict dst, 2337 __attribute__((unused)) const struct GFX125_SFC_AVS_LUMA_COEFF_TABLE_BODY * restrict values) 2338{ 2339 uint32_t * restrict dw = (uint32_t * restrict) dst; 2340 2341 dw[0] = 2342 __gen_sfixed(values->Table0XFilterCoefficientn0, 0, 7, 6) | 2343 __gen_sfixed(values->Table0YFilterCoefficientn0, 8, 15, 6) | 2344 __gen_sfixed(values->Table0XFilterCoefficientn1, 16, 23, 6) | 2345 __gen_sfixed(values->Table0YFilterCoefficientn1, 24, 31, 6); 2346 2347 dw[1] = 2348 __gen_sfixed(values->Table0XFilterCoefficientn2, 0, 7, 6) | 2349 __gen_sfixed(values->Table0YFilterCoefficientn2, 8, 15, 6) | 2350 __gen_sfixed(values->Table0XFilterCoefficientn3, 16, 23, 6) | 2351 __gen_sfixed(values->Table0YFilterCoefficientn3, 24, 31, 6); 2352 2353 dw[2] = 2354 __gen_sfixed(values->Table0XFilterCoefficientn4, 0, 7, 6) | 2355 __gen_sfixed(values->Table0YFilterCoefficientn4, 8, 15, 6) | 2356 __gen_sfixed(values->Table0XFilterCoefficientn5, 16, 23, 6) | 2357 __gen_sfixed(values->Table0YFilterCoefficientn5, 24, 31, 6); 2358 2359 dw[3] = 2360 __gen_sfixed(values->Table0XFilterCoefficientn6, 0, 7, 6) | 2361 __gen_sfixed(values->Table0YFilterCoefficientn6, 8, 15, 6) | 2362 __gen_sfixed(values->Table0XFilterCoefficientn7, 16, 23, 6) | 2363 __gen_sfixed(values->Table0YFilterCoefficientn7, 24, 31, 6); 2364 2365 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[4], &values->FilterCoefficients[0]); 2366 2367 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[8], &values->FilterCoefficients[1]); 2368 2369 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[12], &values->FilterCoefficients[2]); 2370 2371 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[16], &values->FilterCoefficients[3]); 2372 2373 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[20], &values->FilterCoefficients[4]); 2374 2375 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[24], &values->FilterCoefficients[5]); 2376 2377 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[28], &values->FilterCoefficients[6]); 2378 2379 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[32], &values->FilterCoefficients[7]); 2380 2381 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[36], &values->FilterCoefficients[8]); 2382 2383 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[40], &values->FilterCoefficients[9]); 2384 2385 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[44], &values->FilterCoefficients[10]); 2386 2387 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[48], &values->FilterCoefficients[11]); 2388 2389 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[52], &values->FilterCoefficients[12]); 2390 2391 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[56], &values->FilterCoefficients[13]); 2392 2393 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[60], &values->FilterCoefficients[14]); 2394 2395 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[64], &values->FilterCoefficients[15]); 2396 2397 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[68], &values->FilterCoefficients[16]); 2398 2399 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[72], &values->FilterCoefficients[17]); 2400 2401 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[76], &values->FilterCoefficients[18]); 2402 2403 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[80], &values->FilterCoefficients[19]); 2404 2405 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[84], &values->FilterCoefficients[20]); 2406 2407 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[88], &values->FilterCoefficients[21]); 2408 2409 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[92], &values->FilterCoefficients[22]); 2410 2411 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[96], &values->FilterCoefficients[23]); 2412 2413 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[100], &values->FilterCoefficients[24]); 2414 2415 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[104], &values->FilterCoefficients[25]); 2416 2417 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[108], &values->FilterCoefficients[26]); 2418 2419 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[112], &values->FilterCoefficients[27]); 2420 2421 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[116], &values->FilterCoefficients[28]); 2422 2423 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[120], &values->FilterCoefficients[29]); 2424 2425 GFX125_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[124], &values->FilterCoefficients[30]); 2426} 2427 2428#define GFX125_SFC_AVS_STATE_BODY_length 3 2429struct GFX125_SFC_AVS_STATE_BODY { 2430 uint32_t TransitionAreawith8Pixels; 2431 uint32_t TransitionAreawith4Pixels; 2432 uint32_t SharpnessLevel; 2433 uint32_t MaxDerivative8Pixels; 2434 uint32_t MaxDerivative4Pixels; 2435 uint32_t InputVerticalSiting; 2436#define _18 1 2437#define _28 2 2438#define _38 3 2439#define _48 4 2440#define _58 5 2441#define _68 6 2442#define _78 7 2443#define _88 8 2444}; 2445 2446static inline __attribute__((always_inline)) void 2447GFX125_SFC_AVS_STATE_BODY_pack(__attribute__((unused)) __gen_user_data *data, 2448 __attribute__((unused)) void * restrict dst, 2449 __attribute__((unused)) const struct GFX125_SFC_AVS_STATE_BODY * restrict values) 2450{ 2451 uint32_t * restrict dw = (uint32_t * restrict) dst; 2452 2453 dw[0] = 2454 __gen_uint(values->TransitionAreawith8Pixels, 0, 2) | 2455 __gen_uint(values->TransitionAreawith4Pixels, 4, 6) | 2456 __gen_uint(values->SharpnessLevel, 24, 31); 2457 2458 dw[1] = 2459 __gen_uint(values->MaxDerivative8Pixels, 0, 7) | 2460 __gen_uint(values->MaxDerivative4Pixels, 16, 23); 2461 2462 dw[2] = 2463 __gen_uint(values->InputVerticalSiting, 0, 3); 2464} 2465 2466#define GFX125_SFC_IEF_STATE_BODY_length 23 2467struct GFX125_SFC_IEF_STATE_BODY { 2468 uint32_t GainFactor; 2469 uint32_t WeakEdgeThreshold; 2470 uint32_t StrongEdgeThreshold; 2471 float R3xCoefficient; 2472 float R3cCoefficient; 2473 uint32_t GlobalNoiseEstimation; 2474 uint32_t NonEdgeWeight; 2475 uint32_t RegularWeight; 2476 uint32_t StrongEdgeWeight; 2477 float R5xCoefficient; 2478 float R5cxCoefficient; 2479 float R5cCoefficient; 2480 float STDSinalpha; 2481 float STDCosalpha; 2482 uint32_t Sat_Max; 2483 uint32_t Hue_Max; 2484 float S3U; 2485 uint32_t DiamondMargin; 2486 bool VY_STD_Enable; 2487 uint32_t U_Mid; 2488 uint32_t V_Mid; 2489 int32_t Diamond_dv; 2490 uint32_t Diamond_Th; 2491 float Diamond_alpha; 2492 uint32_t HS_margin; 2493 int32_t Diamond_du; 2494 uint32_t SkinDetailFactor; 2495#define DetailRevealed 0 2496#define NotDetailRevealed 1 2497 uint32_t Y_point_1; 2498 uint32_t Y_point_2; 2499 uint32_t Y_point_3; 2500 uint32_t Y_point_4; 2501 float INV_Margin_VYL; 2502 float INV_Margin_VYU; 2503 uint32_t P0L; 2504 uint32_t P1L; 2505 uint32_t P2L; 2506 uint32_t P3L; 2507 uint32_t B0L; 2508 uint32_t B1L; 2509 uint32_t B2L; 2510 uint32_t B3L; 2511 float S0L; 2512 float Y_Slope_2; 2513 float S1L; 2514 float S2L; 2515 float S3L; 2516 uint32_t P0U; 2517 uint32_t P1U; 2518 float Y_Slope1; 2519 uint32_t P2U; 2520 uint32_t P3U; 2521 uint32_t B0U; 2522 uint32_t B1U; 2523 uint32_t B2U; 2524 uint32_t B3U; 2525 float S0U; 2526 float S1U; 2527 float S2U; 2528 bool TransformEnable; 2529 bool YUVChannelSwap; 2530 float C0; 2531 float C1; 2532 float C2; 2533 float C3; 2534 float C4; 2535 float C5; 2536 float C6; 2537 float C7; 2538 float C8; 2539 float OffsetIn1; 2540 float OffsetOut1; 2541 float OffsetIn2; 2542 float OffsetOut2; 2543 float OffsetIn3; 2544 float OffsetOut3; 2545}; 2546 2547static inline __attribute__((always_inline)) void 2548GFX125_SFC_IEF_STATE_BODY_pack(__attribute__((unused)) __gen_user_data *data, 2549 __attribute__((unused)) void * restrict dst, 2550 __attribute__((unused)) const struct GFX125_SFC_IEF_STATE_BODY * restrict values) 2551{ 2552 uint32_t * restrict dw = (uint32_t * restrict) dst; 2553 2554 dw[0] = 2555 __gen_uint(values->GainFactor, 0, 5) | 2556 __gen_uint(values->WeakEdgeThreshold, 6, 11) | 2557 __gen_uint(values->StrongEdgeThreshold, 12, 17) | 2558 __gen_ufixed(values->R3xCoefficient, 18, 22, 5) | 2559 __gen_ufixed(values->R3cCoefficient, 23, 27, 5); 2560 2561 dw[1] = 2562 __gen_uint(values->GlobalNoiseEstimation, 0, 7) | 2563 __gen_uint(values->NonEdgeWeight, 8, 10) | 2564 __gen_uint(values->RegularWeight, 11, 13) | 2565 __gen_uint(values->StrongEdgeWeight, 14, 16) | 2566 __gen_ufixed(values->R5xCoefficient, 17, 21, 5) | 2567 __gen_ufixed(values->R5cxCoefficient, 22, 26, 5) | 2568 __gen_ufixed(values->R5cCoefficient, 27, 31, 5); 2569 2570 dw[2] = 2571 __gen_sfixed(values->STDSinalpha, 0, 7, 7) | 2572 __gen_sfixed(values->STDCosalpha, 8, 15, 7) | 2573 __gen_uint(values->Sat_Max, 16, 21) | 2574 __gen_uint(values->Hue_Max, 22, 27); 2575 2576 dw[3] = 2577 __gen_sfixed(values->S3U, 0, 10, 8) | 2578 __gen_uint(values->DiamondMargin, 12, 14) | 2579 __gen_uint(values->VY_STD_Enable, 15, 15) | 2580 __gen_uint(values->U_Mid, 16, 23) | 2581 __gen_uint(values->V_Mid, 24, 31); 2582 2583 dw[4] = 2584 __gen_sint(values->Diamond_dv, 0, 6) | 2585 __gen_uint(values->Diamond_Th, 7, 12) | 2586 __gen_ufixed(values->Diamond_alpha, 13, 20, 6) | 2587 __gen_uint(values->HS_margin, 21, 23) | 2588 __gen_sint(values->Diamond_du, 24, 30) | 2589 __gen_uint(values->SkinDetailFactor, 31, 31); 2590 2591 dw[5] = 2592 __gen_uint(values->Y_point_1, 0, 7) | 2593 __gen_uint(values->Y_point_2, 8, 15) | 2594 __gen_uint(values->Y_point_3, 16, 23) | 2595 __gen_uint(values->Y_point_4, 24, 31); 2596 2597 dw[6] = 2598 __gen_ufixed(values->INV_Margin_VYL, 0, 15, 16); 2599 2600 dw[7] = 2601 __gen_ufixed(values->INV_Margin_VYU, 0, 15, 16) | 2602 __gen_uint(values->P0L, 16, 23) | 2603 __gen_uint(values->P1L, 24, 31); 2604 2605 dw[8] = 2606 __gen_uint(values->P2L, 0, 7) | 2607 __gen_uint(values->P3L, 8, 15) | 2608 __gen_uint(values->B0L, 16, 23) | 2609 __gen_uint(values->B1L, 24, 31); 2610 2611 dw[9] = 2612 __gen_uint(values->B2L, 0, 7) | 2613 __gen_uint(values->B3L, 8, 15) | 2614 __gen_sfixed(values->S0L, 16, 26, 8) | 2615 __gen_ufixed(values->Y_Slope_2, 27, 31, 3); 2616 2617 dw[10] = 2618 __gen_sfixed(values->S1L, 0, 10, 8) | 2619 __gen_sfixed(values->S2L, 11, 21, 8); 2620 2621 dw[11] = 2622 __gen_sfixed(values->S3L, 0, 10, 8) | 2623 __gen_uint(values->P0U, 11, 18) | 2624 __gen_uint(values->P1U, 19, 26) | 2625 __gen_ufixed(values->Y_Slope1, 27, 31, 3); 2626 2627 dw[12] = 2628 __gen_uint(values->P2U, 0, 7) | 2629 __gen_uint(values->P3U, 8, 15) | 2630 __gen_uint(values->B0U, 16, 23) | 2631 __gen_uint(values->B1U, 24, 31); 2632 2633 dw[13] = 2634 __gen_uint(values->B2U, 0, 7) | 2635 __gen_uint(values->B3U, 8, 15) | 2636 __gen_sfixed(values->S0U, 16, 26, 8); 2637 2638 dw[14] = 2639 __gen_sfixed(values->S1U, 0, 10, 8) | 2640 __gen_sfixed(values->S2U, 11, 21, 8); 2641 2642 dw[15] = 2643 __gen_uint(values->TransformEnable, 0, 0) | 2644 __gen_uint(values->YUVChannelSwap, 1, 1) | 2645 __gen_sfixed(values->C0, 3, 15, 10) | 2646 __gen_sfixed(values->C1, 16, 28, 10); 2647 2648 dw[16] = 2649 __gen_sfixed(values->C2, 0, 12, 10) | 2650 __gen_sfixed(values->C3, 13, 25, 10); 2651 2652 dw[17] = 2653 __gen_sfixed(values->C4, 0, 12, 10) | 2654 __gen_sfixed(values->C5, 13, 25, 10); 2655 2656 dw[18] = 2657 __gen_sfixed(values->C6, 0, 12, 10) | 2658 __gen_sfixed(values->C7, 13, 25, 10); 2659 2660 dw[19] = 2661 __gen_sfixed(values->C8, 0, 12, 10); 2662 2663 dw[20] = 2664 __gen_sfixed(values->OffsetIn1, 0, 10, 8) | 2665 __gen_sfixed(values->OffsetOut1, 11, 21, 8); 2666 2667 dw[21] = 2668 __gen_sfixed(values->OffsetIn2, 0, 10, 8) | 2669 __gen_sfixed(values->OffsetOut2, 11, 21, 8); 2670 2671 dw[22] = 2672 __gen_sfixed(values->OffsetIn3, 0, 10, 8) | 2673 __gen_sfixed(values->OffsetOut3, 11, 21, 8); 2674} 2675 2676#define GFX125_SFC_LOCK_BODY_length 1 2677struct GFX125_SFC_LOCK_BODY { 2678 uint32_t VESFCPipeSelect; 2679 bool PreScaledOutputSurfaceOutputEnable; 2680}; 2681 2682static inline __attribute__((always_inline)) void 2683GFX125_SFC_LOCK_BODY_pack(__attribute__((unused)) __gen_user_data *data, 2684 __attribute__((unused)) void * restrict dst, 2685 __attribute__((unused)) const struct GFX125_SFC_LOCK_BODY * restrict values) 2686{ 2687 uint32_t * restrict dw = (uint32_t * restrict) dst; 2688 2689 dw[0] = 2690 __gen_uint(values->VESFCPipeSelect, 0, 0) | 2691 __gen_uint(values->PreScaledOutputSurfaceOutputEnable, 1, 1); 2692} 2693 2694#define GFX125_SF_CLIP_VIEWPORT_length 16 2695struct GFX125_SF_CLIP_VIEWPORT { 2696 float ViewportMatrixElementm00; 2697 float ViewportMatrixElementm11; 2698 float ViewportMatrixElementm22; 2699 float ViewportMatrixElementm30; 2700 float ViewportMatrixElementm31; 2701 float ViewportMatrixElementm32; 2702 float XMinClipGuardband; 2703 float XMaxClipGuardband; 2704 float YMinClipGuardband; 2705 float YMaxClipGuardband; 2706 float XMinViewPort; 2707 float XMaxViewPort; 2708 float YMinViewPort; 2709 float YMaxViewPort; 2710}; 2711 2712static inline __attribute__((always_inline)) void 2713GFX125_SF_CLIP_VIEWPORT_pack(__attribute__((unused)) __gen_user_data *data, 2714 __attribute__((unused)) void * restrict dst, 2715 __attribute__((unused)) const struct GFX125_SF_CLIP_VIEWPORT * restrict values) 2716{ 2717 uint32_t * restrict dw = (uint32_t * restrict) dst; 2718 2719 dw[0] = 2720 __gen_float(values->ViewportMatrixElementm00); 2721 2722 dw[1] = 2723 __gen_float(values->ViewportMatrixElementm11); 2724 2725 dw[2] = 2726 __gen_float(values->ViewportMatrixElementm22); 2727 2728 dw[3] = 2729 __gen_float(values->ViewportMatrixElementm30); 2730 2731 dw[4] = 2732 __gen_float(values->ViewportMatrixElementm31); 2733 2734 dw[5] = 2735 __gen_float(values->ViewportMatrixElementm32); 2736 2737 dw[6] = 0; 2738 2739 dw[7] = 0; 2740 2741 dw[8] = 2742 __gen_float(values->XMinClipGuardband); 2743 2744 dw[9] = 2745 __gen_float(values->XMaxClipGuardband); 2746 2747 dw[10] = 2748 __gen_float(values->YMinClipGuardband); 2749 2750 dw[11] = 2751 __gen_float(values->YMaxClipGuardband); 2752 2753 dw[12] = 2754 __gen_float(values->XMinViewPort); 2755 2756 dw[13] = 2757 __gen_float(values->XMaxViewPort); 2758 2759 dw[14] = 2760 __gen_float(values->YMinViewPort); 2761 2762 dw[15] = 2763 __gen_float(values->YMaxViewPort); 2764} 2765 2766#define GFX125_SF_OUTPUT_ATTRIBUTE_DETAIL_length 1 2767struct GFX125_SF_OUTPUT_ATTRIBUTE_DETAIL { 2768 uint32_t SourceAttribute; 2769 uint32_t SwizzleSelect; 2770#define INPUTATTR 0 2771#define INPUTATTR_FACING 1 2772#define INPUTATTR_W 2 2773#define INPUTATTR_FACING_W 3 2774 uint32_t ConstantSource; 2775#define CONST_0000 0 2776#define CONST_0001_FLOAT 1 2777#define CONST_1111_FLOAT 2 2778#define PRIM_ID 3 2779 uint32_t SwizzleControlMode; 2780 bool ComponentOverrideX; 2781 bool ComponentOverrideY; 2782 bool ComponentOverrideZ; 2783 bool ComponentOverrideW; 2784}; 2785 2786static inline __attribute__((always_inline)) void 2787GFX125_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(__attribute__((unused)) __gen_user_data *data, 2788 __attribute__((unused)) void * restrict dst, 2789 __attribute__((unused)) const struct GFX125_SF_OUTPUT_ATTRIBUTE_DETAIL * restrict values) 2790{ 2791 uint32_t * restrict dw = (uint32_t * restrict) dst; 2792 2793 dw[0] = 2794 __gen_uint(values->SourceAttribute, 0, 4) | 2795 __gen_uint(values->SwizzleSelect, 6, 7) | 2796 __gen_uint(values->ConstantSource, 9, 10) | 2797 __gen_uint(values->SwizzleControlMode, 11, 11) | 2798 __gen_uint(values->ComponentOverrideX, 12, 12) | 2799 __gen_uint(values->ComponentOverrideY, 13, 13) | 2800 __gen_uint(values->ComponentOverrideZ, 14, 14) | 2801 __gen_uint(values->ComponentOverrideW, 15, 15); 2802} 2803 2804#define GFX125_SLICE_HASH_TABLE_length 32 2805struct GFX125_SLICE_HASH_TABLE { 2806 uint32_t Entry[16][16]; 2807}; 2808 2809static inline __attribute__((always_inline)) void 2810GFX125_SLICE_HASH_TABLE_pack(__attribute__((unused)) __gen_user_data *data, 2811 __attribute__((unused)) void * restrict dst, 2812 __attribute__((unused)) const struct GFX125_SLICE_HASH_TABLE * restrict values) 2813{ 2814 uint32_t * restrict dw = (uint32_t * restrict) dst; 2815 2816 dw[0] = 2817 __gen_uint(values->Entry[0][0], 0, 3) | 2818 __gen_uint(values->Entry[0][1], 4, 7) | 2819 __gen_uint(values->Entry[0][2], 8, 11) | 2820 __gen_uint(values->Entry[0][3], 12, 15) | 2821 __gen_uint(values->Entry[0][4], 16, 19) | 2822 __gen_uint(values->Entry[0][5], 20, 23) | 2823 __gen_uint(values->Entry[0][6], 24, 27) | 2824 __gen_uint(values->Entry[0][7], 28, 31); 2825 2826 dw[1] = 2827 __gen_uint(values->Entry[0][8], 0, 3) | 2828 __gen_uint(values->Entry[0][9], 4, 7) | 2829 __gen_uint(values->Entry[0][10], 8, 11) | 2830 __gen_uint(values->Entry[0][11], 12, 15) | 2831 __gen_uint(values->Entry[0][12], 16, 19) | 2832 __gen_uint(values->Entry[0][13], 20, 23) | 2833 __gen_uint(values->Entry[0][14], 24, 27) | 2834 __gen_uint(values->Entry[0][15], 28, 31); 2835 2836 dw[2] = 2837 __gen_uint(values->Entry[1][0], 0, 3) | 2838 __gen_uint(values->Entry[1][1], 4, 7) | 2839 __gen_uint(values->Entry[1][2], 8, 11) | 2840 __gen_uint(values->Entry[1][3], 12, 15) | 2841 __gen_uint(values->Entry[1][4], 16, 19) | 2842 __gen_uint(values->Entry[1][5], 20, 23) | 2843 __gen_uint(values->Entry[1][6], 24, 27) | 2844 __gen_uint(values->Entry[1][7], 28, 31); 2845 2846 dw[3] = 2847 __gen_uint(values->Entry[1][8], 0, 3) | 2848 __gen_uint(values->Entry[1][9], 4, 7) | 2849 __gen_uint(values->Entry[1][10], 8, 11) | 2850 __gen_uint(values->Entry[1][11], 12, 15) | 2851 __gen_uint(values->Entry[1][12], 16, 19) | 2852 __gen_uint(values->Entry[1][13], 20, 23) | 2853 __gen_uint(values->Entry[1][14], 24, 27) | 2854 __gen_uint(values->Entry[1][15], 28, 31); 2855 2856 dw[4] = 2857 __gen_uint(values->Entry[2][0], 0, 3) | 2858 __gen_uint(values->Entry[2][1], 4, 7) | 2859 __gen_uint(values->Entry[2][2], 8, 11) | 2860 __gen_uint(values->Entry[2][3], 12, 15) | 2861 __gen_uint(values->Entry[2][4], 16, 19) | 2862 __gen_uint(values->Entry[2][5], 20, 23) | 2863 __gen_uint(values->Entry[2][6], 24, 27) | 2864 __gen_uint(values->Entry[2][7], 28, 31); 2865 2866 dw[5] = 2867 __gen_uint(values->Entry[2][8], 0, 3) | 2868 __gen_uint(values->Entry[2][9], 4, 7) | 2869 __gen_uint(values->Entry[2][10], 8, 11) | 2870 __gen_uint(values->Entry[2][11], 12, 15) | 2871 __gen_uint(values->Entry[2][12], 16, 19) | 2872 __gen_uint(values->Entry[2][13], 20, 23) | 2873 __gen_uint(values->Entry[2][14], 24, 27) | 2874 __gen_uint(values->Entry[2][15], 28, 31); 2875 2876 dw[6] = 2877 __gen_uint(values->Entry[3][0], 0, 3) | 2878 __gen_uint(values->Entry[3][1], 4, 7) | 2879 __gen_uint(values->Entry[3][2], 8, 11) | 2880 __gen_uint(values->Entry[3][3], 12, 15) | 2881 __gen_uint(values->Entry[3][4], 16, 19) | 2882 __gen_uint(values->Entry[3][5], 20, 23) | 2883 __gen_uint(values->Entry[3][6], 24, 27) | 2884 __gen_uint(values->Entry[3][7], 28, 31); 2885 2886 dw[7] = 2887 __gen_uint(values->Entry[3][8], 0, 3) | 2888 __gen_uint(values->Entry[3][9], 4, 7) | 2889 __gen_uint(values->Entry[3][10], 8, 11) | 2890 __gen_uint(values->Entry[3][11], 12, 15) | 2891 __gen_uint(values->Entry[3][12], 16, 19) | 2892 __gen_uint(values->Entry[3][13], 20, 23) | 2893 __gen_uint(values->Entry[3][14], 24, 27) | 2894 __gen_uint(values->Entry[3][15], 28, 31); 2895 2896 dw[8] = 2897 __gen_uint(values->Entry[4][0], 0, 3) | 2898 __gen_uint(values->Entry[4][1], 4, 7) | 2899 __gen_uint(values->Entry[4][2], 8, 11) | 2900 __gen_uint(values->Entry[4][3], 12, 15) | 2901 __gen_uint(values->Entry[4][4], 16, 19) | 2902 __gen_uint(values->Entry[4][5], 20, 23) | 2903 __gen_uint(values->Entry[4][6], 24, 27) | 2904 __gen_uint(values->Entry[4][7], 28, 31); 2905 2906 dw[9] = 2907 __gen_uint(values->Entry[4][8], 0, 3) | 2908 __gen_uint(values->Entry[4][9], 4, 7) | 2909 __gen_uint(values->Entry[4][10], 8, 11) | 2910 __gen_uint(values->Entry[4][11], 12, 15) | 2911 __gen_uint(values->Entry[4][12], 16, 19) | 2912 __gen_uint(values->Entry[4][13], 20, 23) | 2913 __gen_uint(values->Entry[4][14], 24, 27) | 2914 __gen_uint(values->Entry[4][15], 28, 31); 2915 2916 dw[10] = 2917 __gen_uint(values->Entry[5][0], 0, 3) | 2918 __gen_uint(values->Entry[5][1], 4, 7) | 2919 __gen_uint(values->Entry[5][2], 8, 11) | 2920 __gen_uint(values->Entry[5][3], 12, 15) | 2921 __gen_uint(values->Entry[5][4], 16, 19) | 2922 __gen_uint(values->Entry[5][5], 20, 23) | 2923 __gen_uint(values->Entry[5][6], 24, 27) | 2924 __gen_uint(values->Entry[5][7], 28, 31); 2925 2926 dw[11] = 2927 __gen_uint(values->Entry[5][8], 0, 3) | 2928 __gen_uint(values->Entry[5][9], 4, 7) | 2929 __gen_uint(values->Entry[5][10], 8, 11) | 2930 __gen_uint(values->Entry[5][11], 12, 15) | 2931 __gen_uint(values->Entry[5][12], 16, 19) | 2932 __gen_uint(values->Entry[5][13], 20, 23) | 2933 __gen_uint(values->Entry[5][14], 24, 27) | 2934 __gen_uint(values->Entry[5][15], 28, 31); 2935 2936 dw[12] = 2937 __gen_uint(values->Entry[6][0], 0, 3) | 2938 __gen_uint(values->Entry[6][1], 4, 7) | 2939 __gen_uint(values->Entry[6][2], 8, 11) | 2940 __gen_uint(values->Entry[6][3], 12, 15) | 2941 __gen_uint(values->Entry[6][4], 16, 19) | 2942 __gen_uint(values->Entry[6][5], 20, 23) | 2943 __gen_uint(values->Entry[6][6], 24, 27) | 2944 __gen_uint(values->Entry[6][7], 28, 31); 2945 2946 dw[13] = 2947 __gen_uint(values->Entry[6][8], 0, 3) | 2948 __gen_uint(values->Entry[6][9], 4, 7) | 2949 __gen_uint(values->Entry[6][10], 8, 11) | 2950 __gen_uint(values->Entry[6][11], 12, 15) | 2951 __gen_uint(values->Entry[6][12], 16, 19) | 2952 __gen_uint(values->Entry[6][13], 20, 23) | 2953 __gen_uint(values->Entry[6][14], 24, 27) | 2954 __gen_uint(values->Entry[6][15], 28, 31); 2955 2956 dw[14] = 2957 __gen_uint(values->Entry[7][0], 0, 3) | 2958 __gen_uint(values->Entry[7][1], 4, 7) | 2959 __gen_uint(values->Entry[7][2], 8, 11) | 2960 __gen_uint(values->Entry[7][3], 12, 15) | 2961 __gen_uint(values->Entry[7][4], 16, 19) | 2962 __gen_uint(values->Entry[7][5], 20, 23) | 2963 __gen_uint(values->Entry[7][6], 24, 27) | 2964 __gen_uint(values->Entry[7][7], 28, 31); 2965 2966 dw[15] = 2967 __gen_uint(values->Entry[7][8], 0, 3) | 2968 __gen_uint(values->Entry[7][9], 4, 7) | 2969 __gen_uint(values->Entry[7][10], 8, 11) | 2970 __gen_uint(values->Entry[7][11], 12, 15) | 2971 __gen_uint(values->Entry[7][12], 16, 19) | 2972 __gen_uint(values->Entry[7][13], 20, 23) | 2973 __gen_uint(values->Entry[7][14], 24, 27) | 2974 __gen_uint(values->Entry[7][15], 28, 31); 2975 2976 dw[16] = 2977 __gen_uint(values->Entry[8][0], 0, 3) | 2978 __gen_uint(values->Entry[8][1], 4, 7) | 2979 __gen_uint(values->Entry[8][2], 8, 11) | 2980 __gen_uint(values->Entry[8][3], 12, 15) | 2981 __gen_uint(values->Entry[8][4], 16, 19) | 2982 __gen_uint(values->Entry[8][5], 20, 23) | 2983 __gen_uint(values->Entry[8][6], 24, 27) | 2984 __gen_uint(values->Entry[8][7], 28, 31); 2985 2986 dw[17] = 2987 __gen_uint(values->Entry[8][8], 0, 3) | 2988 __gen_uint(values->Entry[8][9], 4, 7) | 2989 __gen_uint(values->Entry[8][10], 8, 11) | 2990 __gen_uint(values->Entry[8][11], 12, 15) | 2991 __gen_uint(values->Entry[8][12], 16, 19) | 2992 __gen_uint(values->Entry[8][13], 20, 23) | 2993 __gen_uint(values->Entry[8][14], 24, 27) | 2994 __gen_uint(values->Entry[8][15], 28, 31); 2995 2996 dw[18] = 2997 __gen_uint(values->Entry[9][0], 0, 3) | 2998 __gen_uint(values->Entry[9][1], 4, 7) | 2999 __gen_uint(values->Entry[9][2], 8, 11) | 3000 __gen_uint(values->Entry[9][3], 12, 15) | 3001 __gen_uint(values->Entry[9][4], 16, 19) | 3002 __gen_uint(values->Entry[9][5], 20, 23) | 3003 __gen_uint(values->Entry[9][6], 24, 27) | 3004 __gen_uint(values->Entry[9][7], 28, 31); 3005 3006 dw[19] = 3007 __gen_uint(values->Entry[9][8], 0, 3) | 3008 __gen_uint(values->Entry[9][9], 4, 7) | 3009 __gen_uint(values->Entry[9][10], 8, 11) | 3010 __gen_uint(values->Entry[9][11], 12, 15) | 3011 __gen_uint(values->Entry[9][12], 16, 19) | 3012 __gen_uint(values->Entry[9][13], 20, 23) | 3013 __gen_uint(values->Entry[9][14], 24, 27) | 3014 __gen_uint(values->Entry[9][15], 28, 31); 3015 3016 dw[20] = 3017 __gen_uint(values->Entry[10][0], 0, 3) | 3018 __gen_uint(values->Entry[10][1], 4, 7) | 3019 __gen_uint(values->Entry[10][2], 8, 11) | 3020 __gen_uint(values->Entry[10][3], 12, 15) | 3021 __gen_uint(values->Entry[10][4], 16, 19) | 3022 __gen_uint(values->Entry[10][5], 20, 23) | 3023 __gen_uint(values->Entry[10][6], 24, 27) | 3024 __gen_uint(values->Entry[10][7], 28, 31); 3025 3026 dw[21] = 3027 __gen_uint(values->Entry[10][8], 0, 3) | 3028 __gen_uint(values->Entry[10][9], 4, 7) | 3029 __gen_uint(values->Entry[10][10], 8, 11) | 3030 __gen_uint(values->Entry[10][11], 12, 15) | 3031 __gen_uint(values->Entry[10][12], 16, 19) | 3032 __gen_uint(values->Entry[10][13], 20, 23) | 3033 __gen_uint(values->Entry[10][14], 24, 27) | 3034 __gen_uint(values->Entry[10][15], 28, 31); 3035 3036 dw[22] = 3037 __gen_uint(values->Entry[11][0], 0, 3) | 3038 __gen_uint(values->Entry[11][1], 4, 7) | 3039 __gen_uint(values->Entry[11][2], 8, 11) | 3040 __gen_uint(values->Entry[11][3], 12, 15) | 3041 __gen_uint(values->Entry[11][4], 16, 19) | 3042 __gen_uint(values->Entry[11][5], 20, 23) | 3043 __gen_uint(values->Entry[11][6], 24, 27) | 3044 __gen_uint(values->Entry[11][7], 28, 31); 3045 3046 dw[23] = 3047 __gen_uint(values->Entry[11][8], 0, 3) | 3048 __gen_uint(values->Entry[11][9], 4, 7) | 3049 __gen_uint(values->Entry[11][10], 8, 11) | 3050 __gen_uint(values->Entry[11][11], 12, 15) | 3051 __gen_uint(values->Entry[11][12], 16, 19) | 3052 __gen_uint(values->Entry[11][13], 20, 23) | 3053 __gen_uint(values->Entry[11][14], 24, 27) | 3054 __gen_uint(values->Entry[11][15], 28, 31); 3055 3056 dw[24] = 3057 __gen_uint(values->Entry[12][0], 0, 3) | 3058 __gen_uint(values->Entry[12][1], 4, 7) | 3059 __gen_uint(values->Entry[12][2], 8, 11) | 3060 __gen_uint(values->Entry[12][3], 12, 15) | 3061 __gen_uint(values->Entry[12][4], 16, 19) | 3062 __gen_uint(values->Entry[12][5], 20, 23) | 3063 __gen_uint(values->Entry[12][6], 24, 27) | 3064 __gen_uint(values->Entry[12][7], 28, 31); 3065 3066 dw[25] = 3067 __gen_uint(values->Entry[12][8], 0, 3) | 3068 __gen_uint(values->Entry[12][9], 4, 7) | 3069 __gen_uint(values->Entry[12][10], 8, 11) | 3070 __gen_uint(values->Entry[12][11], 12, 15) | 3071 __gen_uint(values->Entry[12][12], 16, 19) | 3072 __gen_uint(values->Entry[12][13], 20, 23) | 3073 __gen_uint(values->Entry[12][14], 24, 27) | 3074 __gen_uint(values->Entry[12][15], 28, 31); 3075 3076 dw[26] = 3077 __gen_uint(values->Entry[13][0], 0, 3) | 3078 __gen_uint(values->Entry[13][1], 4, 7) | 3079 __gen_uint(values->Entry[13][2], 8, 11) | 3080 __gen_uint(values->Entry[13][3], 12, 15) | 3081 __gen_uint(values->Entry[13][4], 16, 19) | 3082 __gen_uint(values->Entry[13][5], 20, 23) | 3083 __gen_uint(values->Entry[13][6], 24, 27) | 3084 __gen_uint(values->Entry[13][7], 28, 31); 3085 3086 dw[27] = 3087 __gen_uint(values->Entry[13][8], 0, 3) | 3088 __gen_uint(values->Entry[13][9], 4, 7) | 3089 __gen_uint(values->Entry[13][10], 8, 11) | 3090 __gen_uint(values->Entry[13][11], 12, 15) | 3091 __gen_uint(values->Entry[13][12], 16, 19) | 3092 __gen_uint(values->Entry[13][13], 20, 23) | 3093 __gen_uint(values->Entry[13][14], 24, 27) | 3094 __gen_uint(values->Entry[13][15], 28, 31); 3095 3096 dw[28] = 3097 __gen_uint(values->Entry[14][0], 0, 3) | 3098 __gen_uint(values->Entry[14][1], 4, 7) | 3099 __gen_uint(values->Entry[14][2], 8, 11) | 3100 __gen_uint(values->Entry[14][3], 12, 15) | 3101 __gen_uint(values->Entry[14][4], 16, 19) | 3102 __gen_uint(values->Entry[14][5], 20, 23) | 3103 __gen_uint(values->Entry[14][6], 24, 27) | 3104 __gen_uint(values->Entry[14][7], 28, 31); 3105 3106 dw[29] = 3107 __gen_uint(values->Entry[14][8], 0, 3) | 3108 __gen_uint(values->Entry[14][9], 4, 7) | 3109 __gen_uint(values->Entry[14][10], 8, 11) | 3110 __gen_uint(values->Entry[14][11], 12, 15) | 3111 __gen_uint(values->Entry[14][12], 16, 19) | 3112 __gen_uint(values->Entry[14][13], 20, 23) | 3113 __gen_uint(values->Entry[14][14], 24, 27) | 3114 __gen_uint(values->Entry[14][15], 28, 31); 3115 3116 dw[30] = 3117 __gen_uint(values->Entry[15][0], 0, 3) | 3118 __gen_uint(values->Entry[15][1], 4, 7) | 3119 __gen_uint(values->Entry[15][2], 8, 11) | 3120 __gen_uint(values->Entry[15][3], 12, 15) | 3121 __gen_uint(values->Entry[15][4], 16, 19) | 3122 __gen_uint(values->Entry[15][5], 20, 23) | 3123 __gen_uint(values->Entry[15][6], 24, 27) | 3124 __gen_uint(values->Entry[15][7], 28, 31); 3125 3126 dw[31] = 3127 __gen_uint(values->Entry[15][8], 0, 3) | 3128 __gen_uint(values->Entry[15][9], 4, 7) | 3129 __gen_uint(values->Entry[15][10], 8, 11) | 3130 __gen_uint(values->Entry[15][11], 12, 15) | 3131 __gen_uint(values->Entry[15][12], 16, 19) | 3132 __gen_uint(values->Entry[15][13], 20, 23) | 3133 __gen_uint(values->Entry[15][14], 24, 27) | 3134 __gen_uint(values->Entry[15][15], 28, 31); 3135} 3136 3137#define GFX125_SO_DECL_length 1 3138struct GFX125_SO_DECL { 3139 uint32_t ComponentMask; 3140 uint32_t RegisterIndex; 3141 bool HoleFlag; 3142 uint32_t OutputBufferSlot; 3143}; 3144 3145static inline __attribute__((always_inline)) void 3146GFX125_SO_DECL_pack(__attribute__((unused)) __gen_user_data *data, 3147 __attribute__((unused)) void * restrict dst, 3148 __attribute__((unused)) const struct GFX125_SO_DECL * restrict values) 3149{ 3150 uint32_t * restrict dw = (uint32_t * restrict) dst; 3151 3152 dw[0] = 3153 __gen_uint(values->ComponentMask, 0, 3) | 3154 __gen_uint(values->RegisterIndex, 4, 9) | 3155 __gen_uint(values->HoleFlag, 11, 11) | 3156 __gen_uint(values->OutputBufferSlot, 12, 13); 3157} 3158 3159#define GFX125_SO_DECL_ENTRY_length 2 3160struct GFX125_SO_DECL_ENTRY { 3161 struct GFX125_SO_DECL Stream0Decl; 3162 struct GFX125_SO_DECL Stream1Decl; 3163 struct GFX125_SO_DECL Stream2Decl; 3164 struct GFX125_SO_DECL Stream3Decl; 3165}; 3166 3167static inline __attribute__((always_inline)) void 3168GFX125_SO_DECL_ENTRY_pack(__attribute__((unused)) __gen_user_data *data, 3169 __attribute__((unused)) void * restrict dst, 3170 __attribute__((unused)) const struct GFX125_SO_DECL_ENTRY * restrict values) 3171{ 3172 uint32_t * restrict dw = (uint32_t * restrict) dst; 3173 3174 uint32_t v0_0; 3175 GFX125_SO_DECL_pack(data, &v0_0, &values->Stream0Decl); 3176 3177 uint32_t v0_1; 3178 GFX125_SO_DECL_pack(data, &v0_1, &values->Stream1Decl); 3179 3180 dw[0] = 3181 __gen_uint(v0_0, 0, 15) | 3182 __gen_uint(v0_1, 16, 31); 3183 3184 uint32_t v1_0; 3185 GFX125_SO_DECL_pack(data, &v1_0, &values->Stream2Decl); 3186 3187 uint32_t v1_1; 3188 GFX125_SO_DECL_pack(data, &v1_1, &values->Stream3Decl); 3189 3190 dw[1] = 3191 __gen_uint(v1_0, 0, 15) | 3192 __gen_uint(v1_1, 16, 31); 3193} 3194 3195#define GFX125_VDENC_SURFACE_CONTROL_BITS_length 1 3196struct GFX125_VDENC_SURFACE_CONTROL_BITS { 3197 uint32_t MOCS; 3198 uint32_t ArbitrationPriorityControl; 3199#define Highestpriority 0 3200#define Secondhighestpriority 1 3201#define Thirdhighestpriority 2 3202#define Lowestpriority 3 3203 bool MemoryCompressionEnable; 3204 uint32_t MemoryCompressionMode; 3205 uint32_t CacheSelect; 3206 uint32_t TiledResourceMode; 3207#define TRMODE_NONE 0 3208#define TRMODE_TILEYF 1 3209#define TRMODE_TILEYS 2 3210}; 3211 3212static inline __attribute__((always_inline)) void 3213GFX125_VDENC_SURFACE_CONTROL_BITS_pack(__attribute__((unused)) __gen_user_data *data, 3214 __attribute__((unused)) void * restrict dst, 3215 __attribute__((unused)) const struct GFX125_VDENC_SURFACE_CONTROL_BITS * restrict values) 3216{ 3217 uint32_t * restrict dw = (uint32_t * restrict) dst; 3218 3219 dw[0] = 3220 __gen_uint(values->MOCS, 1, 6) | 3221 __gen_uint(values->ArbitrationPriorityControl, 7, 8) | 3222 __gen_uint(values->MemoryCompressionEnable, 9, 9) | 3223 __gen_uint(values->MemoryCompressionMode, 10, 10) | 3224 __gen_uint(values->CacheSelect, 12, 12) | 3225 __gen_uint(values->TiledResourceMode, 13, 14); 3226} 3227 3228#define GFX125_VDENC_PICTURE_length 3 3229struct GFX125_VDENC_PICTURE { 3230 __gen_address_type Address; 3231 struct GFX125_VDENC_SURFACE_CONTROL_BITS PictureFields; 3232}; 3233 3234static inline __attribute__((always_inline)) void 3235GFX125_VDENC_PICTURE_pack(__attribute__((unused)) __gen_user_data *data, 3236 __attribute__((unused)) void * restrict dst, 3237 __attribute__((unused)) const struct GFX125_VDENC_PICTURE * restrict values) 3238{ 3239 uint32_t * restrict dw = (uint32_t * restrict) dst; 3240 3241 const uint64_t v0_address = 3242 __gen_address(data, &dw[0], values->Address, 0, 0, 63); 3243 dw[0] = v0_address; 3244 dw[1] = v0_address >> 32; 3245 3246 GFX125_VDENC_SURFACE_CONTROL_BITS_pack(data, &dw[2], &values->PictureFields); 3247} 3248 3249#define GFX125_VDENC_SURFACE_STATE_FIELDS_length 4 3250struct GFX125_VDENC_SURFACE_STATE_FIELDS { 3251 float CrVCbUPixelOffsetVDirection; 3252 bool SurfaceFormatByteSwizzle; 3253 uint32_t Colorspaceselection; 3254 uint32_t Width; 3255 uint32_t Height; 3256 uint32_t TileWalk; 3257#define TW_XMAJOR 0 3258#define TW_YMAJOR 1 3259 uint32_t TiledSurface; 3260 bool HalfPitchforChroma; 3261 uint32_t SurfacePitch; 3262 uint32_t ChromaDownsampleFilterControl; 3263 uint32_t Format; 3264 uint32_t SurfaceFormat; 3265#define VDENC_YUV422 0 3266#define VDENC_RGBA4444 1 3267#define VDENC_YUV444 2 3268#define VDENC_Y8_UNORM 3 3269#define VDENC_PLANAR_420_8 4 3270 uint32_t YOffsetforUCb; 3271 uint32_t XOffsetforUCb; 3272 uint32_t YOffsetforVCr; 3273 uint32_t XOffsetforVCr; 3274}; 3275 3276static inline __attribute__((always_inline)) void 3277GFX125_VDENC_SURFACE_STATE_FIELDS_pack(__attribute__((unused)) __gen_user_data *data, 3278 __attribute__((unused)) void * restrict dst, 3279 __attribute__((unused)) const struct GFX125_VDENC_SURFACE_STATE_FIELDS * restrict values) 3280{ 3281 uint32_t * restrict dw = (uint32_t * restrict) dst; 3282 3283 dw[0] = 3284 __gen_ufixed(values->CrVCbUPixelOffsetVDirection, 0, 1, 2) | 3285 __gen_uint(values->SurfaceFormatByteSwizzle, 2, 2) | 3286 __gen_uint(values->Colorspaceselection, 3, 3) | 3287 __gen_uint(values->Width, 4, 17) | 3288 __gen_uint(values->Height, 18, 31); 3289 3290 dw[1] = 3291 __gen_uint(values->TileWalk, 0, 0) | 3292 __gen_uint(values->TiledSurface, 1, 1) | 3293 __gen_uint(values->HalfPitchforChroma, 2, 2) | 3294 __gen_uint(values->SurfacePitch, 3, 19) | 3295 __gen_uint(values->ChromaDownsampleFilterControl, 20, 22) | 3296 __gen_uint(values->Format, 27, 31) | 3297 __gen_uint(values->SurfaceFormat, 28, 31); 3298 3299 dw[2] = 3300 __gen_uint(values->YOffsetforUCb, 0, 14) | 3301 __gen_uint(values->XOffsetforUCb, 16, 30); 3302 3303 dw[3] = 3304 __gen_uint(values->YOffsetforVCr, 0, 15) | 3305 __gen_uint(values->XOffsetforVCr, 16, 28); 3306} 3307 3308#define GFX125_VERTEX_BUFFER_STATE_length 4 3309struct GFX125_VERTEX_BUFFER_STATE { 3310 uint32_t BufferPitch; 3311 bool NullVertexBuffer; 3312 bool AddressModifyEnable; 3313 uint32_t MOCS; 3314 bool L3BypassDisable; 3315 uint32_t VertexBufferIndex; 3316 __gen_address_type BufferStartingAddress; 3317 uint32_t BufferSize; 3318}; 3319 3320static inline __attribute__((always_inline)) void 3321GFX125_VERTEX_BUFFER_STATE_pack(__attribute__((unused)) __gen_user_data *data, 3322 __attribute__((unused)) void * restrict dst, 3323 __attribute__((unused)) const struct GFX125_VERTEX_BUFFER_STATE * restrict values) 3324{ 3325 uint32_t * restrict dw = (uint32_t * restrict) dst; 3326 3327 dw[0] = 3328 __gen_uint(values->BufferPitch, 0, 11) | 3329 __gen_uint(values->NullVertexBuffer, 13, 13) | 3330 __gen_uint(values->AddressModifyEnable, 14, 14) | 3331 __gen_uint(values->MOCS, 16, 22) | 3332 __gen_uint(values->L3BypassDisable, 25, 25) | 3333 __gen_uint(values->VertexBufferIndex, 26, 31); 3334 3335 const uint64_t v1_address = 3336 __gen_address(data, &dw[1], values->BufferStartingAddress, 0, 0, 63); 3337 dw[1] = v1_address; 3338 dw[2] = v1_address >> 32; 3339 3340 dw[3] = 3341 __gen_uint(values->BufferSize, 0, 31); 3342} 3343 3344#define GFX125_VERTEX_ELEMENT_STATE_length 2 3345struct GFX125_VERTEX_ELEMENT_STATE { 3346 uint32_t SourceElementOffset; 3347 bool EdgeFlagEnable; 3348 uint32_t SourceElementFormat; 3349 bool Valid; 3350 uint32_t VertexBufferIndex; 3351 enum GFX125_3D_Vertex_Component_Control Component3Control; 3352 enum GFX125_3D_Vertex_Component_Control Component2Control; 3353 enum GFX125_3D_Vertex_Component_Control Component1Control; 3354 enum GFX125_3D_Vertex_Component_Control Component0Control; 3355}; 3356 3357static inline __attribute__((always_inline)) void 3358GFX125_VERTEX_ELEMENT_STATE_pack(__attribute__((unused)) __gen_user_data *data, 3359 __attribute__((unused)) void * restrict dst, 3360 __attribute__((unused)) const struct GFX125_VERTEX_ELEMENT_STATE * restrict values) 3361{ 3362 uint32_t * restrict dw = (uint32_t * restrict) dst; 3363 3364 dw[0] = 3365 __gen_uint(values->SourceElementOffset, 0, 11) | 3366 __gen_uint(values->EdgeFlagEnable, 15, 15) | 3367 __gen_uint(values->SourceElementFormat, 16, 24) | 3368 __gen_uint(values->Valid, 25, 25) | 3369 __gen_uint(values->VertexBufferIndex, 26, 31); 3370 3371 dw[1] = 3372 __gen_uint(values->Component3Control, 16, 18) | 3373 __gen_uint(values->Component2Control, 20, 22) | 3374 __gen_uint(values->Component1Control, 24, 26) | 3375 __gen_uint(values->Component0Control, 28, 30); 3376} 3377 3378#define GFX125_3DPRIMITIVE_length 7 3379#define GFX125_3DPRIMITIVE_length_bias 2 3380#define GFX125_3DPRIMITIVE_header \ 3381 .DWordLength = 5, \ 3382 ._3DCommandSubOpcode = 0, \ 3383 ._3DCommandOpcode = 3, \ 3384 .CommandSubType = 3, \ 3385 .CommandType = 3 3386 3387struct GFX125_3DPRIMITIVE { 3388 uint32_t DWordLength; 3389 bool PredicateEnable; 3390 bool UAVCoherencyRequired; 3391 bool IndirectParameterEnable; 3392 uint32_t ExtendedParametersPresent; 3393 uint32_t _3DCommandSubOpcode; 3394 uint32_t _3DCommandOpcode; 3395 uint32_t CommandSubType; 3396 uint32_t CommandType; 3397 enum GFX125_3D_Prim_Topo_Type PrimitiveTopologyType; 3398 uint32_t VertexAccessType; 3399#define SEQUENTIAL 0 3400#define RANDOM 1 3401 bool EndOffsetEnable; 3402 uint32_t VertexCountPerInstance; 3403 uint32_t StartVertexLocation; 3404 uint32_t InstanceCount; 3405 uint32_t StartInstanceLocation; 3406 int32_t BaseVertexLocation; 3407 uint32_t ExtendedParameter0; 3408 uint32_t ExtendedParameter1; 3409 uint32_t ExtendedParameter2; 3410}; 3411 3412static inline __attribute__((always_inline)) void 3413GFX125_3DPRIMITIVE_pack(__attribute__((unused)) __gen_user_data *data, 3414 __attribute__((unused)) void * restrict dst, 3415 __attribute__((unused)) const struct GFX125_3DPRIMITIVE * restrict values) 3416{ 3417 uint32_t * restrict dw = (uint32_t * restrict) dst; 3418 3419 dw[0] = 3420 __gen_uint(values->DWordLength, 0, 7) | 3421 __gen_uint(values->PredicateEnable, 8, 8) | 3422 __gen_uint(values->UAVCoherencyRequired, 9, 9) | 3423 __gen_uint(values->IndirectParameterEnable, 10, 10) | 3424 __gen_uint(values->ExtendedParametersPresent, 11, 11) | 3425 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 3426 __gen_uint(values->_3DCommandOpcode, 24, 26) | 3427 __gen_uint(values->CommandSubType, 27, 28) | 3428 __gen_uint(values->CommandType, 29, 31); 3429 3430 dw[1] = 3431 __gen_uint(values->PrimitiveTopologyType, 0, 5) | 3432 __gen_uint(values->VertexAccessType, 8, 8) | 3433 __gen_uint(values->EndOffsetEnable, 9, 9); 3434 3435 dw[2] = 3436 __gen_uint(values->VertexCountPerInstance, 0, 31); 3437 3438 dw[3] = 3439 __gen_uint(values->StartVertexLocation, 0, 31); 3440 3441 dw[4] = 3442 __gen_uint(values->InstanceCount, 0, 31); 3443 3444 dw[5] = 3445 __gen_uint(values->StartInstanceLocation, 0, 31); 3446 3447 dw[6] = 3448 __gen_sint(values->BaseVertexLocation, 0, 31); 3449} 3450 3451#define GFX125_3DSTATE_3D_MODE_length 2 3452#define GFX125_3DSTATE_3D_MODE_length_bias 2 3453#define GFX125_3DSTATE_3D_MODE_header \ 3454 .DWordLength = 0, \ 3455 ._3DCommandSubOpcode = 30, \ 3456 ._3DCommandOpcode = 1, \ 3457 .CommandSubType = 3, \ 3458 .CommandType = 3 3459 3460struct GFX125_3DSTATE_3D_MODE { 3461 uint32_t DWordLength; 3462 uint32_t _3DCommandSubOpcode; 3463 uint32_t _3DCommandOpcode; 3464 uint32_t CommandSubType; 3465 uint32_t CommandType; 3466 uint32_t CrossSliceHashingMode; 3467#define NormalMode 0 3468#define Disable 1 3469#define hashing32x32 3 3470 bool _3DScoreboardHashingMode; 3471 bool SubsliceHashingTableEnable; 3472 bool SliceHashingTableEnable; 3473 uint32_t CrossSliceHashingModeMask; 3474 bool _3DScoreboardHashingModeMask; 3475 bool SubsliceHashingTableEnableMask; 3476 bool SliceHashingTableEnableMask; 3477}; 3478 3479static inline __attribute__((always_inline)) void 3480GFX125_3DSTATE_3D_MODE_pack(__attribute__((unused)) __gen_user_data *data, 3481 __attribute__((unused)) void * restrict dst, 3482 __attribute__((unused)) const struct GFX125_3DSTATE_3D_MODE * restrict values) 3483{ 3484 uint32_t * restrict dw = (uint32_t * restrict) dst; 3485 3486 dw[0] = 3487 __gen_uint(values->DWordLength, 0, 7) | 3488 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 3489 __gen_uint(values->_3DCommandOpcode, 24, 26) | 3490 __gen_uint(values->CommandSubType, 27, 28) | 3491 __gen_uint(values->CommandType, 29, 31); 3492 3493 dw[1] = 3494 __gen_uint(values->CrossSliceHashingMode, 0, 1) | 3495 __gen_uint(values->_3DScoreboardHashingMode, 4, 4) | 3496 __gen_uint(values->SubsliceHashingTableEnable, 5, 5) | 3497 __gen_uint(values->SliceHashingTableEnable, 6, 6) | 3498 __gen_uint(values->CrossSliceHashingModeMask, 16, 17) | 3499 __gen_uint(values->_3DScoreboardHashingModeMask, 20, 20) | 3500 __gen_uint(values->SubsliceHashingTableEnableMask, 21, 21) | 3501 __gen_uint(values->SliceHashingTableEnableMask, 22, 22); 3502} 3503 3504#define GFX125_3DSTATE_AA_LINE_PARAMETERS_length 3 3505#define GFX125_3DSTATE_AA_LINE_PARAMETERS_length_bias 2 3506#define GFX125_3DSTATE_AA_LINE_PARAMETERS_header\ 3507 .DWordLength = 1, \ 3508 ._3DCommandSubOpcode = 10, \ 3509 ._3DCommandOpcode = 1, \ 3510 .CommandSubType = 3, \ 3511 .CommandType = 3 3512 3513struct GFX125_3DSTATE_AA_LINE_PARAMETERS { 3514 uint32_t DWordLength; 3515 uint32_t _3DCommandSubOpcode; 3516 uint32_t _3DCommandOpcode; 3517 uint32_t CommandSubType; 3518 uint32_t CommandType; 3519 float AACoverageSlope; 3520 float AAPointCoverageSlope; 3521 float AACoverageBias; 3522 float AAPointCoverageBias; 3523 float AACoverageEndCapSlope; 3524 float AAPointCoverageEndCapSlope; 3525 float AACoverageEndCapBias; 3526 float AAPointCoverageEndCapBias; 3527}; 3528 3529static inline __attribute__((always_inline)) void 3530GFX125_3DSTATE_AA_LINE_PARAMETERS_pack(__attribute__((unused)) __gen_user_data *data, 3531 __attribute__((unused)) void * restrict dst, 3532 __attribute__((unused)) const struct GFX125_3DSTATE_AA_LINE_PARAMETERS * restrict values) 3533{ 3534 uint32_t * restrict dw = (uint32_t * restrict) dst; 3535 3536 dw[0] = 3537 __gen_uint(values->DWordLength, 0, 7) | 3538 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 3539 __gen_uint(values->_3DCommandOpcode, 24, 26) | 3540 __gen_uint(values->CommandSubType, 27, 28) | 3541 __gen_uint(values->CommandType, 29, 31); 3542 3543 dw[1] = 3544 __gen_ufixed(values->AACoverageSlope, 0, 7, 8) | 3545 __gen_ufixed(values->AAPointCoverageSlope, 8, 15, 8) | 3546 __gen_ufixed(values->AACoverageBias, 16, 23, 8) | 3547 __gen_ufixed(values->AAPointCoverageBias, 24, 31, 8); 3548 3549 dw[2] = 3550 __gen_ufixed(values->AACoverageEndCapSlope, 0, 7, 8) | 3551 __gen_ufixed(values->AAPointCoverageEndCapSlope, 8, 15, 8) | 3552 __gen_ufixed(values->AACoverageEndCapBias, 16, 23, 8) | 3553 __gen_ufixed(values->AAPointCoverageEndCapBias, 24, 31, 8); 3554} 3555 3556#define GFX125_3DSTATE_BINDING_TABLE_EDIT_DS_length_bias 2 3557#define GFX125_3DSTATE_BINDING_TABLE_EDIT_DS_header\ 3558 .DWordLength = 0, \ 3559 ._3DCommandSubOpcode = 70, \ 3560 ._3DCommandOpcode = 0, \ 3561 .CommandSubType = 3, \ 3562 .CommandType = 3 3563 3564struct GFX125_3DSTATE_BINDING_TABLE_EDIT_DS { 3565 uint32_t DWordLength; 3566 uint32_t _3DCommandSubOpcode; 3567 uint32_t _3DCommandOpcode; 3568 uint32_t CommandSubType; 3569 uint32_t CommandType; 3570 uint32_t BindingTableEditTarget; 3571#define AllCores 3 3572#define Core1 2 3573#define Core0 1 3574 uint32_t BindingTableBlockClear; 3575 /* variable length fields follow */ 3576}; 3577 3578static inline __attribute__((always_inline)) void 3579GFX125_3DSTATE_BINDING_TABLE_EDIT_DS_pack(__attribute__((unused)) __gen_user_data *data, 3580 __attribute__((unused)) void * restrict dst, 3581 __attribute__((unused)) const struct GFX125_3DSTATE_BINDING_TABLE_EDIT_DS * restrict values) 3582{ 3583 uint32_t * restrict dw = (uint32_t * restrict) dst; 3584 3585 dw[0] = 3586 __gen_uint(values->DWordLength, 0, 8) | 3587 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 3588 __gen_uint(values->_3DCommandOpcode, 24, 26) | 3589 __gen_uint(values->CommandSubType, 27, 28) | 3590 __gen_uint(values->CommandType, 29, 31); 3591 3592 dw[1] = 3593 __gen_uint(values->BindingTableEditTarget, 0, 1) | 3594 __gen_uint(values->BindingTableBlockClear, 16, 31); 3595} 3596 3597#define GFX125_3DSTATE_BINDING_TABLE_EDIT_GS_length_bias 2 3598#define GFX125_3DSTATE_BINDING_TABLE_EDIT_GS_header\ 3599 .DWordLength = 0, \ 3600 ._3DCommandSubOpcode = 68, \ 3601 ._3DCommandOpcode = 0, \ 3602 .CommandSubType = 3, \ 3603 .CommandType = 3 3604 3605struct GFX125_3DSTATE_BINDING_TABLE_EDIT_GS { 3606 uint32_t DWordLength; 3607 uint32_t _3DCommandSubOpcode; 3608 uint32_t _3DCommandOpcode; 3609 uint32_t CommandSubType; 3610 uint32_t CommandType; 3611 uint32_t BindingTableEditTarget; 3612#define AllCores 3 3613#define Core1 2 3614#define Core0 1 3615 uint32_t BindingTableBlockClear; 3616 /* variable length fields follow */ 3617}; 3618 3619static inline __attribute__((always_inline)) void 3620GFX125_3DSTATE_BINDING_TABLE_EDIT_GS_pack(__attribute__((unused)) __gen_user_data *data, 3621 __attribute__((unused)) void * restrict dst, 3622 __attribute__((unused)) const struct GFX125_3DSTATE_BINDING_TABLE_EDIT_GS * restrict values) 3623{ 3624 uint32_t * restrict dw = (uint32_t * restrict) dst; 3625 3626 dw[0] = 3627 __gen_uint(values->DWordLength, 0, 8) | 3628 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 3629 __gen_uint(values->_3DCommandOpcode, 24, 26) | 3630 __gen_uint(values->CommandSubType, 27, 28) | 3631 __gen_uint(values->CommandType, 29, 31); 3632 3633 dw[1] = 3634 __gen_uint(values->BindingTableEditTarget, 0, 1) | 3635 __gen_uint(values->BindingTableBlockClear, 16, 31); 3636} 3637 3638#define GFX125_3DSTATE_BINDING_TABLE_EDIT_HS_length_bias 2 3639#define GFX125_3DSTATE_BINDING_TABLE_EDIT_HS_header\ 3640 .DWordLength = 0, \ 3641 ._3DCommandSubOpcode = 69, \ 3642 ._3DCommandOpcode = 0, \ 3643 .CommandSubType = 3, \ 3644 .CommandType = 3 3645 3646struct GFX125_3DSTATE_BINDING_TABLE_EDIT_HS { 3647 uint32_t DWordLength; 3648 uint32_t _3DCommandSubOpcode; 3649 uint32_t _3DCommandOpcode; 3650 uint32_t CommandSubType; 3651 uint32_t CommandType; 3652 uint32_t BindingTableEditTarget; 3653#define AllCores 3 3654#define Core1 2 3655#define Core0 1 3656 uint32_t BindingTableBlockClear; 3657 /* variable length fields follow */ 3658}; 3659 3660static inline __attribute__((always_inline)) void 3661GFX125_3DSTATE_BINDING_TABLE_EDIT_HS_pack(__attribute__((unused)) __gen_user_data *data, 3662 __attribute__((unused)) void * restrict dst, 3663 __attribute__((unused)) const struct GFX125_3DSTATE_BINDING_TABLE_EDIT_HS * restrict values) 3664{ 3665 uint32_t * restrict dw = (uint32_t * restrict) dst; 3666 3667 dw[0] = 3668 __gen_uint(values->DWordLength, 0, 8) | 3669 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 3670 __gen_uint(values->_3DCommandOpcode, 24, 26) | 3671 __gen_uint(values->CommandSubType, 27, 28) | 3672 __gen_uint(values->CommandType, 29, 31); 3673 3674 dw[1] = 3675 __gen_uint(values->BindingTableEditTarget, 0, 1) | 3676 __gen_uint(values->BindingTableBlockClear, 16, 31); 3677} 3678 3679#define GFX125_3DSTATE_BINDING_TABLE_EDIT_PS_length_bias 2 3680#define GFX125_3DSTATE_BINDING_TABLE_EDIT_PS_header\ 3681 .DWordLength = 0, \ 3682 ._3DCommandSubOpcode = 71, \ 3683 ._3DCommandOpcode = 0, \ 3684 .CommandSubType = 3, \ 3685 .CommandType = 3 3686 3687struct GFX125_3DSTATE_BINDING_TABLE_EDIT_PS { 3688 uint32_t DWordLength; 3689 uint32_t _3DCommandSubOpcode; 3690 uint32_t _3DCommandOpcode; 3691 uint32_t CommandSubType; 3692 uint32_t CommandType; 3693 uint32_t BindingTableEditTarget; 3694#define AllCores 3 3695#define Core1 2 3696#define Core0 1 3697 uint32_t BindingTableBlockClear; 3698 /* variable length fields follow */ 3699}; 3700 3701static inline __attribute__((always_inline)) void 3702GFX125_3DSTATE_BINDING_TABLE_EDIT_PS_pack(__attribute__((unused)) __gen_user_data *data, 3703 __attribute__((unused)) void * restrict dst, 3704 __attribute__((unused)) const struct GFX125_3DSTATE_BINDING_TABLE_EDIT_PS * restrict values) 3705{ 3706 uint32_t * restrict dw = (uint32_t * restrict) dst; 3707 3708 dw[0] = 3709 __gen_uint(values->DWordLength, 0, 8) | 3710 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 3711 __gen_uint(values->_3DCommandOpcode, 24, 26) | 3712 __gen_uint(values->CommandSubType, 27, 28) | 3713 __gen_uint(values->CommandType, 29, 31); 3714 3715 dw[1] = 3716 __gen_uint(values->BindingTableEditTarget, 0, 1) | 3717 __gen_uint(values->BindingTableBlockClear, 16, 31); 3718} 3719 3720#define GFX125_3DSTATE_BINDING_TABLE_EDIT_VS_length_bias 2 3721#define GFX125_3DSTATE_BINDING_TABLE_EDIT_VS_header\ 3722 .DWordLength = 0, \ 3723 ._3DCommandSubOpcode = 67, \ 3724 ._3DCommandOpcode = 0, \ 3725 .CommandSubType = 3, \ 3726 .CommandType = 3 3727 3728struct GFX125_3DSTATE_BINDING_TABLE_EDIT_VS { 3729 uint32_t DWordLength; 3730 uint32_t _3DCommandSubOpcode; 3731 uint32_t _3DCommandOpcode; 3732 uint32_t CommandSubType; 3733 uint32_t CommandType; 3734 uint32_t BindingTableEditTarget; 3735#define AllCores 3 3736#define Core1 2 3737#define Core0 1 3738 uint32_t BindingTableBlockClear; 3739 /* variable length fields follow */ 3740}; 3741 3742static inline __attribute__((always_inline)) void 3743GFX125_3DSTATE_BINDING_TABLE_EDIT_VS_pack(__attribute__((unused)) __gen_user_data *data, 3744 __attribute__((unused)) void * restrict dst, 3745 __attribute__((unused)) const struct GFX125_3DSTATE_BINDING_TABLE_EDIT_VS * restrict values) 3746{ 3747 uint32_t * restrict dw = (uint32_t * restrict) dst; 3748 3749 dw[0] = 3750 __gen_uint(values->DWordLength, 0, 8) | 3751 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 3752 __gen_uint(values->_3DCommandOpcode, 24, 26) | 3753 __gen_uint(values->CommandSubType, 27, 28) | 3754 __gen_uint(values->CommandType, 29, 31); 3755 3756 dw[1] = 3757 __gen_uint(values->BindingTableEditTarget, 0, 1) | 3758 __gen_uint(values->BindingTableBlockClear, 16, 31); 3759} 3760 3761#define GFX125_3DSTATE_BINDING_TABLE_POINTERS_DS_length 2 3762#define GFX125_3DSTATE_BINDING_TABLE_POINTERS_DS_length_bias 2 3763#define GFX125_3DSTATE_BINDING_TABLE_POINTERS_DS_header\ 3764 .DWordLength = 0, \ 3765 ._3DCommandSubOpcode = 40, \ 3766 ._3DCommandOpcode = 0, \ 3767 .CommandSubType = 3, \ 3768 .CommandType = 3 3769 3770struct GFX125_3DSTATE_BINDING_TABLE_POINTERS_DS { 3771 uint32_t DWordLength; 3772 uint32_t _3DCommandSubOpcode; 3773 uint32_t _3DCommandOpcode; 3774 uint32_t CommandSubType; 3775 uint32_t CommandType; 3776 uint64_t PointertoDSBindingTable; 3777}; 3778 3779static inline __attribute__((always_inline)) void 3780GFX125_3DSTATE_BINDING_TABLE_POINTERS_DS_pack(__attribute__((unused)) __gen_user_data *data, 3781 __attribute__((unused)) void * restrict dst, 3782 __attribute__((unused)) const struct GFX125_3DSTATE_BINDING_TABLE_POINTERS_DS * restrict values) 3783{ 3784 uint32_t * restrict dw = (uint32_t * restrict) dst; 3785 3786 dw[0] = 3787 __gen_uint(values->DWordLength, 0, 7) | 3788 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 3789 __gen_uint(values->_3DCommandOpcode, 24, 26) | 3790 __gen_uint(values->CommandSubType, 27, 28) | 3791 __gen_uint(values->CommandType, 29, 31); 3792 3793 dw[1] = 3794 __gen_offset(values->PointertoDSBindingTable, 5, 20); 3795} 3796 3797#define GFX125_3DSTATE_BINDING_TABLE_POINTERS_GS_length 2 3798#define GFX125_3DSTATE_BINDING_TABLE_POINTERS_GS_length_bias 2 3799#define GFX125_3DSTATE_BINDING_TABLE_POINTERS_GS_header\ 3800 .DWordLength = 0, \ 3801 ._3DCommandSubOpcode = 41, \ 3802 ._3DCommandOpcode = 0, \ 3803 .CommandSubType = 3, \ 3804 .CommandType = 3 3805 3806struct GFX125_3DSTATE_BINDING_TABLE_POINTERS_GS { 3807 uint32_t DWordLength; 3808 uint32_t _3DCommandSubOpcode; 3809 uint32_t _3DCommandOpcode; 3810 uint32_t CommandSubType; 3811 uint32_t CommandType; 3812 uint64_t PointertoGSBindingTable; 3813}; 3814 3815static inline __attribute__((always_inline)) void 3816GFX125_3DSTATE_BINDING_TABLE_POINTERS_GS_pack(__attribute__((unused)) __gen_user_data *data, 3817 __attribute__((unused)) void * restrict dst, 3818 __attribute__((unused)) const struct GFX125_3DSTATE_BINDING_TABLE_POINTERS_GS * restrict values) 3819{ 3820 uint32_t * restrict dw = (uint32_t * restrict) dst; 3821 3822 dw[0] = 3823 __gen_uint(values->DWordLength, 0, 7) | 3824 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 3825 __gen_uint(values->_3DCommandOpcode, 24, 26) | 3826 __gen_uint(values->CommandSubType, 27, 28) | 3827 __gen_uint(values->CommandType, 29, 31); 3828 3829 dw[1] = 3830 __gen_offset(values->PointertoGSBindingTable, 5, 20); 3831} 3832 3833#define GFX125_3DSTATE_BINDING_TABLE_POINTERS_HS_length 2 3834#define GFX125_3DSTATE_BINDING_TABLE_POINTERS_HS_length_bias 2 3835#define GFX125_3DSTATE_BINDING_TABLE_POINTERS_HS_header\ 3836 .DWordLength = 0, \ 3837 ._3DCommandSubOpcode = 39, \ 3838 ._3DCommandOpcode = 0, \ 3839 .CommandSubType = 3, \ 3840 .CommandType = 3 3841 3842struct GFX125_3DSTATE_BINDING_TABLE_POINTERS_HS { 3843 uint32_t DWordLength; 3844 uint32_t _3DCommandSubOpcode; 3845 uint32_t _3DCommandOpcode; 3846 uint32_t CommandSubType; 3847 uint32_t CommandType; 3848 uint64_t PointertoHSBindingTable; 3849}; 3850 3851static inline __attribute__((always_inline)) void 3852GFX125_3DSTATE_BINDING_TABLE_POINTERS_HS_pack(__attribute__((unused)) __gen_user_data *data, 3853 __attribute__((unused)) void * restrict dst, 3854 __attribute__((unused)) const struct GFX125_3DSTATE_BINDING_TABLE_POINTERS_HS * restrict values) 3855{ 3856 uint32_t * restrict dw = (uint32_t * restrict) dst; 3857 3858 dw[0] = 3859 __gen_uint(values->DWordLength, 0, 7) | 3860 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 3861 __gen_uint(values->_3DCommandOpcode, 24, 26) | 3862 __gen_uint(values->CommandSubType, 27, 28) | 3863 __gen_uint(values->CommandType, 29, 31); 3864 3865 dw[1] = 3866 __gen_offset(values->PointertoHSBindingTable, 5, 20); 3867} 3868 3869#define GFX125_3DSTATE_BINDING_TABLE_POINTERS_PS_length 2 3870#define GFX125_3DSTATE_BINDING_TABLE_POINTERS_PS_length_bias 2 3871#define GFX125_3DSTATE_BINDING_TABLE_POINTERS_PS_header\ 3872 .DWordLength = 0, \ 3873 ._3DCommandSubOpcode = 42, \ 3874 ._3DCommandOpcode = 0, \ 3875 .CommandSubType = 3, \ 3876 .CommandType = 3 3877 3878struct GFX125_3DSTATE_BINDING_TABLE_POINTERS_PS { 3879 uint32_t DWordLength; 3880 uint32_t _3DCommandSubOpcode; 3881 uint32_t _3DCommandOpcode; 3882 uint32_t CommandSubType; 3883 uint32_t CommandType; 3884 uint64_t PointertoPSBindingTable; 3885}; 3886 3887static inline __attribute__((always_inline)) void 3888GFX125_3DSTATE_BINDING_TABLE_POINTERS_PS_pack(__attribute__((unused)) __gen_user_data *data, 3889 __attribute__((unused)) void * restrict dst, 3890 __attribute__((unused)) const struct GFX125_3DSTATE_BINDING_TABLE_POINTERS_PS * restrict values) 3891{ 3892 uint32_t * restrict dw = (uint32_t * restrict) dst; 3893 3894 dw[0] = 3895 __gen_uint(values->DWordLength, 0, 7) | 3896 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 3897 __gen_uint(values->_3DCommandOpcode, 24, 26) | 3898 __gen_uint(values->CommandSubType, 27, 28) | 3899 __gen_uint(values->CommandType, 29, 31); 3900 3901 dw[1] = 3902 __gen_offset(values->PointertoPSBindingTable, 5, 20); 3903} 3904 3905#define GFX125_3DSTATE_BINDING_TABLE_POINTERS_VS_length 2 3906#define GFX125_3DSTATE_BINDING_TABLE_POINTERS_VS_length_bias 2 3907#define GFX125_3DSTATE_BINDING_TABLE_POINTERS_VS_header\ 3908 .DWordLength = 0, \ 3909 ._3DCommandSubOpcode = 38, \ 3910 ._3DCommandOpcode = 0, \ 3911 .CommandSubType = 3, \ 3912 .CommandType = 3 3913 3914struct GFX125_3DSTATE_BINDING_TABLE_POINTERS_VS { 3915 uint32_t DWordLength; 3916 uint32_t _3DCommandSubOpcode; 3917 uint32_t _3DCommandOpcode; 3918 uint32_t CommandSubType; 3919 uint32_t CommandType; 3920 uint64_t PointertoVSBindingTable; 3921}; 3922 3923static inline __attribute__((always_inline)) void 3924GFX125_3DSTATE_BINDING_TABLE_POINTERS_VS_pack(__attribute__((unused)) __gen_user_data *data, 3925 __attribute__((unused)) void * restrict dst, 3926 __attribute__((unused)) const struct GFX125_3DSTATE_BINDING_TABLE_POINTERS_VS * restrict values) 3927{ 3928 uint32_t * restrict dw = (uint32_t * restrict) dst; 3929 3930 dw[0] = 3931 __gen_uint(values->DWordLength, 0, 7) | 3932 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 3933 __gen_uint(values->_3DCommandOpcode, 24, 26) | 3934 __gen_uint(values->CommandSubType, 27, 28) | 3935 __gen_uint(values->CommandType, 29, 31); 3936 3937 dw[1] = 3938 __gen_offset(values->PointertoVSBindingTable, 5, 20); 3939} 3940 3941#define GFX125_3DSTATE_BINDING_TABLE_POOL_ALLOC_length 4 3942#define GFX125_3DSTATE_BINDING_TABLE_POOL_ALLOC_length_bias 2 3943#define GFX125_3DSTATE_BINDING_TABLE_POOL_ALLOC_header\ 3944 .DWordLength = 2, \ 3945 ._3DCommandSubOpcode = 25, \ 3946 ._3DCommandOpcode = 1, \ 3947 .CommandSubType = 3, \ 3948 .CommandType = 3 3949 3950struct GFX125_3DSTATE_BINDING_TABLE_POOL_ALLOC { 3951 uint32_t DWordLength; 3952 uint32_t _3DCommandSubOpcode; 3953 uint32_t _3DCommandOpcode; 3954 uint32_t CommandSubType; 3955 uint32_t CommandType; 3956 uint32_t MOCS; 3957 bool BindingTablePoolEnable; 3958 __gen_address_type BindingTablePoolBaseAddress; 3959 uint32_t BindingTablePoolBufferSize; 3960#define NoValidData 0 3961}; 3962 3963static inline __attribute__((always_inline)) void 3964GFX125_3DSTATE_BINDING_TABLE_POOL_ALLOC_pack(__attribute__((unused)) __gen_user_data *data, 3965 __attribute__((unused)) void * restrict dst, 3966 __attribute__((unused)) const struct GFX125_3DSTATE_BINDING_TABLE_POOL_ALLOC * restrict values) 3967{ 3968 uint32_t * restrict dw = (uint32_t * restrict) dst; 3969 3970 dw[0] = 3971 __gen_uint(values->DWordLength, 0, 7) | 3972 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 3973 __gen_uint(values->_3DCommandOpcode, 24, 26) | 3974 __gen_uint(values->CommandSubType, 27, 28) | 3975 __gen_uint(values->CommandType, 29, 31); 3976 3977 const uint64_t v1 = 3978 __gen_uint(values->MOCS, 0, 6) | 3979 __gen_uint(values->BindingTablePoolEnable, 11, 11); 3980 const uint64_t v1_address = 3981 __gen_address(data, &dw[1], values->BindingTablePoolBaseAddress, v1, 12, 63); 3982 dw[1] = v1_address; 3983 dw[2] = (v1_address >> 32) | (v1 >> 32); 3984 3985 dw[3] = 3986 __gen_uint(values->BindingTablePoolBufferSize, 12, 31); 3987} 3988 3989#define GFX125_3DSTATE_BLEND_STATE_POINTERS_length 2 3990#define GFX125_3DSTATE_BLEND_STATE_POINTERS_length_bias 2 3991#define GFX125_3DSTATE_BLEND_STATE_POINTERS_header\ 3992 .DWordLength = 0, \ 3993 ._3DCommandSubOpcode = 36, \ 3994 ._3DCommandOpcode = 0, \ 3995 .CommandSubType = 3, \ 3996 .CommandType = 3 3997 3998struct GFX125_3DSTATE_BLEND_STATE_POINTERS { 3999 uint32_t DWordLength; 4000 uint32_t _3DCommandSubOpcode; 4001 uint32_t _3DCommandOpcode; 4002 uint32_t CommandSubType; 4003 uint32_t CommandType; 4004 bool BlendStatePointerValid; 4005 uint64_t BlendStatePointer; 4006}; 4007 4008static inline __attribute__((always_inline)) void 4009GFX125_3DSTATE_BLEND_STATE_POINTERS_pack(__attribute__((unused)) __gen_user_data *data, 4010 __attribute__((unused)) void * restrict dst, 4011 __attribute__((unused)) const struct GFX125_3DSTATE_BLEND_STATE_POINTERS * restrict values) 4012{ 4013 uint32_t * restrict dw = (uint32_t * restrict) dst; 4014 4015 dw[0] = 4016 __gen_uint(values->DWordLength, 0, 7) | 4017 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 4018 __gen_uint(values->_3DCommandOpcode, 24, 26) | 4019 __gen_uint(values->CommandSubType, 27, 28) | 4020 __gen_uint(values->CommandType, 29, 31); 4021 4022 dw[1] = 4023 __gen_uint(values->BlendStatePointerValid, 0, 0) | 4024 __gen_offset(values->BlendStatePointer, 6, 31); 4025} 4026 4027#define GFX125_3DSTATE_CC_STATE_POINTERS_length 2 4028#define GFX125_3DSTATE_CC_STATE_POINTERS_length_bias 2 4029#define GFX125_3DSTATE_CC_STATE_POINTERS_header \ 4030 .DWordLength = 0, \ 4031 ._3DCommandSubOpcode = 14, \ 4032 ._3DCommandOpcode = 0, \ 4033 .CommandSubType = 3, \ 4034 .CommandType = 3 4035 4036struct GFX125_3DSTATE_CC_STATE_POINTERS { 4037 uint32_t DWordLength; 4038 uint32_t _3DCommandSubOpcode; 4039 uint32_t _3DCommandOpcode; 4040 uint32_t CommandSubType; 4041 uint32_t CommandType; 4042 bool ColorCalcStatePointerValid; 4043 uint64_t ColorCalcStatePointer; 4044}; 4045 4046static inline __attribute__((always_inline)) void 4047GFX125_3DSTATE_CC_STATE_POINTERS_pack(__attribute__((unused)) __gen_user_data *data, 4048 __attribute__((unused)) void * restrict dst, 4049 __attribute__((unused)) const struct GFX125_3DSTATE_CC_STATE_POINTERS * restrict values) 4050{ 4051 uint32_t * restrict dw = (uint32_t * restrict) dst; 4052 4053 dw[0] = 4054 __gen_uint(values->DWordLength, 0, 7) | 4055 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 4056 __gen_uint(values->_3DCommandOpcode, 24, 26) | 4057 __gen_uint(values->CommandSubType, 27, 28) | 4058 __gen_uint(values->CommandType, 29, 31); 4059 4060 dw[1] = 4061 __gen_uint(values->ColorCalcStatePointerValid, 0, 0) | 4062 __gen_offset(values->ColorCalcStatePointer, 6, 31); 4063} 4064 4065#define GFX125_3DSTATE_CHROMA_KEY_length 4 4066#define GFX125_3DSTATE_CHROMA_KEY_length_bias 2 4067#define GFX125_3DSTATE_CHROMA_KEY_header \ 4068 .DWordLength = 2, \ 4069 ._3DCommandSubOpcode = 4, \ 4070 ._3DCommandOpcode = 1, \ 4071 .CommandSubType = 3, \ 4072 .CommandType = 3 4073 4074struct GFX125_3DSTATE_CHROMA_KEY { 4075 uint32_t DWordLength; 4076 uint32_t _3DCommandSubOpcode; 4077 uint32_t _3DCommandOpcode; 4078 uint32_t CommandSubType; 4079 uint32_t CommandType; 4080 uint32_t ChromaKeyTableIndex; 4081 uint32_t ChromaKeyLowValue; 4082 uint32_t ChromaKeyHighValue; 4083}; 4084 4085static inline __attribute__((always_inline)) void 4086GFX125_3DSTATE_CHROMA_KEY_pack(__attribute__((unused)) __gen_user_data *data, 4087 __attribute__((unused)) void * restrict dst, 4088 __attribute__((unused)) const struct GFX125_3DSTATE_CHROMA_KEY * restrict values) 4089{ 4090 uint32_t * restrict dw = (uint32_t * restrict) dst; 4091 4092 dw[0] = 4093 __gen_uint(values->DWordLength, 0, 7) | 4094 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 4095 __gen_uint(values->_3DCommandOpcode, 24, 26) | 4096 __gen_uint(values->CommandSubType, 27, 28) | 4097 __gen_uint(values->CommandType, 29, 31); 4098 4099 dw[1] = 4100 __gen_uint(values->ChromaKeyTableIndex, 30, 31); 4101 4102 dw[2] = 4103 __gen_uint(values->ChromaKeyLowValue, 0, 31); 4104 4105 dw[3] = 4106 __gen_uint(values->ChromaKeyHighValue, 0, 31); 4107} 4108 4109#define GFX125_3DSTATE_CLEAR_PARAMS_length 3 4110#define GFX125_3DSTATE_CLEAR_PARAMS_length_bias 2 4111#define GFX125_3DSTATE_CLEAR_PARAMS_header \ 4112 .DWordLength = 1, \ 4113 ._3DCommandSubOpcode = 4, \ 4114 ._3DCommandOpcode = 0, \ 4115 .CommandSubType = 3, \ 4116 .CommandType = 3 4117 4118struct GFX125_3DSTATE_CLEAR_PARAMS { 4119 uint32_t DWordLength; 4120 uint32_t _3DCommandSubOpcode; 4121 uint32_t _3DCommandOpcode; 4122 uint32_t CommandSubType; 4123 uint32_t CommandType; 4124 float DepthClearValue; 4125 bool DepthClearValueValid; 4126}; 4127 4128static inline __attribute__((always_inline)) void 4129GFX125_3DSTATE_CLEAR_PARAMS_pack(__attribute__((unused)) __gen_user_data *data, 4130 __attribute__((unused)) void * restrict dst, 4131 __attribute__((unused)) const struct GFX125_3DSTATE_CLEAR_PARAMS * restrict values) 4132{ 4133 uint32_t * restrict dw = (uint32_t * restrict) dst; 4134 4135 dw[0] = 4136 __gen_uint(values->DWordLength, 0, 7) | 4137 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 4138 __gen_uint(values->_3DCommandOpcode, 24, 26) | 4139 __gen_uint(values->CommandSubType, 27, 28) | 4140 __gen_uint(values->CommandType, 29, 31); 4141 4142 dw[1] = 4143 __gen_float(values->DepthClearValue); 4144 4145 dw[2] = 4146 __gen_uint(values->DepthClearValueValid, 0, 0); 4147} 4148 4149#define GFX125_3DSTATE_CLIP_length 4 4150#define GFX125_3DSTATE_CLIP_length_bias 2 4151#define GFX125_3DSTATE_CLIP_header \ 4152 .DWordLength = 2, \ 4153 ._3DCommandSubOpcode = 18, \ 4154 ._3DCommandOpcode = 0, \ 4155 .CommandSubType = 3, \ 4156 .CommandType = 3 4157 4158struct GFX125_3DSTATE_CLIP { 4159 uint32_t DWordLength; 4160 uint32_t _3DCommandSubOpcode; 4161 uint32_t _3DCommandOpcode; 4162 uint32_t CommandSubType; 4163 uint32_t CommandType; 4164 uint32_t UserClipDistanceCullTestEnableBitmask; 4165 bool StatisticsEnable; 4166 bool ForceClipMode; 4167 bool ForceUserClipDistanceClipTestEnableBitmask; 4168 bool EarlyCullEnable; 4169 uint32_t VertexSubPixelPrecisionSelect; 4170#define _8Bit 0 4171#define _4Bit 1 4172 bool ForceUserClipDistanceCullTestEnableBitmask; 4173 uint32_t TriangleFanProvokingVertexSelect; 4174 uint32_t LineStripListProvokingVertexSelect; 4175 uint32_t TriangleStripListProvokingVertexSelect; 4176 bool NonPerspectiveBarycentricEnable; 4177 bool PerspectiveDivideDisable; 4178 uint32_t ClipMode; 4179#define CLIPMODE_NORMAL 0 4180#define CLIPMODE_REJECT_ALL 3 4181#define CLIPMODE_ACCEPT_ALL 4 4182 uint32_t UserClipDistanceClipTestEnableBitmask; 4183 bool GuardbandClipTestEnable; 4184 bool ViewportXYClipTestEnable; 4185 uint32_t APIMode; 4186#define APIMODE_OGL 0 4187#define APIMODE_D3D 1 4188 bool ClipEnable; 4189 uint32_t MaximumVPIndex; 4190 bool ForceZeroRTAIndexEnable; 4191 float MaximumPointWidth; 4192 float MinimumPointWidth; 4193}; 4194 4195static inline __attribute__((always_inline)) void 4196GFX125_3DSTATE_CLIP_pack(__attribute__((unused)) __gen_user_data *data, 4197 __attribute__((unused)) void * restrict dst, 4198 __attribute__((unused)) const struct GFX125_3DSTATE_CLIP * restrict values) 4199{ 4200 uint32_t * restrict dw = (uint32_t * restrict) dst; 4201 4202 dw[0] = 4203 __gen_uint(values->DWordLength, 0, 7) | 4204 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 4205 __gen_uint(values->_3DCommandOpcode, 24, 26) | 4206 __gen_uint(values->CommandSubType, 27, 28) | 4207 __gen_uint(values->CommandType, 29, 31); 4208 4209 dw[1] = 4210 __gen_uint(values->UserClipDistanceCullTestEnableBitmask, 0, 7) | 4211 __gen_uint(values->StatisticsEnable, 10, 10) | 4212 __gen_uint(values->ForceClipMode, 16, 16) | 4213 __gen_uint(values->ForceUserClipDistanceClipTestEnableBitmask, 17, 17) | 4214 __gen_uint(values->EarlyCullEnable, 18, 18) | 4215 __gen_uint(values->VertexSubPixelPrecisionSelect, 19, 19) | 4216 __gen_uint(values->ForceUserClipDistanceCullTestEnableBitmask, 20, 20); 4217 4218 dw[2] = 4219 __gen_uint(values->TriangleFanProvokingVertexSelect, 0, 1) | 4220 __gen_uint(values->LineStripListProvokingVertexSelect, 2, 3) | 4221 __gen_uint(values->TriangleStripListProvokingVertexSelect, 4, 5) | 4222 __gen_uint(values->NonPerspectiveBarycentricEnable, 8, 8) | 4223 __gen_uint(values->PerspectiveDivideDisable, 9, 9) | 4224 __gen_uint(values->ClipMode, 13, 15) | 4225 __gen_uint(values->UserClipDistanceClipTestEnableBitmask, 16, 23) | 4226 __gen_uint(values->GuardbandClipTestEnable, 26, 26) | 4227 __gen_uint(values->ViewportXYClipTestEnable, 28, 28) | 4228 __gen_uint(values->APIMode, 30, 30) | 4229 __gen_uint(values->ClipEnable, 31, 31); 4230 4231 dw[3] = 4232 __gen_uint(values->MaximumVPIndex, 0, 3) | 4233 __gen_uint(values->ForceZeroRTAIndexEnable, 5, 5) | 4234 __gen_ufixed(values->MaximumPointWidth, 6, 16, 3) | 4235 __gen_ufixed(values->MinimumPointWidth, 17, 27, 3); 4236} 4237 4238#define GFX125_3DSTATE_CONSTANT_ALL_length 2 4239#define GFX125_3DSTATE_CONSTANT_ALL_length_bias 2 4240#define GFX125_3DSTATE_CONSTANT_ALL_header \ 4241 .DWordLength = 0, \ 4242 ._3DCommandSubOpcode = 109, \ 4243 ._3DCommandOpcode = 0, \ 4244 .CommandSubType = 3, \ 4245 .CommandType = 3 4246 4247struct GFX125_3DSTATE_CONSTANT_ALL { 4248 uint32_t DWordLength; 4249 uint32_t ShaderUpdateEnable; 4250 bool VertexShaderUpdateEnable; 4251 bool HullShaderUpdateEnable; 4252 bool DomainShaderUpdateEnable; 4253 bool GeometryShaderUpdateEnable; 4254 bool PixelShaderUpdateEnable; 4255 uint32_t _3DCommandSubOpcode; 4256 uint32_t _3DCommandOpcode; 4257 uint32_t CommandSubType; 4258 uint32_t CommandType; 4259 uint32_t MOCS; 4260 uint32_t PointerBufferMask; 4261 bool UpdateMode; 4262 /* variable length fields follow */ 4263}; 4264 4265static inline __attribute__((always_inline)) void 4266GFX125_3DSTATE_CONSTANT_ALL_pack(__attribute__((unused)) __gen_user_data *data, 4267 __attribute__((unused)) void * restrict dst, 4268 __attribute__((unused)) const struct GFX125_3DSTATE_CONSTANT_ALL * restrict values) 4269{ 4270 uint32_t * restrict dw = (uint32_t * restrict) dst; 4271 4272 dw[0] = 4273 __gen_uint(values->DWordLength, 0, 7) | 4274 __gen_uint(values->ShaderUpdateEnable, 8, 12) | 4275 __gen_uint(values->VertexShaderUpdateEnable, 8, 8) | 4276 __gen_uint(values->HullShaderUpdateEnable, 9, 9) | 4277 __gen_uint(values->DomainShaderUpdateEnable, 10, 10) | 4278 __gen_uint(values->GeometryShaderUpdateEnable, 11, 11) | 4279 __gen_uint(values->PixelShaderUpdateEnable, 12, 12) | 4280 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 4281 __gen_uint(values->_3DCommandOpcode, 24, 26) | 4282 __gen_uint(values->CommandSubType, 27, 28) | 4283 __gen_uint(values->CommandType, 29, 31); 4284 4285 dw[1] = 4286 __gen_uint(values->MOCS, 0, 6) | 4287 __gen_uint(values->PointerBufferMask, 16, 19) | 4288 __gen_uint(values->UpdateMode, 31, 31); 4289} 4290 4291#define GFX125_3DSTATE_CONSTANT_DS_length 11 4292#define GFX125_3DSTATE_CONSTANT_DS_length_bias 2 4293#define GFX125_3DSTATE_CONSTANT_DS_header \ 4294 .DWordLength = 9, \ 4295 ._3DCommandSubOpcode = 26, \ 4296 ._3DCommandOpcode = 0, \ 4297 .CommandSubType = 3, \ 4298 .CommandType = 3 4299 4300struct GFX125_3DSTATE_CONSTANT_DS { 4301 uint32_t DWordLength; 4302 uint32_t MOCS; 4303 uint32_t _3DCommandSubOpcode; 4304 uint32_t _3DCommandOpcode; 4305 uint32_t CommandSubType; 4306 uint32_t CommandType; 4307 struct GFX125_3DSTATE_CONSTANT_BODY ConstantBody; 4308}; 4309 4310static inline __attribute__((always_inline)) void 4311GFX125_3DSTATE_CONSTANT_DS_pack(__attribute__((unused)) __gen_user_data *data, 4312 __attribute__((unused)) void * restrict dst, 4313 __attribute__((unused)) const struct GFX125_3DSTATE_CONSTANT_DS * restrict values) 4314{ 4315 uint32_t * restrict dw = (uint32_t * restrict) dst; 4316 4317 dw[0] = 4318 __gen_uint(values->DWordLength, 0, 7) | 4319 __gen_uint(values->MOCS, 8, 14) | 4320 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 4321 __gen_uint(values->_3DCommandOpcode, 24, 26) | 4322 __gen_uint(values->CommandSubType, 27, 28) | 4323 __gen_uint(values->CommandType, 29, 31); 4324 4325 GFX125_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody); 4326} 4327 4328#define GFX125_3DSTATE_CONSTANT_GS_length 11 4329#define GFX125_3DSTATE_CONSTANT_GS_length_bias 2 4330#define GFX125_3DSTATE_CONSTANT_GS_header \ 4331 .DWordLength = 9, \ 4332 ._3DCommandSubOpcode = 22, \ 4333 ._3DCommandOpcode = 0, \ 4334 .CommandSubType = 3, \ 4335 .CommandType = 3 4336 4337struct GFX125_3DSTATE_CONSTANT_GS { 4338 uint32_t DWordLength; 4339 uint32_t MOCS; 4340 uint32_t _3DCommandSubOpcode; 4341 uint32_t _3DCommandOpcode; 4342 uint32_t CommandSubType; 4343 uint32_t CommandType; 4344 struct GFX125_3DSTATE_CONSTANT_BODY ConstantBody; 4345}; 4346 4347static inline __attribute__((always_inline)) void 4348GFX125_3DSTATE_CONSTANT_GS_pack(__attribute__((unused)) __gen_user_data *data, 4349 __attribute__((unused)) void * restrict dst, 4350 __attribute__((unused)) const struct GFX125_3DSTATE_CONSTANT_GS * restrict values) 4351{ 4352 uint32_t * restrict dw = (uint32_t * restrict) dst; 4353 4354 dw[0] = 4355 __gen_uint(values->DWordLength, 0, 7) | 4356 __gen_uint(values->MOCS, 8, 14) | 4357 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 4358 __gen_uint(values->_3DCommandOpcode, 24, 26) | 4359 __gen_uint(values->CommandSubType, 27, 28) | 4360 __gen_uint(values->CommandType, 29, 31); 4361 4362 GFX125_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody); 4363} 4364 4365#define GFX125_3DSTATE_CONSTANT_HS_length 11 4366#define GFX125_3DSTATE_CONSTANT_HS_length_bias 2 4367#define GFX125_3DSTATE_CONSTANT_HS_header \ 4368 .DWordLength = 9, \ 4369 ._3DCommandSubOpcode = 25, \ 4370 ._3DCommandOpcode = 0, \ 4371 .CommandSubType = 3, \ 4372 .CommandType = 3 4373 4374struct GFX125_3DSTATE_CONSTANT_HS { 4375 uint32_t DWordLength; 4376 uint32_t MOCS; 4377 uint32_t _3DCommandSubOpcode; 4378 uint32_t _3DCommandOpcode; 4379 uint32_t CommandSubType; 4380 uint32_t CommandType; 4381 struct GFX125_3DSTATE_CONSTANT_BODY ConstantBody; 4382}; 4383 4384static inline __attribute__((always_inline)) void 4385GFX125_3DSTATE_CONSTANT_HS_pack(__attribute__((unused)) __gen_user_data *data, 4386 __attribute__((unused)) void * restrict dst, 4387 __attribute__((unused)) const struct GFX125_3DSTATE_CONSTANT_HS * restrict values) 4388{ 4389 uint32_t * restrict dw = (uint32_t * restrict) dst; 4390 4391 dw[0] = 4392 __gen_uint(values->DWordLength, 0, 7) | 4393 __gen_uint(values->MOCS, 8, 14) | 4394 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 4395 __gen_uint(values->_3DCommandOpcode, 24, 26) | 4396 __gen_uint(values->CommandSubType, 27, 28) | 4397 __gen_uint(values->CommandType, 29, 31); 4398 4399 GFX125_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody); 4400} 4401 4402#define GFX125_3DSTATE_CONSTANT_PS_length 11 4403#define GFX125_3DSTATE_CONSTANT_PS_length_bias 2 4404#define GFX125_3DSTATE_CONSTANT_PS_header \ 4405 .DWordLength = 9, \ 4406 ._3DCommandSubOpcode = 23, \ 4407 ._3DCommandOpcode = 0, \ 4408 .CommandSubType = 3, \ 4409 .CommandType = 3 4410 4411struct GFX125_3DSTATE_CONSTANT_PS { 4412 uint32_t DWordLength; 4413 uint32_t MOCS; 4414 uint32_t DisableGatheratSetShaderHint; 4415 uint32_t _3DCommandSubOpcode; 4416 uint32_t _3DCommandOpcode; 4417 uint32_t CommandSubType; 4418 uint32_t CommandType; 4419 struct GFX125_3DSTATE_CONSTANT_BODY ConstantBody; 4420}; 4421 4422static inline __attribute__((always_inline)) void 4423GFX125_3DSTATE_CONSTANT_PS_pack(__attribute__((unused)) __gen_user_data *data, 4424 __attribute__((unused)) void * restrict dst, 4425 __attribute__((unused)) const struct GFX125_3DSTATE_CONSTANT_PS * restrict values) 4426{ 4427 uint32_t * restrict dw = (uint32_t * restrict) dst; 4428 4429 dw[0] = 4430 __gen_uint(values->DWordLength, 0, 7) | 4431 __gen_uint(values->MOCS, 8, 14) | 4432 __gen_uint(values->DisableGatheratSetShaderHint, 15, 15) | 4433 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 4434 __gen_uint(values->_3DCommandOpcode, 24, 26) | 4435 __gen_uint(values->CommandSubType, 27, 28) | 4436 __gen_uint(values->CommandType, 29, 31); 4437 4438 GFX125_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody); 4439} 4440 4441#define GFX125_3DSTATE_CONSTANT_VS_length 11 4442#define GFX125_3DSTATE_CONSTANT_VS_length_bias 2 4443#define GFX125_3DSTATE_CONSTANT_VS_header \ 4444 .DWordLength = 9, \ 4445 ._3DCommandSubOpcode = 21, \ 4446 ._3DCommandOpcode = 0, \ 4447 .CommandSubType = 3, \ 4448 .CommandType = 3 4449 4450struct GFX125_3DSTATE_CONSTANT_VS { 4451 uint32_t DWordLength; 4452 uint32_t MOCS; 4453 uint32_t _3DCommandSubOpcode; 4454 uint32_t _3DCommandOpcode; 4455 uint32_t CommandSubType; 4456 uint32_t CommandType; 4457 struct GFX125_3DSTATE_CONSTANT_BODY ConstantBody; 4458}; 4459 4460static inline __attribute__((always_inline)) void 4461GFX125_3DSTATE_CONSTANT_VS_pack(__attribute__((unused)) __gen_user_data *data, 4462 __attribute__((unused)) void * restrict dst, 4463 __attribute__((unused)) const struct GFX125_3DSTATE_CONSTANT_VS * restrict values) 4464{ 4465 uint32_t * restrict dw = (uint32_t * restrict) dst; 4466 4467 dw[0] = 4468 __gen_uint(values->DWordLength, 0, 7) | 4469 __gen_uint(values->MOCS, 8, 14) | 4470 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 4471 __gen_uint(values->_3DCommandOpcode, 24, 26) | 4472 __gen_uint(values->CommandSubType, 27, 28) | 4473 __gen_uint(values->CommandType, 29, 31); 4474 4475 GFX125_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody); 4476} 4477 4478#define GFX125_3DSTATE_CPS_POINTERS_length 2 4479#define GFX125_3DSTATE_CPS_POINTERS_length_bias 2 4480#define GFX125_3DSTATE_CPS_POINTERS_header \ 4481 .DWordLength = 0, \ 4482 ._3DCommandSubOpcode = 34, \ 4483 ._3DCommandOpcode = 0, \ 4484 .CommandSubType = 3, \ 4485 .CommandType = 3 4486 4487struct GFX125_3DSTATE_CPS_POINTERS { 4488 uint32_t DWordLength; 4489 uint32_t _3DCommandSubOpcode; 4490 uint32_t _3DCommandOpcode; 4491 uint32_t CommandSubType; 4492 uint32_t CommandType; 4493 uint64_t CoarsePixelShadingStateArrayPointer; 4494}; 4495 4496static inline __attribute__((always_inline)) void 4497GFX125_3DSTATE_CPS_POINTERS_pack(__attribute__((unused)) __gen_user_data *data, 4498 __attribute__((unused)) void * restrict dst, 4499 __attribute__((unused)) const struct GFX125_3DSTATE_CPS_POINTERS * restrict values) 4500{ 4501 uint32_t * restrict dw = (uint32_t * restrict) dst; 4502 4503 dw[0] = 4504 __gen_uint(values->DWordLength, 0, 15) | 4505 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 4506 __gen_uint(values->_3DCommandOpcode, 24, 26) | 4507 __gen_uint(values->CommandSubType, 27, 28) | 4508 __gen_uint(values->CommandType, 29, 31); 4509 4510 dw[1] = 4511 __gen_offset(values->CoarsePixelShadingStateArrayPointer, 5, 31); 4512} 4513 4514#define GFX125_3DSTATE_DEPTH_BOUNDS_length 4 4515#define GFX125_3DSTATE_DEPTH_BOUNDS_length_bias 2 4516#define GFX125_3DSTATE_DEPTH_BOUNDS_header \ 4517 .Length = 2, \ 4518 ._3DSTATECommandSubOpcode = 113, \ 4519 ._3DCommandOpcode = 0, \ 4520 .CommandSubType = 3, \ 4521 .CommandType = 3 4522 4523struct GFX125_3DSTATE_DEPTH_BOUNDS { 4524 uint32_t Length; 4525 bool DepthBoundsTestValueModifyDisable; 4526 bool DepthBoundsTestEnableModifyDisable; 4527 uint32_t _3DSTATECommandSubOpcode; 4528 uint32_t _3DCommandOpcode; 4529 uint32_t CommandSubType; 4530 uint32_t CommandType; 4531 uint32_t DepthBoundsTestEnable; 4532 float DepthBoundsTestMinValue; 4533 float DepthBoundsTestMaxValue; 4534}; 4535 4536static inline __attribute__((always_inline)) void 4537GFX125_3DSTATE_DEPTH_BOUNDS_pack(__attribute__((unused)) __gen_user_data *data, 4538 __attribute__((unused)) void * restrict dst, 4539 __attribute__((unused)) const struct GFX125_3DSTATE_DEPTH_BOUNDS * restrict values) 4540{ 4541 uint32_t * restrict dw = (uint32_t * restrict) dst; 4542 4543 dw[0] = 4544 __gen_uint(values->Length, 0, 7) | 4545 __gen_uint(values->DepthBoundsTestValueModifyDisable, 14, 14) | 4546 __gen_uint(values->DepthBoundsTestEnableModifyDisable, 15, 15) | 4547 __gen_uint(values->_3DSTATECommandSubOpcode, 16, 23) | 4548 __gen_uint(values->_3DCommandOpcode, 24, 26) | 4549 __gen_uint(values->CommandSubType, 27, 28) | 4550 __gen_uint(values->CommandType, 29, 31); 4551 4552 dw[1] = 4553 __gen_uint(values->DepthBoundsTestEnable, 0, 0); 4554 4555 dw[2] = 4556 __gen_float(values->DepthBoundsTestMinValue); 4557 4558 dw[3] = 4559 __gen_float(values->DepthBoundsTestMaxValue); 4560} 4561 4562#define GFX125_3DSTATE_DEPTH_BUFFER_length 8 4563#define GFX125_3DSTATE_DEPTH_BUFFER_length_bias 2 4564#define GFX125_3DSTATE_DEPTH_BUFFER_header \ 4565 .DWordLength = 6, \ 4566 ._3DCommandSubOpcode = 5, \ 4567 ._3DCommandOpcode = 0, \ 4568 .CommandSubType = 3, \ 4569 .CommandType = 3 4570 4571struct GFX125_3DSTATE_DEPTH_BUFFER { 4572 uint32_t DWordLength; 4573 uint32_t _3DCommandSubOpcode; 4574 uint32_t _3DCommandOpcode; 4575 uint32_t CommandSubType; 4576 uint32_t CommandType; 4577 uint32_t SurfacePitch; 4578 bool ControlSurfaceEnable; 4579 bool DepthBufferCompressionEnable; 4580 bool HierarchicalDepthBufferEnable; 4581 bool CornerTexelMode; 4582 uint32_t SurfaceFormat; 4583#define D32_FLOAT 1 4584#define D24_UNORM_X8_UINT 3 4585#define D16_UNORM 5 4586 bool NullPageCoherencyEnable; 4587 bool DepthWriteEnable; 4588 uint32_t SurfaceType; 4589#define SURFTYPE_2D 1 4590#define SURFTYPE_CUBE 3 4591#define SURFTYPE_NULL 7 4592 __gen_address_type SurfaceBaseAddress; 4593 uint32_t Width; 4594 uint32_t Height; 4595 uint32_t MOCS; 4596 uint32_t MinimumArrayElement; 4597 uint32_t Depth; 4598 uint32_t RenderCompressionFormat; 4599 bool CompressionMode; 4600 uint32_t MipTailStartLOD; 4601 uint32_t TiledMode; 4602#define TILE64 1 4603#define TILE4 3 4604 uint32_t SurfaceQPitch; 4605 uint32_t LOD; 4606 uint32_t RenderTargetViewExtent; 4607}; 4608 4609static inline __attribute__((always_inline)) void 4610GFX125_3DSTATE_DEPTH_BUFFER_pack(__attribute__((unused)) __gen_user_data *data, 4611 __attribute__((unused)) void * restrict dst, 4612 __attribute__((unused)) const struct GFX125_3DSTATE_DEPTH_BUFFER * restrict values) 4613{ 4614 uint32_t * restrict dw = (uint32_t * restrict) dst; 4615 4616 dw[0] = 4617 __gen_uint(values->DWordLength, 0, 7) | 4618 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 4619 __gen_uint(values->_3DCommandOpcode, 24, 26) | 4620 __gen_uint(values->CommandSubType, 27, 28) | 4621 __gen_uint(values->CommandType, 29, 31); 4622 4623 dw[1] = 4624 __gen_uint(values->SurfacePitch, 0, 17) | 4625 __gen_uint(values->ControlSurfaceEnable, 19, 19) | 4626 __gen_uint(values->DepthBufferCompressionEnable, 21, 21) | 4627 __gen_uint(values->HierarchicalDepthBufferEnable, 22, 22) | 4628 __gen_uint(values->CornerTexelMode, 23, 23) | 4629 __gen_uint(values->SurfaceFormat, 24, 26) | 4630 __gen_uint(values->NullPageCoherencyEnable, 27, 27) | 4631 __gen_uint(values->DepthWriteEnable, 28, 28) | 4632 __gen_uint(values->SurfaceType, 29, 31); 4633 4634 const uint64_t v2_address = 4635 __gen_address(data, &dw[2], values->SurfaceBaseAddress, 0, 0, 63); 4636 dw[2] = v2_address; 4637 dw[3] = v2_address >> 32; 4638 4639 dw[4] = 4640 __gen_uint(values->Width, 1, 14) | 4641 __gen_uint(values->Height, 17, 30); 4642 4643 dw[5] = 4644 __gen_uint(values->MOCS, 0, 6) | 4645 __gen_uint(values->MinimumArrayElement, 8, 18) | 4646 __gen_uint(values->Depth, 20, 30); 4647 4648 dw[6] = 4649 __gen_uint(values->RenderCompressionFormat, 0, 4) | 4650 __gen_uint(values->CompressionMode, 5, 5) | 4651 __gen_uint(values->MipTailStartLOD, 26, 29) | 4652 __gen_uint(values->TiledMode, 30, 31); 4653 4654 dw[7] = 4655 __gen_uint(values->SurfaceQPitch, 0, 14) | 4656 __gen_uint(values->LOD, 16, 19) | 4657 __gen_uint(values->RenderTargetViewExtent, 21, 31); 4658} 4659 4660#define GFX125_3DSTATE_DRAWING_RECTANGLE_length 4 4661#define GFX125_3DSTATE_DRAWING_RECTANGLE_length_bias 2 4662#define GFX125_3DSTATE_DRAWING_RECTANGLE_header \ 4663 .DWordLength = 2, \ 4664 ._3DCommandSubOpcode = 0, \ 4665 ._3DCommandOpcode = 1, \ 4666 .CommandSubType = 3, \ 4667 .CommandType = 3 4668 4669struct GFX125_3DSTATE_DRAWING_RECTANGLE { 4670 uint32_t DWordLength; 4671 uint32_t CoreModeSelect; 4672#define Legacy 0 4673#define Core0Enabled 1 4674#define Core1Enabled 2 4675 uint32_t _3DCommandSubOpcode; 4676 uint32_t _3DCommandOpcode; 4677 uint32_t CommandSubType; 4678 uint32_t CommandType; 4679 uint32_t ClippedDrawingRectangleXMin; 4680 uint32_t ClippedDrawingRectangleYMin; 4681 uint32_t ClippedDrawingRectangleXMax; 4682 uint32_t ClippedDrawingRectangleYMax; 4683 int32_t DrawingRectangleOriginX; 4684 int32_t DrawingRectangleOriginY; 4685}; 4686 4687static inline __attribute__((always_inline)) void 4688GFX125_3DSTATE_DRAWING_RECTANGLE_pack(__attribute__((unused)) __gen_user_data *data, 4689 __attribute__((unused)) void * restrict dst, 4690 __attribute__((unused)) const struct GFX125_3DSTATE_DRAWING_RECTANGLE * restrict values) 4691{ 4692 uint32_t * restrict dw = (uint32_t * restrict) dst; 4693 4694 dw[0] = 4695 __gen_uint(values->DWordLength, 0, 7) | 4696 __gen_uint(values->CoreModeSelect, 14, 15) | 4697 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 4698 __gen_uint(values->_3DCommandOpcode, 24, 26) | 4699 __gen_uint(values->CommandSubType, 27, 28) | 4700 __gen_uint(values->CommandType, 29, 31); 4701 4702 dw[1] = 4703 __gen_uint(values->ClippedDrawingRectangleXMin, 0, 15) | 4704 __gen_uint(values->ClippedDrawingRectangleYMin, 16, 31); 4705 4706 dw[2] = 4707 __gen_uint(values->ClippedDrawingRectangleXMax, 0, 15) | 4708 __gen_uint(values->ClippedDrawingRectangleYMax, 16, 31); 4709 4710 dw[3] = 4711 __gen_sint(values->DrawingRectangleOriginX, 0, 15) | 4712 __gen_sint(values->DrawingRectangleOriginY, 16, 31); 4713} 4714 4715#define GFX125_3DSTATE_DS_length 11 4716#define GFX125_3DSTATE_DS_length_bias 2 4717#define GFX125_3DSTATE_DS_header \ 4718 .DWordLength = 9, \ 4719 ._3DCommandSubOpcode = 29, \ 4720 ._3DCommandOpcode = 0, \ 4721 .CommandSubType = 3, \ 4722 .CommandType = 3 4723 4724struct GFX125_3DSTATE_DS { 4725 uint32_t DWordLength; 4726 uint32_t _3DCommandSubOpcode; 4727 uint32_t _3DCommandOpcode; 4728 uint32_t CommandSubType; 4729 uint32_t CommandType; 4730 uint64_t KernelStartPointer; 4731 bool SoftwareExceptionEnable; 4732 bool IllegalOpcodeExceptionEnable; 4733 bool AccessesUAV; 4734 uint32_t FloatingPointMode; 4735#define IEEE754 0 4736#define Alternate 1 4737 uint32_t ThreadDispatchPriority; 4738#define High 1 4739 uint32_t BindingTableEntryCount; 4740 uint32_t SamplerCount; 4741#define NoSamplers 0 4742#define _14Samplers 1 4743#define _58Samplers 2 4744#define _912Samplers 3 4745#define _1316Samplers 4 4746 bool VectorMaskEnable; 4747 uint32_t ScratchSpaceBuffer; 4748 uint32_t PatchURBEntryReadOffset; 4749 uint32_t PatchURBEntryReadLength; 4750 uint32_t DispatchGRFStartRegisterForURBData; 4751 bool Enable; 4752 bool CacheDisable; 4753 bool ComputeWCoordinateEnable; 4754 uint32_t DispatchMode; 4755#define DISPATCH_MODE_SIMD8_SINGLE_PATCH 1 4756#define DISPATCH_MODE_SIMD8_SINGLE_OR_DUAL_PATCH 2 4757 bool StatisticsEnable; 4758 uint32_t MaximumNumberofThreads; 4759 uint32_t UserClipDistanceCullTestEnableBitmask; 4760 uint32_t UserClipDistanceClipTestEnableBitmask; 4761 uint32_t VertexURBEntryOutputLength; 4762 uint32_t VertexURBEntryOutputReadOffset; 4763 uint64_t DUAL_PATCHKernelStartPointer; 4764}; 4765 4766static inline __attribute__((always_inline)) void 4767GFX125_3DSTATE_DS_pack(__attribute__((unused)) __gen_user_data *data, 4768 __attribute__((unused)) void * restrict dst, 4769 __attribute__((unused)) const struct GFX125_3DSTATE_DS * restrict values) 4770{ 4771 uint32_t * restrict dw = (uint32_t * restrict) dst; 4772 4773 dw[0] = 4774 __gen_uint(values->DWordLength, 0, 7) | 4775 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 4776 __gen_uint(values->_3DCommandOpcode, 24, 26) | 4777 __gen_uint(values->CommandSubType, 27, 28) | 4778 __gen_uint(values->CommandType, 29, 31); 4779 4780 const uint64_t v1 = 4781 __gen_offset(values->KernelStartPointer, 6, 63); 4782 dw[1] = v1; 4783 dw[2] = v1 >> 32; 4784 4785 dw[3] = 4786 __gen_uint(values->SoftwareExceptionEnable, 7, 7) | 4787 __gen_uint(values->IllegalOpcodeExceptionEnable, 13, 13) | 4788 __gen_uint(values->AccessesUAV, 14, 14) | 4789 __gen_uint(values->FloatingPointMode, 16, 16) | 4790 __gen_uint(values->ThreadDispatchPriority, 17, 17) | 4791 __gen_uint(values->BindingTableEntryCount, 18, 25) | 4792 __gen_uint(values->SamplerCount, 27, 29) | 4793 __gen_uint(values->VectorMaskEnable, 30, 30); 4794 4795 dw[4] = 4796 __gen_uint(values->ScratchSpaceBuffer, 10, 31); 4797 4798 dw[5] = 0; 4799 4800 dw[6] = 4801 __gen_uint(values->PatchURBEntryReadOffset, 4, 9) | 4802 __gen_uint(values->PatchURBEntryReadLength, 11, 17) | 4803 __gen_uint(values->DispatchGRFStartRegisterForURBData, 20, 24); 4804 4805 dw[7] = 4806 __gen_uint(values->Enable, 0, 0) | 4807 __gen_uint(values->CacheDisable, 1, 1) | 4808 __gen_uint(values->ComputeWCoordinateEnable, 2, 2) | 4809 __gen_uint(values->DispatchMode, 3, 4) | 4810 __gen_uint(values->StatisticsEnable, 10, 10) | 4811 __gen_uint(values->MaximumNumberofThreads, 21, 30); 4812 4813 dw[8] = 4814 __gen_uint(values->UserClipDistanceCullTestEnableBitmask, 0, 7) | 4815 __gen_uint(values->UserClipDistanceClipTestEnableBitmask, 8, 15) | 4816 __gen_uint(values->VertexURBEntryOutputLength, 16, 20) | 4817 __gen_uint(values->VertexURBEntryOutputReadOffset, 21, 26); 4818 4819 const uint64_t v9 = 4820 __gen_offset(values->DUAL_PATCHKernelStartPointer, 6, 63); 4821 dw[9] = v9; 4822 dw[10] = v9 >> 32; 4823} 4824 4825#define GFX125_3DSTATE_GATHER_CONSTANT_DS_length_bias 2 4826#define GFX125_3DSTATE_GATHER_CONSTANT_DS_header\ 4827 .DWordLength = 1, \ 4828 ._3DCommandSubOpcode = 55, \ 4829 ._3DCommandOpcode = 0, \ 4830 .CommandSubType = 3, \ 4831 .CommandType = 3 4832 4833struct GFX125_3DSTATE_GATHER_CONSTANT_DS { 4834 uint32_t DWordLength; 4835 uint32_t _3DCommandSubOpcode; 4836 uint32_t _3DCommandOpcode; 4837 uint32_t CommandSubType; 4838 uint32_t CommandType; 4839 uint32_t UpdateGatherTableOnly; 4840#define CommitGather 0 4841#define NonCommitGather 1 4842 uint32_t ConstantBufferBindingTableBlock; 4843 uint32_t ConstantBufferValid; 4844 uint32_t OnDieTable; 4845#define Load 0 4846#define Read 1 4847 bool ConstantBufferDx9GenerateStall; 4848 uint64_t GatherBufferOffset; 4849 /* variable length fields follow */ 4850}; 4851 4852static inline __attribute__((always_inline)) void 4853GFX125_3DSTATE_GATHER_CONSTANT_DS_pack(__attribute__((unused)) __gen_user_data *data, 4854 __attribute__((unused)) void * restrict dst, 4855 __attribute__((unused)) const struct GFX125_3DSTATE_GATHER_CONSTANT_DS * restrict values) 4856{ 4857 uint32_t * restrict dw = (uint32_t * restrict) dst; 4858 4859 dw[0] = 4860 __gen_uint(values->DWordLength, 0, 7) | 4861 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 4862 __gen_uint(values->_3DCommandOpcode, 24, 26) | 4863 __gen_uint(values->CommandSubType, 27, 28) | 4864 __gen_uint(values->CommandType, 29, 31); 4865 4866 dw[1] = 4867 __gen_uint(values->UpdateGatherTableOnly, 1, 1) | 4868 __gen_uint(values->ConstantBufferBindingTableBlock, 12, 15) | 4869 __gen_uint(values->ConstantBufferValid, 16, 31); 4870 4871 dw[2] = 4872 __gen_uint(values->OnDieTable, 3, 3) | 4873 __gen_uint(values->ConstantBufferDx9GenerateStall, 5, 5) | 4874 __gen_offset(values->GatherBufferOffset, 6, 22); 4875} 4876 4877#define GFX125_3DSTATE_GATHER_CONSTANT_GS_length_bias 2 4878#define GFX125_3DSTATE_GATHER_CONSTANT_GS_header\ 4879 .DWordLength = 1, \ 4880 ._3DCommandSubOpcode = 53, \ 4881 ._3DCommandOpcode = 0, \ 4882 .CommandSubType = 3, \ 4883 .CommandType = 3 4884 4885struct GFX125_3DSTATE_GATHER_CONSTANT_GS { 4886 uint32_t DWordLength; 4887 uint32_t _3DCommandSubOpcode; 4888 uint32_t _3DCommandOpcode; 4889 uint32_t CommandSubType; 4890 uint32_t CommandType; 4891 uint32_t UpdateGatherTableOnly; 4892#define CommitGather 0 4893#define NonCommitGather 1 4894 uint32_t ConstantBufferBindingTableBlock; 4895 uint32_t ConstantBufferValid; 4896 uint32_t OnDieTable; 4897#define Load 0 4898#define Read 1 4899 bool ConstantBufferDx9GenerateStall; 4900 uint64_t GatherBufferOffset; 4901 /* variable length fields follow */ 4902}; 4903 4904static inline __attribute__((always_inline)) void 4905GFX125_3DSTATE_GATHER_CONSTANT_GS_pack(__attribute__((unused)) __gen_user_data *data, 4906 __attribute__((unused)) void * restrict dst, 4907 __attribute__((unused)) const struct GFX125_3DSTATE_GATHER_CONSTANT_GS * restrict values) 4908{ 4909 uint32_t * restrict dw = (uint32_t * restrict) dst; 4910 4911 dw[0] = 4912 __gen_uint(values->DWordLength, 0, 7) | 4913 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 4914 __gen_uint(values->_3DCommandOpcode, 24, 26) | 4915 __gen_uint(values->CommandSubType, 27, 28) | 4916 __gen_uint(values->CommandType, 29, 31); 4917 4918 dw[1] = 4919 __gen_uint(values->UpdateGatherTableOnly, 1, 1) | 4920 __gen_uint(values->ConstantBufferBindingTableBlock, 12, 15) | 4921 __gen_uint(values->ConstantBufferValid, 16, 31); 4922 4923 dw[2] = 4924 __gen_uint(values->OnDieTable, 3, 3) | 4925 __gen_uint(values->ConstantBufferDx9GenerateStall, 5, 5) | 4926 __gen_offset(values->GatherBufferOffset, 6, 22); 4927} 4928 4929#define GFX125_3DSTATE_GATHER_CONSTANT_HS_length_bias 2 4930#define GFX125_3DSTATE_GATHER_CONSTANT_HS_header\ 4931 .DWordLength = 1, \ 4932 ._3DCommandSubOpcode = 54, \ 4933 ._3DCommandOpcode = 0, \ 4934 .CommandSubType = 3, \ 4935 .CommandType = 3 4936 4937struct GFX125_3DSTATE_GATHER_CONSTANT_HS { 4938 uint32_t DWordLength; 4939 uint32_t _3DCommandSubOpcode; 4940 uint32_t _3DCommandOpcode; 4941 uint32_t CommandSubType; 4942 uint32_t CommandType; 4943 uint32_t UpdateGatherTableOnly; 4944#define CommitGather 0 4945#define NonCommitGather 1 4946 uint32_t ConstantBufferBindingTableBlock; 4947 uint32_t ConstantBufferValid; 4948 uint32_t OnDieTable; 4949#define Load 0 4950#define Read 1 4951 bool ConstantBufferDx9GenerateStall; 4952 uint64_t GatherBufferOffset; 4953 /* variable length fields follow */ 4954}; 4955 4956static inline __attribute__((always_inline)) void 4957GFX125_3DSTATE_GATHER_CONSTANT_HS_pack(__attribute__((unused)) __gen_user_data *data, 4958 __attribute__((unused)) void * restrict dst, 4959 __attribute__((unused)) const struct GFX125_3DSTATE_GATHER_CONSTANT_HS * restrict values) 4960{ 4961 uint32_t * restrict dw = (uint32_t * restrict) dst; 4962 4963 dw[0] = 4964 __gen_uint(values->DWordLength, 0, 7) | 4965 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 4966 __gen_uint(values->_3DCommandOpcode, 24, 26) | 4967 __gen_uint(values->CommandSubType, 27, 28) | 4968 __gen_uint(values->CommandType, 29, 31); 4969 4970 dw[1] = 4971 __gen_uint(values->UpdateGatherTableOnly, 1, 1) | 4972 __gen_uint(values->ConstantBufferBindingTableBlock, 12, 15) | 4973 __gen_uint(values->ConstantBufferValid, 16, 31); 4974 4975 dw[2] = 4976 __gen_uint(values->OnDieTable, 3, 3) | 4977 __gen_uint(values->ConstantBufferDx9GenerateStall, 5, 5) | 4978 __gen_offset(values->GatherBufferOffset, 6, 22); 4979} 4980 4981#define GFX125_3DSTATE_GATHER_CONSTANT_PS_length_bias 2 4982#define GFX125_3DSTATE_GATHER_CONSTANT_PS_header\ 4983 .DWordLength = 1, \ 4984 ._3DCommandSubOpcode = 56, \ 4985 ._3DCommandOpcode = 0, \ 4986 .CommandSubType = 3, \ 4987 .CommandType = 3 4988 4989struct GFX125_3DSTATE_GATHER_CONSTANT_PS { 4990 uint32_t DWordLength; 4991 uint32_t _3DCommandSubOpcode; 4992 uint32_t _3DCommandOpcode; 4993 uint32_t CommandSubType; 4994 uint32_t CommandType; 4995 bool DX9OnDieRegisterReadEnable; 4996 uint32_t UpdateGatherTableOnly; 4997#define CommitGather 0 4998#define NonCommitGather 1 4999 uint32_t ConstantBufferBindingTableBlock; 5000 uint32_t ConstantBufferValid; 5001 uint32_t OnDieTable; 5002#define Load 0 5003#define Read 1 5004 bool ConstantBufferDx9Enable; 5005 bool ConstantBufferDx9GenerateStall; 5006 uint64_t GatherBufferOffset; 5007 /* variable length fields follow */ 5008}; 5009 5010static inline __attribute__((always_inline)) void 5011GFX125_3DSTATE_GATHER_CONSTANT_PS_pack(__attribute__((unused)) __gen_user_data *data, 5012 __attribute__((unused)) void * restrict dst, 5013 __attribute__((unused)) const struct GFX125_3DSTATE_GATHER_CONSTANT_PS * restrict values) 5014{ 5015 uint32_t * restrict dw = (uint32_t * restrict) dst; 5016 5017 dw[0] = 5018 __gen_uint(values->DWordLength, 0, 7) | 5019 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 5020 __gen_uint(values->_3DCommandOpcode, 24, 26) | 5021 __gen_uint(values->CommandSubType, 27, 28) | 5022 __gen_uint(values->CommandType, 29, 31); 5023 5024 dw[1] = 5025 __gen_uint(values->DX9OnDieRegisterReadEnable, 0, 0) | 5026 __gen_uint(values->UpdateGatherTableOnly, 1, 1) | 5027 __gen_uint(values->ConstantBufferBindingTableBlock, 12, 15) | 5028 __gen_uint(values->ConstantBufferValid, 16, 31); 5029 5030 dw[2] = 5031 __gen_uint(values->OnDieTable, 3, 3) | 5032 __gen_uint(values->ConstantBufferDx9Enable, 4, 4) | 5033 __gen_uint(values->ConstantBufferDx9GenerateStall, 5, 5) | 5034 __gen_offset(values->GatherBufferOffset, 6, 22); 5035} 5036 5037#define GFX125_3DSTATE_GATHER_CONSTANT_VS_length_bias 2 5038#define GFX125_3DSTATE_GATHER_CONSTANT_VS_header\ 5039 .DWordLength = 0, \ 5040 ._3DCommandSubOpcode = 52, \ 5041 ._3DCommandOpcode = 0, \ 5042 .CommandSubType = 3, \ 5043 .CommandType = 3 5044 5045struct GFX125_3DSTATE_GATHER_CONSTANT_VS { 5046 uint32_t DWordLength; 5047 uint32_t _3DCommandSubOpcode; 5048 uint32_t _3DCommandOpcode; 5049 uint32_t CommandSubType; 5050 uint32_t CommandType; 5051 bool DX9OnDieRegisterReadEnable; 5052 uint32_t UpdateGatherTableOnly; 5053#define CommitGather 0 5054#define NonCommitGather 1 5055 uint32_t ConstantBufferBindingTableBlock; 5056 uint32_t ConstantBufferValid; 5057 uint32_t OnDieTable; 5058#define Load 0 5059#define Read 1 5060 bool ConstantBufferDx9Enable; 5061 bool ConstantBufferDx9GenerateStall; 5062 uint64_t GatherBufferOffset; 5063 /* variable length fields follow */ 5064}; 5065 5066static inline __attribute__((always_inline)) void 5067GFX125_3DSTATE_GATHER_CONSTANT_VS_pack(__attribute__((unused)) __gen_user_data *data, 5068 __attribute__((unused)) void * restrict dst, 5069 __attribute__((unused)) const struct GFX125_3DSTATE_GATHER_CONSTANT_VS * restrict values) 5070{ 5071 uint32_t * restrict dw = (uint32_t * restrict) dst; 5072 5073 dw[0] = 5074 __gen_uint(values->DWordLength, 0, 7) | 5075 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 5076 __gen_uint(values->_3DCommandOpcode, 24, 26) | 5077 __gen_uint(values->CommandSubType, 27, 28) | 5078 __gen_uint(values->CommandType, 29, 31); 5079 5080 dw[1] = 5081 __gen_uint(values->DX9OnDieRegisterReadEnable, 0, 0) | 5082 __gen_uint(values->UpdateGatherTableOnly, 1, 1) | 5083 __gen_uint(values->ConstantBufferBindingTableBlock, 12, 15) | 5084 __gen_uint(values->ConstantBufferValid, 16, 31); 5085 5086 dw[2] = 5087 __gen_uint(values->OnDieTable, 3, 3) | 5088 __gen_uint(values->ConstantBufferDx9Enable, 4, 4) | 5089 __gen_uint(values->ConstantBufferDx9GenerateStall, 5, 5) | 5090 __gen_offset(values->GatherBufferOffset, 6, 22); 5091} 5092 5093#define GFX125_3DSTATE_GATHER_POOL_ALLOC_length 4 5094#define GFX125_3DSTATE_GATHER_POOL_ALLOC_length_bias 2 5095#define GFX125_3DSTATE_GATHER_POOL_ALLOC_header \ 5096 .DWordLength = 2, \ 5097 ._3DCommandSubOpcode = 26, \ 5098 ._3DCommandOpcode = 1, \ 5099 .CommandSubType = 3, \ 5100 .CommandType = 3 5101 5102struct GFX125_3DSTATE_GATHER_POOL_ALLOC { 5103 uint32_t DWordLength; 5104 uint32_t _3DCommandSubOpcode; 5105 uint32_t _3DCommandOpcode; 5106 uint32_t CommandSubType; 5107 uint32_t CommandType; 5108 uint32_t MOCS; 5109 bool GatherPoolEnable; 5110 __gen_address_type GatherPoolBaseAddress; 5111 uint32_t GatherPoolBufferSize; 5112}; 5113 5114static inline __attribute__((always_inline)) void 5115GFX125_3DSTATE_GATHER_POOL_ALLOC_pack(__attribute__((unused)) __gen_user_data *data, 5116 __attribute__((unused)) void * restrict dst, 5117 __attribute__((unused)) const struct GFX125_3DSTATE_GATHER_POOL_ALLOC * restrict values) 5118{ 5119 uint32_t * restrict dw = (uint32_t * restrict) dst; 5120 5121 dw[0] = 5122 __gen_uint(values->DWordLength, 0, 7) | 5123 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 5124 __gen_uint(values->_3DCommandOpcode, 24, 26) | 5125 __gen_uint(values->CommandSubType, 27, 28) | 5126 __gen_uint(values->CommandType, 29, 31); 5127 5128 const uint64_t v1 = 5129 __gen_uint(values->MOCS, 0, 6) | 5130 __gen_uint(values->GatherPoolEnable, 11, 11); 5131 const uint64_t v1_address = 5132 __gen_address(data, &dw[1], values->GatherPoolBaseAddress, v1, 12, 63); 5133 dw[1] = v1_address; 5134 dw[2] = (v1_address >> 32) | (v1 >> 32); 5135 5136 dw[3] = 5137 __gen_uint(values->GatherPoolBufferSize, 12, 31); 5138} 5139 5140#define GFX125_3DSTATE_GS_length 10 5141#define GFX125_3DSTATE_GS_length_bias 2 5142#define GFX125_3DSTATE_GS_header \ 5143 .DWordLength = 8, \ 5144 ._3DCommandSubOpcode = 17, \ 5145 ._3DCommandOpcode = 0, \ 5146 .CommandSubType = 3, \ 5147 .CommandType = 3 5148 5149struct GFX125_3DSTATE_GS { 5150 uint32_t DWordLength; 5151 uint32_t _3DCommandSubOpcode; 5152 uint32_t _3DCommandOpcode; 5153 uint32_t CommandSubType; 5154 uint32_t CommandType; 5155 uint64_t KernelStartPointer; 5156 uint32_t ExpectedVertexCount; 5157 bool SoftwareExceptionEnable; 5158 bool MaskStackExceptionEnable; 5159 bool AccessesUAV; 5160 bool IllegalOpcodeExceptionEnable; 5161 uint32_t FloatingPointMode; 5162#define IEEE754 0 5163#define Alternate 1 5164 uint32_t ThreadDispatchPriority; 5165#define High 1 5166 uint32_t BindingTableEntryCount; 5167 uint32_t SamplerCount; 5168#define NoSamplers 0 5169#define _14Samplers 1 5170#define _58Samplers 2 5171#define _912Samplers 3 5172#define _1316Samplers 4 5173 bool VectorMaskEnable; 5174 bool SingleProgramFlow; 5175 uint32_t ScratchSpaceBuffer; 5176 uint32_t DispatchGRFStartRegisterForURBData; 5177 uint32_t VertexURBEntryReadOffset; 5178 bool IncludeVertexHandles; 5179 uint32_t VertexURBEntryReadLength; 5180 enum GFX125_3D_Prim_Topo_Type OutputTopology; 5181 uint32_t OutputVertexSize; 5182 uint32_t DispatchGRFStartRegisterForURBData54; 5183 bool Enable; 5184 bool DiscardAdjacency; 5185 uint32_t ReorderMode; 5186#define LEADING 0 5187#define TRAILING 1 5188 uint32_t Hint; 5189 bool IncludePrimitiveID; 5190 uint32_t InvocationsIncrementValue; 5191 bool StatisticsEnable; 5192 uint32_t DispatchMode; 5193#define DISPATCH_MODE_SIMD8 3 5194 uint32_t DefaultStreamId; 5195 uint32_t InstanceControl; 5196 uint32_t ControlDataHeaderSize; 5197 uint32_t MaximumNumberofThreads; 5198 uint32_t StaticOutputVertexCount; 5199 bool StaticOutput; 5200 uint32_t ControlDataFormat; 5201#define CUT 0 5202#define SID 1 5203 uint32_t UserClipDistanceCullTestEnableBitmask; 5204 uint32_t UserClipDistanceClipTestEnableBitmask; 5205 uint32_t VertexURBEntryOutputLength; 5206 uint32_t VertexURBEntryOutputReadOffset; 5207}; 5208 5209static inline __attribute__((always_inline)) void 5210GFX125_3DSTATE_GS_pack(__attribute__((unused)) __gen_user_data *data, 5211 __attribute__((unused)) void * restrict dst, 5212 __attribute__((unused)) const struct GFX125_3DSTATE_GS * restrict values) 5213{ 5214 uint32_t * restrict dw = (uint32_t * restrict) dst; 5215 5216 dw[0] = 5217 __gen_uint(values->DWordLength, 0, 7) | 5218 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 5219 __gen_uint(values->_3DCommandOpcode, 24, 26) | 5220 __gen_uint(values->CommandSubType, 27, 28) | 5221 __gen_uint(values->CommandType, 29, 31); 5222 5223 const uint64_t v1 = 5224 __gen_offset(values->KernelStartPointer, 6, 63); 5225 dw[1] = v1; 5226 dw[2] = v1 >> 32; 5227 5228 dw[3] = 5229 __gen_uint(values->ExpectedVertexCount, 0, 5) | 5230 __gen_uint(values->SoftwareExceptionEnable, 7, 7) | 5231 __gen_uint(values->MaskStackExceptionEnable, 11, 11) | 5232 __gen_uint(values->AccessesUAV, 12, 12) | 5233 __gen_uint(values->IllegalOpcodeExceptionEnable, 13, 13) | 5234 __gen_uint(values->FloatingPointMode, 16, 16) | 5235 __gen_uint(values->ThreadDispatchPriority, 17, 17) | 5236 __gen_uint(values->BindingTableEntryCount, 18, 25) | 5237 __gen_uint(values->SamplerCount, 27, 29) | 5238 __gen_uint(values->VectorMaskEnable, 30, 30) | 5239 __gen_uint(values->SingleProgramFlow, 31, 31); 5240 5241 dw[4] = 5242 __gen_uint(values->ScratchSpaceBuffer, 10, 31); 5243 5244 dw[5] = 0; 5245 5246 dw[6] = 5247 __gen_uint(values->DispatchGRFStartRegisterForURBData, 0, 3) | 5248 __gen_uint(values->VertexURBEntryReadOffset, 4, 9) | 5249 __gen_uint(values->IncludeVertexHandles, 10, 10) | 5250 __gen_uint(values->VertexURBEntryReadLength, 11, 16) | 5251 __gen_uint(values->OutputTopology, 17, 22) | 5252 __gen_uint(values->OutputVertexSize, 23, 28) | 5253 __gen_uint(values->DispatchGRFStartRegisterForURBData54, 29, 30); 5254 5255 dw[7] = 5256 __gen_uint(values->Enable, 0, 0) | 5257 __gen_uint(values->DiscardAdjacency, 1, 1) | 5258 __gen_uint(values->ReorderMode, 2, 2) | 5259 __gen_uint(values->Hint, 3, 3) | 5260 __gen_uint(values->IncludePrimitiveID, 4, 4) | 5261 __gen_uint(values->InvocationsIncrementValue, 5, 9) | 5262 __gen_uint(values->StatisticsEnable, 10, 10) | 5263 __gen_uint(values->DispatchMode, 11, 12) | 5264 __gen_uint(values->DefaultStreamId, 13, 14) | 5265 __gen_uint(values->InstanceControl, 15, 19) | 5266 __gen_uint(values->ControlDataHeaderSize, 20, 23); 5267 5268 dw[8] = 5269 __gen_uint(values->MaximumNumberofThreads, 0, 8) | 5270 __gen_uint(values->StaticOutputVertexCount, 16, 26) | 5271 __gen_uint(values->StaticOutput, 30, 30) | 5272 __gen_uint(values->ControlDataFormat, 31, 31); 5273 5274 dw[9] = 5275 __gen_uint(values->UserClipDistanceCullTestEnableBitmask, 0, 7) | 5276 __gen_uint(values->UserClipDistanceClipTestEnableBitmask, 8, 15) | 5277 __gen_uint(values->VertexURBEntryOutputLength, 16, 20) | 5278 __gen_uint(values->VertexURBEntryOutputReadOffset, 21, 26); 5279} 5280 5281#define GFX125_3DSTATE_HIER_DEPTH_BUFFER_length 5 5282#define GFX125_3DSTATE_HIER_DEPTH_BUFFER_length_bias 2 5283#define GFX125_3DSTATE_HIER_DEPTH_BUFFER_header \ 5284 .DWordLength = 3, \ 5285 ._3DCommandSubOpcode = 7, \ 5286 ._3DCommandOpcode = 0, \ 5287 .CommandSubType = 3, \ 5288 .CommandType = 3 5289 5290struct GFX125_3DSTATE_HIER_DEPTH_BUFFER { 5291 uint32_t DWordLength; 5292 uint32_t _3DCommandSubOpcode; 5293 uint32_t _3DCommandOpcode; 5294 uint32_t CommandSubType; 5295 uint32_t CommandType; 5296 uint32_t SurfacePitch; 5297 bool HierarchicalDepthBufferWriteThruEnable; 5298 uint32_t TiledMode; 5299#define TILE64 1 5300#define TILE4 3 5301 uint32_t MOCS; 5302 uint32_t HierarchicalDepthBufferMOCS; 5303 __gen_address_type SurfaceBaseAddress; 5304 uint32_t SurfaceQPitch; 5305}; 5306 5307static inline __attribute__((always_inline)) void 5308GFX125_3DSTATE_HIER_DEPTH_BUFFER_pack(__attribute__((unused)) __gen_user_data *data, 5309 __attribute__((unused)) void * restrict dst, 5310 __attribute__((unused)) const struct GFX125_3DSTATE_HIER_DEPTH_BUFFER * restrict values) 5311{ 5312 uint32_t * restrict dw = (uint32_t * restrict) dst; 5313 5314 dw[0] = 5315 __gen_uint(values->DWordLength, 0, 7) | 5316 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 5317 __gen_uint(values->_3DCommandOpcode, 24, 26) | 5318 __gen_uint(values->CommandSubType, 27, 28) | 5319 __gen_uint(values->CommandType, 29, 31); 5320 5321 dw[1] = 5322 __gen_uint(values->SurfacePitch, 0, 16) | 5323 __gen_uint(values->HierarchicalDepthBufferWriteThruEnable, 20, 20) | 5324 __gen_uint(values->TiledMode, 22, 23) | 5325 __gen_uint(values->MOCS, 25, 31) | 5326 __gen_uint(values->HierarchicalDepthBufferMOCS, 25, 31); 5327 5328 const uint64_t v2_address = 5329 __gen_address(data, &dw[2], values->SurfaceBaseAddress, 0, 0, 63); 5330 dw[2] = v2_address; 5331 dw[3] = v2_address >> 32; 5332 5333 dw[4] = 5334 __gen_uint(values->SurfaceQPitch, 0, 14); 5335} 5336 5337#define GFX125_3DSTATE_HS_length 9 5338#define GFX125_3DSTATE_HS_length_bias 2 5339#define GFX125_3DSTATE_HS_header \ 5340 .DWordLength = 7, \ 5341 ._3DCommandSubOpcode = 27, \ 5342 ._3DCommandOpcode = 0, \ 5343 .CommandSubType = 3, \ 5344 .CommandType = 3 5345 5346struct GFX125_3DSTATE_HS { 5347 uint32_t DWordLength; 5348 uint32_t _3DCommandSubOpcode; 5349 uint32_t _3DCommandOpcode; 5350 uint32_t CommandSubType; 5351 uint32_t CommandType; 5352 bool SoftwareExceptionEnable; 5353 bool IllegalOpcodeExceptionEnable; 5354 uint32_t FloatingPointMode; 5355#define IEEE754 0 5356#define alternate 1 5357 uint32_t ThreadDispatchPriority; 5358#define High 1 5359 uint32_t BindingTableEntryCount; 5360 uint32_t SamplerCount; 5361#define NoSamplers 0 5362#define _14Samplers 1 5363#define _58Samplers 2 5364#define _912Samplers 3 5365#define _1316Samplers 4 5366 uint32_t InstanceCount; 5367 uint32_t MaximumNumberofThreads; 5368 bool StatisticsEnable; 5369 bool Enable; 5370 uint64_t KernelStartPointer; 5371 uint32_t ScratchSpaceBuffer; 5372 bool IncludePrimitiveID; 5373 uint32_t PatchCountThreshold; 5374 uint32_t VertexURBEntryReadOffset; 5375 uint32_t VertexURBEntryReadLength; 5376 uint32_t DispatchMode; 5377#define DISPATCH_MODE_SINGLE_PATCH 0 5378#define DISPATCH_MODE__8_PATCH 2 5379 uint32_t DispatchGRFStartRegisterForURBData; 5380 bool IncludeVertexHandles; 5381 bool AccessesUAV; 5382 bool VectorMaskEnable; 5383 bool SingleProgramFlow; 5384 uint32_t DispatchGRFStartRegisterForURBData5; 5385}; 5386 5387static inline __attribute__((always_inline)) void 5388GFX125_3DSTATE_HS_pack(__attribute__((unused)) __gen_user_data *data, 5389 __attribute__((unused)) void * restrict dst, 5390 __attribute__((unused)) const struct GFX125_3DSTATE_HS * restrict values) 5391{ 5392 uint32_t * restrict dw = (uint32_t * restrict) dst; 5393 5394 dw[0] = 5395 __gen_uint(values->DWordLength, 0, 7) | 5396 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 5397 __gen_uint(values->_3DCommandOpcode, 24, 26) | 5398 __gen_uint(values->CommandSubType, 27, 28) | 5399 __gen_uint(values->CommandType, 29, 31); 5400 5401 dw[1] = 5402 __gen_uint(values->SoftwareExceptionEnable, 12, 12) | 5403 __gen_uint(values->IllegalOpcodeExceptionEnable, 13, 13) | 5404 __gen_uint(values->FloatingPointMode, 16, 16) | 5405 __gen_uint(values->ThreadDispatchPriority, 17, 17) | 5406 __gen_uint(values->BindingTableEntryCount, 18, 25) | 5407 __gen_uint(values->SamplerCount, 27, 29); 5408 5409 dw[2] = 5410 __gen_uint(values->InstanceCount, 0, 4) | 5411 __gen_uint(values->MaximumNumberofThreads, 8, 16) | 5412 __gen_uint(values->StatisticsEnable, 29, 29) | 5413 __gen_uint(values->Enable, 31, 31); 5414 5415 const uint64_t v3 = 5416 __gen_offset(values->KernelStartPointer, 6, 63); 5417 dw[3] = v3; 5418 dw[4] = v3 >> 32; 5419 5420 dw[5] = 5421 __gen_uint(values->ScratchSpaceBuffer, 10, 31); 5422 5423 dw[6] = 0; 5424 5425 dw[7] = 5426 __gen_uint(values->IncludePrimitiveID, 0, 0) | 5427 __gen_uint(values->PatchCountThreshold, 1, 3) | 5428 __gen_uint(values->VertexURBEntryReadOffset, 4, 9) | 5429 __gen_uint(values->VertexURBEntryReadLength, 11, 16) | 5430 __gen_uint(values->DispatchMode, 17, 18) | 5431 __gen_uint(values->DispatchGRFStartRegisterForURBData, 19, 23) | 5432 __gen_uint(values->IncludeVertexHandles, 24, 24) | 5433 __gen_uint(values->AccessesUAV, 25, 25) | 5434 __gen_uint(values->VectorMaskEnable, 26, 26) | 5435 __gen_uint(values->SingleProgramFlow, 27, 27) | 5436 __gen_uint(values->DispatchGRFStartRegisterForURBData5, 28, 28); 5437 5438 dw[8] = 0; 5439} 5440 5441#define GFX125_3DSTATE_INDEX_BUFFER_length 5 5442#define GFX125_3DSTATE_INDEX_BUFFER_length_bias 2 5443#define GFX125_3DSTATE_INDEX_BUFFER_header \ 5444 .DWordLength = 3, \ 5445 ._3DCommandSubOpcode = 10, \ 5446 ._3DCommandOpcode = 0, \ 5447 .CommandSubType = 3, \ 5448 .CommandType = 3 5449 5450struct GFX125_3DSTATE_INDEX_BUFFER { 5451 uint32_t DWordLength; 5452 uint32_t _3DCommandSubOpcode; 5453 uint32_t _3DCommandOpcode; 5454 uint32_t CommandSubType; 5455 uint32_t CommandType; 5456 uint32_t MOCS; 5457 uint32_t IndexFormat; 5458#define INDEX_BYTE 0 5459#define INDEX_WORD 1 5460#define INDEX_DWORD 2 5461 bool L3BypassDisable; 5462 __gen_address_type BufferStartingAddress; 5463 uint32_t BufferSize; 5464}; 5465 5466static inline __attribute__((always_inline)) void 5467GFX125_3DSTATE_INDEX_BUFFER_pack(__attribute__((unused)) __gen_user_data *data, 5468 __attribute__((unused)) void * restrict dst, 5469 __attribute__((unused)) const struct GFX125_3DSTATE_INDEX_BUFFER * restrict values) 5470{ 5471 uint32_t * restrict dw = (uint32_t * restrict) dst; 5472 5473 dw[0] = 5474 __gen_uint(values->DWordLength, 0, 7) | 5475 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 5476 __gen_uint(values->_3DCommandOpcode, 24, 26) | 5477 __gen_uint(values->CommandSubType, 27, 28) | 5478 __gen_uint(values->CommandType, 29, 31); 5479 5480 dw[1] = 5481 __gen_uint(values->MOCS, 0, 6) | 5482 __gen_uint(values->IndexFormat, 8, 9) | 5483 __gen_uint(values->L3BypassDisable, 11, 11); 5484 5485 const uint64_t v2_address = 5486 __gen_address(data, &dw[2], values->BufferStartingAddress, 0, 0, 63); 5487 dw[2] = v2_address; 5488 dw[3] = v2_address >> 32; 5489 5490 dw[4] = 5491 __gen_uint(values->BufferSize, 0, 31); 5492} 5493 5494#define GFX125_3DSTATE_LINE_STIPPLE_length 3 5495#define GFX125_3DSTATE_LINE_STIPPLE_length_bias 2 5496#define GFX125_3DSTATE_LINE_STIPPLE_header \ 5497 .DWordLength = 1, \ 5498 ._3DCommandSubOpcode = 8, \ 5499 ._3DCommandOpcode = 1, \ 5500 .CommandSubType = 3, \ 5501 .CommandType = 3 5502 5503struct GFX125_3DSTATE_LINE_STIPPLE { 5504 uint32_t DWordLength; 5505 uint32_t _3DCommandSubOpcode; 5506 uint32_t _3DCommandOpcode; 5507 uint32_t CommandSubType; 5508 uint32_t CommandType; 5509 uint32_t LineStipplePattern; 5510 uint32_t CurrentStippleIndex; 5511 uint32_t CurrentRepeatCounter; 5512 bool ModifyEnableCurrentRepeatCounterCurrentStippleIndex; 5513 uint32_t LineStippleRepeatCount; 5514 float LineStippleInverseRepeatCount; 5515}; 5516 5517static inline __attribute__((always_inline)) void 5518GFX125_3DSTATE_LINE_STIPPLE_pack(__attribute__((unused)) __gen_user_data *data, 5519 __attribute__((unused)) void * restrict dst, 5520 __attribute__((unused)) const struct GFX125_3DSTATE_LINE_STIPPLE * restrict values) 5521{ 5522 uint32_t * restrict dw = (uint32_t * restrict) dst; 5523 5524 dw[0] = 5525 __gen_uint(values->DWordLength, 0, 7) | 5526 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 5527 __gen_uint(values->_3DCommandOpcode, 24, 26) | 5528 __gen_uint(values->CommandSubType, 27, 28) | 5529 __gen_uint(values->CommandType, 29, 31); 5530 5531 dw[1] = 5532 __gen_uint(values->LineStipplePattern, 0, 15) | 5533 __gen_uint(values->CurrentStippleIndex, 16, 19) | 5534 __gen_uint(values->CurrentRepeatCounter, 21, 29) | 5535 __gen_uint(values->ModifyEnableCurrentRepeatCounterCurrentStippleIndex, 31, 31); 5536 5537 dw[2] = 5538 __gen_uint(values->LineStippleRepeatCount, 0, 8) | 5539 __gen_ufixed(values->LineStippleInverseRepeatCount, 15, 31, 16); 5540} 5541 5542#define GFX125_3DSTATE_MONOFILTER_SIZE_length 2 5543#define GFX125_3DSTATE_MONOFILTER_SIZE_length_bias 2 5544#define GFX125_3DSTATE_MONOFILTER_SIZE_header \ 5545 .DWordLength = 0, \ 5546 ._3DCommandSubOpcode = 17, \ 5547 ._3DCommandOpcode = 1, \ 5548 .CommandSubType = 3, \ 5549 .CommandType = 3 5550 5551struct GFX125_3DSTATE_MONOFILTER_SIZE { 5552 uint32_t DWordLength; 5553 uint32_t _3DCommandSubOpcode; 5554 uint32_t _3DCommandOpcode; 5555 uint32_t CommandSubType; 5556 uint32_t CommandType; 5557 uint32_t MonochromeFilterHeight; 5558 uint32_t MonochromeFilterWidth; 5559}; 5560 5561static inline __attribute__((always_inline)) void 5562GFX125_3DSTATE_MONOFILTER_SIZE_pack(__attribute__((unused)) __gen_user_data *data, 5563 __attribute__((unused)) void * restrict dst, 5564 __attribute__((unused)) const struct GFX125_3DSTATE_MONOFILTER_SIZE * restrict values) 5565{ 5566 uint32_t * restrict dw = (uint32_t * restrict) dst; 5567 5568 dw[0] = 5569 __gen_uint(values->DWordLength, 0, 7) | 5570 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 5571 __gen_uint(values->_3DCommandOpcode, 24, 26) | 5572 __gen_uint(values->CommandSubType, 27, 28) | 5573 __gen_uint(values->CommandType, 29, 31); 5574 5575 dw[1] = 5576 __gen_uint(values->MonochromeFilterHeight, 0, 2) | 5577 __gen_uint(values->MonochromeFilterWidth, 3, 5); 5578} 5579 5580#define GFX125_3DSTATE_MULTISAMPLE_length 2 5581#define GFX125_3DSTATE_MULTISAMPLE_length_bias 2 5582#define GFX125_3DSTATE_MULTISAMPLE_header \ 5583 .DWordLength = 0, \ 5584 ._3DCommandSubOpcode = 13, \ 5585 ._3DCommandOpcode = 0, \ 5586 .CommandSubType = 3, \ 5587 .CommandType = 3 5588 5589struct GFX125_3DSTATE_MULTISAMPLE { 5590 uint32_t DWordLength; 5591 uint32_t _3DCommandSubOpcode; 5592 uint32_t _3DCommandOpcode; 5593 uint32_t CommandSubType; 5594 uint32_t CommandType; 5595 uint32_t NumberofMultisamples; 5596 uint32_t PixelLocation; 5597#define CENTER 0 5598#define UL_CORNER 1 5599 bool PixelPositionOffsetEnable; 5600}; 5601 5602static inline __attribute__((always_inline)) void 5603GFX125_3DSTATE_MULTISAMPLE_pack(__attribute__((unused)) __gen_user_data *data, 5604 __attribute__((unused)) void * restrict dst, 5605 __attribute__((unused)) const struct GFX125_3DSTATE_MULTISAMPLE * restrict values) 5606{ 5607 uint32_t * restrict dw = (uint32_t * restrict) dst; 5608 5609 dw[0] = 5610 __gen_uint(values->DWordLength, 0, 7) | 5611 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 5612 __gen_uint(values->_3DCommandOpcode, 24, 26) | 5613 __gen_uint(values->CommandSubType, 27, 28) | 5614 __gen_uint(values->CommandType, 29, 31); 5615 5616 dw[1] = 5617 __gen_uint(values->NumberofMultisamples, 1, 3) | 5618 __gen_uint(values->PixelLocation, 4, 4) | 5619 __gen_uint(values->PixelPositionOffsetEnable, 5, 5); 5620} 5621 5622#define GFX125_3DSTATE_POLY_STIPPLE_OFFSET_length 2 5623#define GFX125_3DSTATE_POLY_STIPPLE_OFFSET_length_bias 2 5624#define GFX125_3DSTATE_POLY_STIPPLE_OFFSET_header\ 5625 .DWordLength = 0, \ 5626 ._3DCommandSubOpcode = 6, \ 5627 ._3DCommandOpcode = 1, \ 5628 .CommandSubType = 3, \ 5629 .CommandType = 3 5630 5631struct GFX125_3DSTATE_POLY_STIPPLE_OFFSET { 5632 uint32_t DWordLength; 5633 uint32_t _3DCommandSubOpcode; 5634 uint32_t _3DCommandOpcode; 5635 uint32_t CommandSubType; 5636 uint32_t CommandType; 5637 uint32_t PolygonStippleYOffset; 5638 uint32_t PolygonStippleXOffset; 5639}; 5640 5641static inline __attribute__((always_inline)) void 5642GFX125_3DSTATE_POLY_STIPPLE_OFFSET_pack(__attribute__((unused)) __gen_user_data *data, 5643 __attribute__((unused)) void * restrict dst, 5644 __attribute__((unused)) const struct GFX125_3DSTATE_POLY_STIPPLE_OFFSET * restrict values) 5645{ 5646 uint32_t * restrict dw = (uint32_t * restrict) dst; 5647 5648 dw[0] = 5649 __gen_uint(values->DWordLength, 0, 7) | 5650 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 5651 __gen_uint(values->_3DCommandOpcode, 24, 26) | 5652 __gen_uint(values->CommandSubType, 27, 28) | 5653 __gen_uint(values->CommandType, 29, 31); 5654 5655 dw[1] = 5656 __gen_uint(values->PolygonStippleYOffset, 0, 4) | 5657 __gen_uint(values->PolygonStippleXOffset, 8, 12); 5658} 5659 5660#define GFX125_3DSTATE_POLY_STIPPLE_PATTERN_length 33 5661#define GFX125_3DSTATE_POLY_STIPPLE_PATTERN_length_bias 2 5662#define GFX125_3DSTATE_POLY_STIPPLE_PATTERN_header\ 5663 .DWordLength = 31, \ 5664 ._3DCommandSubOpcode = 7, \ 5665 ._3DCommandOpcode = 1, \ 5666 .CommandSubType = 3, \ 5667 .CommandType = 3 5668 5669struct GFX125_3DSTATE_POLY_STIPPLE_PATTERN { 5670 uint32_t DWordLength; 5671 uint32_t _3DCommandSubOpcode; 5672 uint32_t _3DCommandOpcode; 5673 uint32_t CommandSubType; 5674 uint32_t CommandType; 5675 uint32_t PatternRow[32]; 5676}; 5677 5678static inline __attribute__((always_inline)) void 5679GFX125_3DSTATE_POLY_STIPPLE_PATTERN_pack(__attribute__((unused)) __gen_user_data *data, 5680 __attribute__((unused)) void * restrict dst, 5681 __attribute__((unused)) const struct GFX125_3DSTATE_POLY_STIPPLE_PATTERN * restrict values) 5682{ 5683 uint32_t * restrict dw = (uint32_t * restrict) dst; 5684 5685 dw[0] = 5686 __gen_uint(values->DWordLength, 0, 7) | 5687 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 5688 __gen_uint(values->_3DCommandOpcode, 24, 26) | 5689 __gen_uint(values->CommandSubType, 27, 28) | 5690 __gen_uint(values->CommandType, 29, 31); 5691 5692 dw[1] = 5693 __gen_uint(values->PatternRow[0], 0, 31); 5694 5695 dw[2] = 5696 __gen_uint(values->PatternRow[1], 0, 31); 5697 5698 dw[3] = 5699 __gen_uint(values->PatternRow[2], 0, 31); 5700 5701 dw[4] = 5702 __gen_uint(values->PatternRow[3], 0, 31); 5703 5704 dw[5] = 5705 __gen_uint(values->PatternRow[4], 0, 31); 5706 5707 dw[6] = 5708 __gen_uint(values->PatternRow[5], 0, 31); 5709 5710 dw[7] = 5711 __gen_uint(values->PatternRow[6], 0, 31); 5712 5713 dw[8] = 5714 __gen_uint(values->PatternRow[7], 0, 31); 5715 5716 dw[9] = 5717 __gen_uint(values->PatternRow[8], 0, 31); 5718 5719 dw[10] = 5720 __gen_uint(values->PatternRow[9], 0, 31); 5721 5722 dw[11] = 5723 __gen_uint(values->PatternRow[10], 0, 31); 5724 5725 dw[12] = 5726 __gen_uint(values->PatternRow[11], 0, 31); 5727 5728 dw[13] = 5729 __gen_uint(values->PatternRow[12], 0, 31); 5730 5731 dw[14] = 5732 __gen_uint(values->PatternRow[13], 0, 31); 5733 5734 dw[15] = 5735 __gen_uint(values->PatternRow[14], 0, 31); 5736 5737 dw[16] = 5738 __gen_uint(values->PatternRow[15], 0, 31); 5739 5740 dw[17] = 5741 __gen_uint(values->PatternRow[16], 0, 31); 5742 5743 dw[18] = 5744 __gen_uint(values->PatternRow[17], 0, 31); 5745 5746 dw[19] = 5747 __gen_uint(values->PatternRow[18], 0, 31); 5748 5749 dw[20] = 5750 __gen_uint(values->PatternRow[19], 0, 31); 5751 5752 dw[21] = 5753 __gen_uint(values->PatternRow[20], 0, 31); 5754 5755 dw[22] = 5756 __gen_uint(values->PatternRow[21], 0, 31); 5757 5758 dw[23] = 5759 __gen_uint(values->PatternRow[22], 0, 31); 5760 5761 dw[24] = 5762 __gen_uint(values->PatternRow[23], 0, 31); 5763 5764 dw[25] = 5765 __gen_uint(values->PatternRow[24], 0, 31); 5766 5767 dw[26] = 5768 __gen_uint(values->PatternRow[25], 0, 31); 5769 5770 dw[27] = 5771 __gen_uint(values->PatternRow[26], 0, 31); 5772 5773 dw[28] = 5774 __gen_uint(values->PatternRow[27], 0, 31); 5775 5776 dw[29] = 5777 __gen_uint(values->PatternRow[28], 0, 31); 5778 5779 dw[30] = 5780 __gen_uint(values->PatternRow[29], 0, 31); 5781 5782 dw[31] = 5783 __gen_uint(values->PatternRow[30], 0, 31); 5784 5785 dw[32] = 5786 __gen_uint(values->PatternRow[31], 0, 31); 5787} 5788 5789#define GFX125_3DSTATE_PRIMITIVE_REPLICATION_length 6 5790#define GFX125_3DSTATE_PRIMITIVE_REPLICATION_length_bias 2 5791#define GFX125_3DSTATE_PRIMITIVE_REPLICATION_header\ 5792 .DWordLength = 4, \ 5793 ._3DCommandSubOpcode = 108, \ 5794 ._3DCommandOpcode = 0, \ 5795 .CommandSubType = 3, \ 5796 .CommandType = 3 5797 5798struct GFX125_3DSTATE_PRIMITIVE_REPLICATION { 5799 uint32_t DWordLength; 5800 uint32_t _3DCommandSubOpcode; 5801 uint32_t _3DCommandOpcode; 5802 uint32_t CommandSubType; 5803 uint32_t CommandType; 5804 uint32_t ReplicationCount; 5805 uint32_t ReplicaMask; 5806 uint32_t ViewportOffset[16]; 5807 uint32_t RTAIOffset[16]; 5808}; 5809 5810static inline __attribute__((always_inline)) void 5811GFX125_3DSTATE_PRIMITIVE_REPLICATION_pack(__attribute__((unused)) __gen_user_data *data, 5812 __attribute__((unused)) void * restrict dst, 5813 __attribute__((unused)) const struct GFX125_3DSTATE_PRIMITIVE_REPLICATION * restrict values) 5814{ 5815 uint32_t * restrict dw = (uint32_t * restrict) dst; 5816 5817 dw[0] = 5818 __gen_uint(values->DWordLength, 0, 7) | 5819 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 5820 __gen_uint(values->_3DCommandOpcode, 24, 26) | 5821 __gen_uint(values->CommandSubType, 27, 28) | 5822 __gen_uint(values->CommandType, 29, 31); 5823 5824 dw[1] = 5825 __gen_uint(values->ReplicationCount, 0, 3) | 5826 __gen_uint(values->ReplicaMask, 16, 31); 5827 5828 dw[2] = 5829 __gen_uint(values->ViewportOffset[0], 0, 3) | 5830 __gen_uint(values->ViewportOffset[1], 4, 7) | 5831 __gen_uint(values->ViewportOffset[2], 8, 11) | 5832 __gen_uint(values->ViewportOffset[3], 12, 15) | 5833 __gen_uint(values->ViewportOffset[4], 16, 19) | 5834 __gen_uint(values->ViewportOffset[5], 20, 23) | 5835 __gen_uint(values->ViewportOffset[6], 24, 27) | 5836 __gen_uint(values->ViewportOffset[7], 28, 31); 5837 5838 dw[3] = 5839 __gen_uint(values->ViewportOffset[8], 0, 3) | 5840 __gen_uint(values->ViewportOffset[9], 4, 7) | 5841 __gen_uint(values->ViewportOffset[10], 8, 11) | 5842 __gen_uint(values->ViewportOffset[11], 12, 15) | 5843 __gen_uint(values->ViewportOffset[12], 16, 19) | 5844 __gen_uint(values->ViewportOffset[13], 20, 23) | 5845 __gen_uint(values->ViewportOffset[14], 24, 27) | 5846 __gen_uint(values->ViewportOffset[15], 28, 31); 5847 5848 dw[4] = 5849 __gen_uint(values->RTAIOffset[0], 0, 3) | 5850 __gen_uint(values->RTAIOffset[1], 4, 7) | 5851 __gen_uint(values->RTAIOffset[2], 8, 11) | 5852 __gen_uint(values->RTAIOffset[3], 12, 15) | 5853 __gen_uint(values->RTAIOffset[4], 16, 19) | 5854 __gen_uint(values->RTAIOffset[5], 20, 23) | 5855 __gen_uint(values->RTAIOffset[6], 24, 27) | 5856 __gen_uint(values->RTAIOffset[7], 28, 31); 5857 5858 dw[5] = 5859 __gen_uint(values->RTAIOffset[8], 0, 3) | 5860 __gen_uint(values->RTAIOffset[9], 4, 7) | 5861 __gen_uint(values->RTAIOffset[10], 8, 11) | 5862 __gen_uint(values->RTAIOffset[11], 12, 15) | 5863 __gen_uint(values->RTAIOffset[12], 16, 19) | 5864 __gen_uint(values->RTAIOffset[13], 20, 23) | 5865 __gen_uint(values->RTAIOffset[14], 24, 27) | 5866 __gen_uint(values->RTAIOffset[15], 28, 31); 5867} 5868 5869#define GFX125_3DSTATE_PS_length 12 5870#define GFX125_3DSTATE_PS_length_bias 2 5871#define GFX125_3DSTATE_PS_header \ 5872 .DWordLength = 10, \ 5873 ._3DCommandSubOpcode = 32, \ 5874 ._3DCommandOpcode = 0, \ 5875 .CommandSubType = 3, \ 5876 .CommandType = 3 5877 5878struct GFX125_3DSTATE_PS { 5879 uint32_t DWordLength; 5880 uint32_t _3DCommandSubOpcode; 5881 uint32_t _3DCommandOpcode; 5882 uint32_t CommandSubType; 5883 uint32_t CommandType; 5884 uint64_t KernelStartPointer0; 5885 bool SoftwareExceptionEnable; 5886 bool MaskStackExceptionEnable; 5887 bool IllegalOpcodeExceptionEnable; 5888 uint32_t RoundingMode; 5889#define RTNE 0 5890#define RU 1 5891#define RD 2 5892#define RTZ 3 5893 uint32_t FloatingPointMode; 5894#define IEEE754 0 5895#define Alternate 1 5896 uint32_t ThreadDispatchPriority; 5897#define High 1 5898 uint32_t BindingTableEntryCount; 5899 uint32_t SinglePrecisionDenormalMode; 5900#define FlushedtoZero 0 5901#define Retained 1 5902 uint32_t SamplerCount; 5903#define NoSamplers 0 5904#define _14Samplers 1 5905#define _58Samplers 2 5906#define _912Samplers 3 5907#define _1316Samplers 4 5908 bool VectorMaskEnable; 5909 bool SingleProgramFlow; 5910 uint32_t ScratchSpaceBuffer; 5911 bool _8PixelDispatchEnable; 5912 bool _16PixelDispatchEnable; 5913 bool _32PixelDispatchEnable; 5914 uint32_t PositionXYOffsetSelect; 5915#define POSOFFSET_NONE 0 5916#define POSOFFSET_CENTROID 2 5917#define POSOFFSET_SAMPLE 3 5918 uint32_t RenderTargetResolveType; 5919#define RESOLVE_DISABLED 0 5920#define RESOLVE_PARTIAL 1 5921#define FAST_CLEAR_0 2 5922#define RESOLVE_FULL 3 5923 bool RenderTargetFastClearEnable; 5924 bool PushConstantEnable; 5925 uint32_t MaximumNumberofThreadsPerPSD; 5926 uint32_t DispatchGRFStartRegisterForConstantSetupData2; 5927 uint32_t DispatchGRFStartRegisterForConstantSetupData1; 5928 uint32_t DispatchGRFStartRegisterForConstantSetupData0; 5929 uint64_t KernelStartPointer1; 5930 uint64_t KernelStartPointer2; 5931}; 5932 5933static inline __attribute__((always_inline)) void 5934GFX125_3DSTATE_PS_pack(__attribute__((unused)) __gen_user_data *data, 5935 __attribute__((unused)) void * restrict dst, 5936 __attribute__((unused)) const struct GFX125_3DSTATE_PS * restrict values) 5937{ 5938 uint32_t * restrict dw = (uint32_t * restrict) dst; 5939 5940 dw[0] = 5941 __gen_uint(values->DWordLength, 0, 7) | 5942 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 5943 __gen_uint(values->_3DCommandOpcode, 24, 26) | 5944 __gen_uint(values->CommandSubType, 27, 28) | 5945 __gen_uint(values->CommandType, 29, 31); 5946 5947 const uint64_t v1 = 5948 __gen_offset(values->KernelStartPointer0, 6, 63); 5949 dw[1] = v1; 5950 dw[2] = v1 >> 32; 5951 5952 dw[3] = 5953 __gen_uint(values->SoftwareExceptionEnable, 7, 7) | 5954 __gen_uint(values->MaskStackExceptionEnable, 11, 11) | 5955 __gen_uint(values->IllegalOpcodeExceptionEnable, 13, 13) | 5956 __gen_uint(values->RoundingMode, 14, 15) | 5957 __gen_uint(values->FloatingPointMode, 16, 16) | 5958 __gen_uint(values->ThreadDispatchPriority, 17, 17) | 5959 __gen_uint(values->BindingTableEntryCount, 18, 25) | 5960 __gen_uint(values->SinglePrecisionDenormalMode, 26, 26) | 5961 __gen_uint(values->SamplerCount, 27, 29) | 5962 __gen_uint(values->VectorMaskEnable, 30, 30) | 5963 __gen_uint(values->SingleProgramFlow, 31, 31); 5964 5965 dw[4] = 5966 __gen_uint(values->ScratchSpaceBuffer, 10, 31); 5967 5968 dw[5] = 0; 5969 5970 dw[6] = 5971 __gen_uint(values->_8PixelDispatchEnable, 0, 0) | 5972 __gen_uint(values->_16PixelDispatchEnable, 1, 1) | 5973 __gen_uint(values->_32PixelDispatchEnable, 2, 2) | 5974 __gen_uint(values->PositionXYOffsetSelect, 3, 4) | 5975 __gen_uint(values->RenderTargetResolveType, 6, 7) | 5976 __gen_uint(values->RenderTargetFastClearEnable, 8, 8) | 5977 __gen_uint(values->PushConstantEnable, 11, 11) | 5978 __gen_uint(values->MaximumNumberofThreadsPerPSD, 23, 31); 5979 5980 dw[7] = 5981 __gen_uint(values->DispatchGRFStartRegisterForConstantSetupData2, 0, 6) | 5982 __gen_uint(values->DispatchGRFStartRegisterForConstantSetupData1, 8, 14) | 5983 __gen_uint(values->DispatchGRFStartRegisterForConstantSetupData0, 16, 22); 5984 5985 const uint64_t v8 = 5986 __gen_offset(values->KernelStartPointer1, 6, 63); 5987 dw[8] = v8; 5988 dw[9] = v8 >> 32; 5989 5990 const uint64_t v10 = 5991 __gen_offset(values->KernelStartPointer2, 6, 63); 5992 dw[10] = v10; 5993 dw[11] = v10 >> 32; 5994} 5995 5996#define GFX125_3DSTATE_PS_BLEND_length 2 5997#define GFX125_3DSTATE_PS_BLEND_length_bias 2 5998#define GFX125_3DSTATE_PS_BLEND_header \ 5999 .DWordLength = 0, \ 6000 ._3DCommandSubOpcode = 77, \ 6001 ._3DCommandOpcode = 0, \ 6002 .CommandSubType = 3, \ 6003 .CommandType = 3 6004 6005struct GFX125_3DSTATE_PS_BLEND { 6006 uint32_t DWordLength; 6007 uint32_t _3DCommandSubOpcode; 6008 uint32_t _3DCommandOpcode; 6009 uint32_t CommandSubType; 6010 uint32_t CommandType; 6011 bool IndependentAlphaBlendEnable; 6012 bool AlphaTestEnable; 6013 enum GFX125_3D_Color_Buffer_Blend_Factor DestinationBlendFactor; 6014 enum GFX125_3D_Color_Buffer_Blend_Factor SourceBlendFactor; 6015 enum GFX125_3D_Color_Buffer_Blend_Factor DestinationAlphaBlendFactor; 6016 enum GFX125_3D_Color_Buffer_Blend_Factor SourceAlphaBlendFactor; 6017 bool ColorBufferBlendEnable; 6018 bool HasWriteableRT; 6019 bool AlphaToCoverageEnable; 6020}; 6021 6022static inline __attribute__((always_inline)) void 6023GFX125_3DSTATE_PS_BLEND_pack(__attribute__((unused)) __gen_user_data *data, 6024 __attribute__((unused)) void * restrict dst, 6025 __attribute__((unused)) const struct GFX125_3DSTATE_PS_BLEND * restrict values) 6026{ 6027 uint32_t * restrict dw = (uint32_t * restrict) dst; 6028 6029 dw[0] = 6030 __gen_uint(values->DWordLength, 0, 7) | 6031 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 6032 __gen_uint(values->_3DCommandOpcode, 24, 26) | 6033 __gen_uint(values->CommandSubType, 27, 28) | 6034 __gen_uint(values->CommandType, 29, 31); 6035 6036 dw[1] = 6037 __gen_uint(values->IndependentAlphaBlendEnable, 7, 7) | 6038 __gen_uint(values->AlphaTestEnable, 8, 8) | 6039 __gen_uint(values->DestinationBlendFactor, 9, 13) | 6040 __gen_uint(values->SourceBlendFactor, 14, 18) | 6041 __gen_uint(values->DestinationAlphaBlendFactor, 19, 23) | 6042 __gen_uint(values->SourceAlphaBlendFactor, 24, 28) | 6043 __gen_uint(values->ColorBufferBlendEnable, 29, 29) | 6044 __gen_uint(values->HasWriteableRT, 30, 30) | 6045 __gen_uint(values->AlphaToCoverageEnable, 31, 31); 6046} 6047 6048#define GFX125_3DSTATE_PS_EXTRA_length 2 6049#define GFX125_3DSTATE_PS_EXTRA_length_bias 2 6050#define GFX125_3DSTATE_PS_EXTRA_header \ 6051 .DWordLength = 0, \ 6052 ._3DCommandSubOpcode = 79, \ 6053 ._3DCommandOpcode = 0, \ 6054 .CommandSubType = 3, \ 6055 .CommandType = 3 6056 6057struct GFX125_3DSTATE_PS_EXTRA { 6058 uint32_t DWordLength; 6059 uint32_t _3DCommandSubOpcode; 6060 uint32_t _3DCommandOpcode; 6061 uint32_t CommandSubType; 6062 uint32_t CommandType; 6063 uint32_t InputCoverageMaskState; 6064#define ICMS_NONE 0 6065#define ICMS_NORMAL 1 6066#define ICMS_INNER_CONSERVATIVE 2 6067#define ICMS_DEPTH_COVERAGE 3 6068 bool PixelShaderHasUAV; 6069 bool PixelShaderPullsBary; 6070 bool PixelShaderIsPerCoarsePixel; 6071 bool PixelShaderComputesStencil; 6072 bool PixelShaderIsPerSample; 6073 bool PixelShaderDisablesAlphaToCoverage; 6074 bool AttributeEnable; 6075 bool SimplePSHint; 6076 bool PixelShaderRequiresSubpixelSampleOffsets; 6077 bool PixelShaderRequiresNonPerspectiveBaryPlaneCoefficients; 6078 bool PixelShaderRequiresPerspectiveBaryPlaneCoefficients; 6079 bool PixelShaderRequiresSourceDepthandorWPlaneCoefficients; 6080 bool PixelShaderRequiresRequestedCoarsePixelShadingSize; 6081 bool PixelShaderUsesSourceW; 6082 bool PixelShaderUsesSourceDepth; 6083 bool ForceComputedDepth; 6084 uint32_t PixelShaderComputedDepthMode; 6085#define PSCDEPTH_OFF 0 6086#define PSCDEPTH_ON 1 6087#define PSCDEPTH_ON_GE 2 6088#define PSCDEPTH_ON_LE 3 6089 bool PixelShaderKillsPixel; 6090 bool oMaskPresenttoRenderTarget; 6091 bool PixelShaderDoesnotwritetoRT; 6092 bool PixelShaderValid; 6093}; 6094 6095static inline __attribute__((always_inline)) void 6096GFX125_3DSTATE_PS_EXTRA_pack(__attribute__((unused)) __gen_user_data *data, 6097 __attribute__((unused)) void * restrict dst, 6098 __attribute__((unused)) const struct GFX125_3DSTATE_PS_EXTRA * restrict values) 6099{ 6100 uint32_t * restrict dw = (uint32_t * restrict) dst; 6101 6102 dw[0] = 6103 __gen_uint(values->DWordLength, 0, 7) | 6104 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 6105 __gen_uint(values->_3DCommandOpcode, 24, 26) | 6106 __gen_uint(values->CommandSubType, 27, 28) | 6107 __gen_uint(values->CommandType, 29, 31); 6108 6109 dw[1] = 6110 __gen_uint(values->InputCoverageMaskState, 0, 1) | 6111 __gen_uint(values->PixelShaderHasUAV, 2, 2) | 6112 __gen_uint(values->PixelShaderPullsBary, 3, 3) | 6113 __gen_uint(values->PixelShaderIsPerCoarsePixel, 4, 4) | 6114 __gen_uint(values->PixelShaderComputesStencil, 5, 5) | 6115 __gen_uint(values->PixelShaderIsPerSample, 6, 6) | 6116 __gen_uint(values->PixelShaderDisablesAlphaToCoverage, 7, 7) | 6117 __gen_uint(values->AttributeEnable, 8, 8) | 6118 __gen_uint(values->SimplePSHint, 9, 9) | 6119 __gen_uint(values->PixelShaderRequiresSubpixelSampleOffsets, 18, 18) | 6120 __gen_uint(values->PixelShaderRequiresNonPerspectiveBaryPlaneCoefficients, 19, 19) | 6121 __gen_uint(values->PixelShaderRequiresPerspectiveBaryPlaneCoefficients, 20, 20) | 6122 __gen_uint(values->PixelShaderRequiresSourceDepthandorWPlaneCoefficients, 21, 21) | 6123 __gen_uint(values->PixelShaderRequiresRequestedCoarsePixelShadingSize, 22, 22) | 6124 __gen_uint(values->PixelShaderUsesSourceW, 23, 23) | 6125 __gen_uint(values->PixelShaderUsesSourceDepth, 24, 24) | 6126 __gen_uint(values->ForceComputedDepth, 25, 25) | 6127 __gen_uint(values->PixelShaderComputedDepthMode, 26, 27) | 6128 __gen_uint(values->PixelShaderKillsPixel, 28, 28) | 6129 __gen_uint(values->oMaskPresenttoRenderTarget, 29, 29) | 6130 __gen_uint(values->PixelShaderDoesnotwritetoRT, 30, 30) | 6131 __gen_uint(values->PixelShaderValid, 31, 31); 6132} 6133 6134#define GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_DS_length 2 6135#define GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_DS_length_bias 2 6136#define GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_DS_header\ 6137 .DWordLength = 0, \ 6138 ._3DCommandSubOpcode = 20, \ 6139 ._3DCommandOpcode = 1, \ 6140 .CommandSubType = 3, \ 6141 .CommandType = 3 6142 6143struct GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_DS { 6144 uint32_t DWordLength; 6145 uint32_t _3DCommandSubOpcode; 6146 uint32_t _3DCommandOpcode; 6147 uint32_t CommandSubType; 6148 uint32_t CommandType; 6149 uint32_t ConstantBufferSize; 6150 uint32_t ConstantBufferOffset; 6151}; 6152 6153static inline __attribute__((always_inline)) void 6154GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_DS_pack(__attribute__((unused)) __gen_user_data *data, 6155 __attribute__((unused)) void * restrict dst, 6156 __attribute__((unused)) const struct GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_DS * restrict values) 6157{ 6158 uint32_t * restrict dw = (uint32_t * restrict) dst; 6159 6160 dw[0] = 6161 __gen_uint(values->DWordLength, 0, 7) | 6162 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 6163 __gen_uint(values->_3DCommandOpcode, 24, 26) | 6164 __gen_uint(values->CommandSubType, 27, 28) | 6165 __gen_uint(values->CommandType, 29, 31); 6166 6167 dw[1] = 6168 __gen_uint(values->ConstantBufferSize, 0, 5) | 6169 __gen_uint(values->ConstantBufferOffset, 16, 20); 6170} 6171 6172#define GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_GS_length 2 6173#define GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_GS_length_bias 2 6174#define GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_GS_header\ 6175 .DWordLength = 0, \ 6176 ._3DCommandSubOpcode = 21, \ 6177 ._3DCommandOpcode = 1, \ 6178 .CommandSubType = 3, \ 6179 .CommandType = 3 6180 6181struct GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_GS { 6182 uint32_t DWordLength; 6183 uint32_t _3DCommandSubOpcode; 6184 uint32_t _3DCommandOpcode; 6185 uint32_t CommandSubType; 6186 uint32_t CommandType; 6187 uint32_t ConstantBufferSize; 6188 uint32_t ConstantBufferOffset; 6189}; 6190 6191static inline __attribute__((always_inline)) void 6192GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_GS_pack(__attribute__((unused)) __gen_user_data *data, 6193 __attribute__((unused)) void * restrict dst, 6194 __attribute__((unused)) const struct GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_GS * restrict values) 6195{ 6196 uint32_t * restrict dw = (uint32_t * restrict) dst; 6197 6198 dw[0] = 6199 __gen_uint(values->DWordLength, 0, 7) | 6200 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 6201 __gen_uint(values->_3DCommandOpcode, 24, 26) | 6202 __gen_uint(values->CommandSubType, 27, 28) | 6203 __gen_uint(values->CommandType, 29, 31); 6204 6205 dw[1] = 6206 __gen_uint(values->ConstantBufferSize, 0, 5) | 6207 __gen_uint(values->ConstantBufferOffset, 16, 20); 6208} 6209 6210#define GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_HS_length 2 6211#define GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_HS_length_bias 2 6212#define GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_HS_header\ 6213 .DWordLength = 0, \ 6214 ._3DCommandSubOpcode = 19, \ 6215 ._3DCommandOpcode = 1, \ 6216 .CommandSubType = 3, \ 6217 .CommandType = 3 6218 6219struct GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_HS { 6220 uint32_t DWordLength; 6221 uint32_t _3DCommandSubOpcode; 6222 uint32_t _3DCommandOpcode; 6223 uint32_t CommandSubType; 6224 uint32_t CommandType; 6225 uint32_t ConstantBufferSize; 6226 uint32_t ConstantBufferOffset; 6227}; 6228 6229static inline __attribute__((always_inline)) void 6230GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_HS_pack(__attribute__((unused)) __gen_user_data *data, 6231 __attribute__((unused)) void * restrict dst, 6232 __attribute__((unused)) const struct GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_HS * restrict values) 6233{ 6234 uint32_t * restrict dw = (uint32_t * restrict) dst; 6235 6236 dw[0] = 6237 __gen_uint(values->DWordLength, 0, 7) | 6238 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 6239 __gen_uint(values->_3DCommandOpcode, 24, 26) | 6240 __gen_uint(values->CommandSubType, 27, 28) | 6241 __gen_uint(values->CommandType, 29, 31); 6242 6243 dw[1] = 6244 __gen_uint(values->ConstantBufferSize, 0, 5) | 6245 __gen_uint(values->ConstantBufferOffset, 16, 20); 6246} 6247 6248#define GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_PS_length 2 6249#define GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_PS_length_bias 2 6250#define GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_PS_header\ 6251 .DWordLength = 0, \ 6252 ._3DCommandSubOpcode = 22, \ 6253 ._3DCommandOpcode = 1, \ 6254 .CommandSubType = 3, \ 6255 .CommandType = 3 6256 6257struct GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_PS { 6258 uint32_t DWordLength; 6259 uint32_t _3DCommandSubOpcode; 6260 uint32_t _3DCommandOpcode; 6261 uint32_t CommandSubType; 6262 uint32_t CommandType; 6263 uint32_t ConstantBufferSize; 6264 uint32_t ConstantBufferOffset; 6265}; 6266 6267static inline __attribute__((always_inline)) void 6268GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_PS_pack(__attribute__((unused)) __gen_user_data *data, 6269 __attribute__((unused)) void * restrict dst, 6270 __attribute__((unused)) const struct GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_PS * restrict values) 6271{ 6272 uint32_t * restrict dw = (uint32_t * restrict) dst; 6273 6274 dw[0] = 6275 __gen_uint(values->DWordLength, 0, 7) | 6276 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 6277 __gen_uint(values->_3DCommandOpcode, 24, 26) | 6278 __gen_uint(values->CommandSubType, 27, 28) | 6279 __gen_uint(values->CommandType, 29, 31); 6280 6281 dw[1] = 6282 __gen_uint(values->ConstantBufferSize, 0, 5) | 6283 __gen_uint(values->ConstantBufferOffset, 16, 20); 6284} 6285 6286#define GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_VS_length 2 6287#define GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_VS_length_bias 2 6288#define GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_VS_header\ 6289 .DWordLength = 0, \ 6290 ._3DCommandSubOpcode = 18, \ 6291 ._3DCommandOpcode = 1, \ 6292 .CommandSubType = 3, \ 6293 .CommandType = 3 6294 6295struct GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_VS { 6296 uint32_t DWordLength; 6297 uint32_t _3DCommandSubOpcode; 6298 uint32_t _3DCommandOpcode; 6299 uint32_t CommandSubType; 6300 uint32_t CommandType; 6301 uint32_t ConstantBufferSize; 6302 uint32_t ConstantBufferOffset; 6303}; 6304 6305static inline __attribute__((always_inline)) void 6306GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_VS_pack(__attribute__((unused)) __gen_user_data *data, 6307 __attribute__((unused)) void * restrict dst, 6308 __attribute__((unused)) const struct GFX125_3DSTATE_PUSH_CONSTANT_ALLOC_VS * restrict values) 6309{ 6310 uint32_t * restrict dw = (uint32_t * restrict) dst; 6311 6312 dw[0] = 6313 __gen_uint(values->DWordLength, 0, 7) | 6314 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 6315 __gen_uint(values->_3DCommandOpcode, 24, 26) | 6316 __gen_uint(values->CommandSubType, 27, 28) | 6317 __gen_uint(values->CommandType, 29, 31); 6318 6319 dw[1] = 6320 __gen_uint(values->ConstantBufferSize, 0, 5) | 6321 __gen_uint(values->ConstantBufferOffset, 16, 20); 6322} 6323 6324#define GFX125_3DSTATE_RASTER_length 5 6325#define GFX125_3DSTATE_RASTER_length_bias 2 6326#define GFX125_3DSTATE_RASTER_header \ 6327 .DWordLength = 3, \ 6328 ._3DCommandSubOpcode = 80, \ 6329 ._3DCommandOpcode = 0, \ 6330 .CommandSubType = 3, \ 6331 .CommandType = 3 6332 6333struct GFX125_3DSTATE_RASTER { 6334 uint32_t DWordLength; 6335 uint32_t _3DCommandSubOpcode; 6336 uint32_t _3DCommandOpcode; 6337 uint32_t CommandSubType; 6338 uint32_t CommandType; 6339 bool ViewportZNearClipTestEnable; 6340 bool ScissorRectangleEnable; 6341 bool AntialiasingEnable; 6342 uint32_t BackFaceFillMode; 6343#define FILL_MODE_SOLID 0 6344#define FILL_MODE_WIREFRAME 1 6345#define FILL_MODE_POINT 2 6346 uint32_t FrontFaceFillMode; 6347#define FILL_MODE_SOLID 0 6348#define FILL_MODE_WIREFRAME 1 6349#define FILL_MODE_POINT 2 6350 bool GlobalDepthOffsetEnablePoint; 6351 bool GlobalDepthOffsetEnableWireframe; 6352 bool GlobalDepthOffsetEnableSolid; 6353 uint32_t DXMultisampleRasterizationMode; 6354#define MSRASTMODE_OFF_PIXEL 0 6355#define MSRASTMODE_OFF_PATTERN 1 6356#define MSRASTMODE_ON_PIXEL 2 6357#define MSRASTMODE_ON_PATTERN 3 6358 bool DXMultisampleRasterizationEnable; 6359 bool SmoothPointEnable; 6360 uint32_t ForceMultisampling; 6361 uint32_t CullMode; 6362#define CULLMODE_BOTH 0 6363#define CULLMODE_NONE 1 6364#define CULLMODE_FRONT 2 6365#define CULLMODE_BACK 3 6366 uint32_t ForcedSampleCount; 6367#define FSC_NUMRASTSAMPLES_0 0 6368#define FSC_NUMRASTSAMPLES_1 1 6369#define FSC_NUMRASTSAMPLES_2 2 6370#define FSC_NUMRASTSAMPLES_4 3 6371#define FSC_NUMRASTSAMPLES_8 4 6372#define FSC_NUMRASTSAMPLES_16 5 6373 uint32_t FrontWinding; 6374#define Clockwise 0 6375#define CounterClockwise 1 6376 uint32_t APIMode; 6377#define DX9OGL 0 6378#define DX100 1 6379#define DX101 2 6380 bool ConservativeRasterizationEnable; 6381 bool ViewportZFarClipTestEnable; 6382 float GlobalDepthOffsetConstant; 6383 float GlobalDepthOffsetScale; 6384 float GlobalDepthOffsetClamp; 6385}; 6386 6387static inline __attribute__((always_inline)) void 6388GFX125_3DSTATE_RASTER_pack(__attribute__((unused)) __gen_user_data *data, 6389 __attribute__((unused)) void * restrict dst, 6390 __attribute__((unused)) const struct GFX125_3DSTATE_RASTER * restrict values) 6391{ 6392 uint32_t * restrict dw = (uint32_t * restrict) dst; 6393 6394 dw[0] = 6395 __gen_uint(values->DWordLength, 0, 7) | 6396 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 6397 __gen_uint(values->_3DCommandOpcode, 24, 26) | 6398 __gen_uint(values->CommandSubType, 27, 28) | 6399 __gen_uint(values->CommandType, 29, 31); 6400 6401 dw[1] = 6402 __gen_uint(values->ViewportZNearClipTestEnable, 0, 0) | 6403 __gen_uint(values->ScissorRectangleEnable, 1, 1) | 6404 __gen_uint(values->AntialiasingEnable, 2, 2) | 6405 __gen_uint(values->BackFaceFillMode, 3, 4) | 6406 __gen_uint(values->FrontFaceFillMode, 5, 6) | 6407 __gen_uint(values->GlobalDepthOffsetEnablePoint, 7, 7) | 6408 __gen_uint(values->GlobalDepthOffsetEnableWireframe, 8, 8) | 6409 __gen_uint(values->GlobalDepthOffsetEnableSolid, 9, 9) | 6410 __gen_uint(values->DXMultisampleRasterizationMode, 10, 11) | 6411 __gen_uint(values->DXMultisampleRasterizationEnable, 12, 12) | 6412 __gen_uint(values->SmoothPointEnable, 13, 13) | 6413 __gen_uint(values->ForceMultisampling, 14, 14) | 6414 __gen_uint(values->CullMode, 16, 17) | 6415 __gen_uint(values->ForcedSampleCount, 18, 20) | 6416 __gen_uint(values->FrontWinding, 21, 21) | 6417 __gen_uint(values->APIMode, 22, 23) | 6418 __gen_uint(values->ConservativeRasterizationEnable, 24, 24) | 6419 __gen_uint(values->ViewportZFarClipTestEnable, 26, 26); 6420 6421 dw[2] = 6422 __gen_float(values->GlobalDepthOffsetConstant); 6423 6424 dw[3] = 6425 __gen_float(values->GlobalDepthOffsetScale); 6426 6427 dw[4] = 6428 __gen_float(values->GlobalDepthOffsetClamp); 6429} 6430 6431#define GFX125_3DSTATE_RS_CONSTANT_POINTER_length 4 6432#define GFX125_3DSTATE_RS_CONSTANT_POINTER_length_bias 2 6433#define GFX125_3DSTATE_RS_CONSTANT_POINTER_header\ 6434 .DWordLength = 2, \ 6435 ._3DCommandSubOpcode = 84, \ 6436 ._3DCommandOpcode = 0, \ 6437 .CommandSubType = 3, \ 6438 .CommandType = 3 6439 6440struct GFX125_3DSTATE_RS_CONSTANT_POINTER { 6441 uint32_t DWordLength; 6442 uint32_t _3DCommandSubOpcode; 6443 uint32_t _3DCommandOpcode; 6444 uint32_t CommandSubType; 6445 uint32_t CommandType; 6446 uint32_t OperationLoadorStore; 6447#define RS_Store 0 6448#define RS_Load 1 6449 uint32_t ShaderSelect; 6450#define VS 0 6451#define PS 4 6452 __gen_address_type GlobalConstantBufferAddress; 6453 __gen_address_type GlobalConstantBufferAddressHigh; 6454}; 6455 6456static inline __attribute__((always_inline)) void 6457GFX125_3DSTATE_RS_CONSTANT_POINTER_pack(__attribute__((unused)) __gen_user_data *data, 6458 __attribute__((unused)) void * restrict dst, 6459 __attribute__((unused)) const struct GFX125_3DSTATE_RS_CONSTANT_POINTER * restrict values) 6460{ 6461 uint32_t * restrict dw = (uint32_t * restrict) dst; 6462 6463 dw[0] = 6464 __gen_uint(values->DWordLength, 0, 7) | 6465 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 6466 __gen_uint(values->_3DCommandOpcode, 24, 26) | 6467 __gen_uint(values->CommandSubType, 27, 28) | 6468 __gen_uint(values->CommandType, 29, 31); 6469 6470 dw[1] = 6471 __gen_uint(values->OperationLoadorStore, 12, 12) | 6472 __gen_uint(values->ShaderSelect, 28, 30); 6473 6474 dw[2] = __gen_address(data, &dw[2], values->GlobalConstantBufferAddress, 0, 6, 31); 6475 6476 dw[3] = __gen_address(data, &dw[3], values->GlobalConstantBufferAddressHigh, 0, 0, 31); 6477} 6478 6479#define GFX125_3DSTATE_SAMPLER_PALETTE_LOAD0_length_bias 2 6480#define GFX125_3DSTATE_SAMPLER_PALETTE_LOAD0_header\ 6481 ._3DCommandSubOpcode = 2, \ 6482 ._3DCommandOpcode = 1, \ 6483 .CommandSubType = 3, \ 6484 .CommandType = 3 6485 6486struct GFX125_3DSTATE_SAMPLER_PALETTE_LOAD0 { 6487 uint32_t DWordLength; 6488 uint32_t _3DCommandSubOpcode; 6489 uint32_t _3DCommandOpcode; 6490 uint32_t CommandSubType; 6491 uint32_t CommandType; 6492 /* variable length fields follow */ 6493}; 6494 6495static inline __attribute__((always_inline)) void 6496GFX125_3DSTATE_SAMPLER_PALETTE_LOAD0_pack(__attribute__((unused)) __gen_user_data *data, 6497 __attribute__((unused)) void * restrict dst, 6498 __attribute__((unused)) const struct GFX125_3DSTATE_SAMPLER_PALETTE_LOAD0 * restrict values) 6499{ 6500 uint32_t * restrict dw = (uint32_t * restrict) dst; 6501 6502 dw[0] = 6503 __gen_uint(values->DWordLength, 0, 7) | 6504 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 6505 __gen_uint(values->_3DCommandOpcode, 24, 26) | 6506 __gen_uint(values->CommandSubType, 27, 28) | 6507 __gen_uint(values->CommandType, 29, 31); 6508} 6509 6510#define GFX125_3DSTATE_SAMPLER_PALETTE_LOAD1_length_bias 2 6511#define GFX125_3DSTATE_SAMPLER_PALETTE_LOAD1_header\ 6512 .DWordLength = 0, \ 6513 ._3DCommandSubOpcode = 12, \ 6514 ._3DCommandOpcode = 1, \ 6515 .CommandSubType = 3, \ 6516 .CommandType = 3 6517 6518struct GFX125_3DSTATE_SAMPLER_PALETTE_LOAD1 { 6519 uint32_t DWordLength; 6520 uint32_t _3DCommandSubOpcode; 6521 uint32_t _3DCommandOpcode; 6522 uint32_t CommandSubType; 6523 uint32_t CommandType; 6524 /* variable length fields follow */ 6525}; 6526 6527static inline __attribute__((always_inline)) void 6528GFX125_3DSTATE_SAMPLER_PALETTE_LOAD1_pack(__attribute__((unused)) __gen_user_data *data, 6529 __attribute__((unused)) void * restrict dst, 6530 __attribute__((unused)) const struct GFX125_3DSTATE_SAMPLER_PALETTE_LOAD1 * restrict values) 6531{ 6532 uint32_t * restrict dw = (uint32_t * restrict) dst; 6533 6534 dw[0] = 6535 __gen_uint(values->DWordLength, 0, 7) | 6536 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 6537 __gen_uint(values->_3DCommandOpcode, 24, 26) | 6538 __gen_uint(values->CommandSubType, 27, 28) | 6539 __gen_uint(values->CommandType, 29, 31); 6540} 6541 6542#define GFX125_3DSTATE_SAMPLER_STATE_POINTERS_DS_length 2 6543#define GFX125_3DSTATE_SAMPLER_STATE_POINTERS_DS_length_bias 2 6544#define GFX125_3DSTATE_SAMPLER_STATE_POINTERS_DS_header\ 6545 .DWordLength = 0, \ 6546 ._3DCommandSubOpcode = 45, \ 6547 ._3DCommandOpcode = 0, \ 6548 .CommandSubType = 3, \ 6549 .CommandType = 3 6550 6551struct GFX125_3DSTATE_SAMPLER_STATE_POINTERS_DS { 6552 uint32_t DWordLength; 6553 uint32_t _3DCommandSubOpcode; 6554 uint32_t _3DCommandOpcode; 6555 uint32_t CommandSubType; 6556 uint32_t CommandType; 6557 uint64_t PointertoDSSamplerState; 6558}; 6559 6560static inline __attribute__((always_inline)) void 6561GFX125_3DSTATE_SAMPLER_STATE_POINTERS_DS_pack(__attribute__((unused)) __gen_user_data *data, 6562 __attribute__((unused)) void * restrict dst, 6563 __attribute__((unused)) const struct GFX125_3DSTATE_SAMPLER_STATE_POINTERS_DS * restrict values) 6564{ 6565 uint32_t * restrict dw = (uint32_t * restrict) dst; 6566 6567 dw[0] = 6568 __gen_uint(values->DWordLength, 0, 7) | 6569 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 6570 __gen_uint(values->_3DCommandOpcode, 24, 26) | 6571 __gen_uint(values->CommandSubType, 27, 28) | 6572 __gen_uint(values->CommandType, 29, 31); 6573 6574 dw[1] = 6575 __gen_offset(values->PointertoDSSamplerState, 5, 31); 6576} 6577 6578#define GFX125_3DSTATE_SAMPLER_STATE_POINTERS_GS_length 2 6579#define GFX125_3DSTATE_SAMPLER_STATE_POINTERS_GS_length_bias 2 6580#define GFX125_3DSTATE_SAMPLER_STATE_POINTERS_GS_header\ 6581 .DWordLength = 0, \ 6582 ._3DCommandSubOpcode = 46, \ 6583 ._3DCommandOpcode = 0, \ 6584 .CommandSubType = 3, \ 6585 .CommandType = 3 6586 6587struct GFX125_3DSTATE_SAMPLER_STATE_POINTERS_GS { 6588 uint32_t DWordLength; 6589 uint32_t _3DCommandSubOpcode; 6590 uint32_t _3DCommandOpcode; 6591 uint32_t CommandSubType; 6592 uint32_t CommandType; 6593 uint64_t PointertoGSSamplerState; 6594}; 6595 6596static inline __attribute__((always_inline)) void 6597GFX125_3DSTATE_SAMPLER_STATE_POINTERS_GS_pack(__attribute__((unused)) __gen_user_data *data, 6598 __attribute__((unused)) void * restrict dst, 6599 __attribute__((unused)) const struct GFX125_3DSTATE_SAMPLER_STATE_POINTERS_GS * restrict values) 6600{ 6601 uint32_t * restrict dw = (uint32_t * restrict) dst; 6602 6603 dw[0] = 6604 __gen_uint(values->DWordLength, 0, 7) | 6605 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 6606 __gen_uint(values->_3DCommandOpcode, 24, 26) | 6607 __gen_uint(values->CommandSubType, 27, 28) | 6608 __gen_uint(values->CommandType, 29, 31); 6609 6610 dw[1] = 6611 __gen_offset(values->PointertoGSSamplerState, 5, 31); 6612} 6613 6614#define GFX125_3DSTATE_SAMPLER_STATE_POINTERS_HS_length 2 6615#define GFX125_3DSTATE_SAMPLER_STATE_POINTERS_HS_length_bias 2 6616#define GFX125_3DSTATE_SAMPLER_STATE_POINTERS_HS_header\ 6617 .DWordLength = 0, \ 6618 ._3DCommandSubOpcode = 44, \ 6619 ._3DCommandOpcode = 0, \ 6620 .CommandSubType = 3, \ 6621 .CommandType = 3 6622 6623struct GFX125_3DSTATE_SAMPLER_STATE_POINTERS_HS { 6624 uint32_t DWordLength; 6625 uint32_t _3DCommandSubOpcode; 6626 uint32_t _3DCommandOpcode; 6627 uint32_t CommandSubType; 6628 uint32_t CommandType; 6629 uint64_t PointertoHSSamplerState; 6630}; 6631 6632static inline __attribute__((always_inline)) void 6633GFX125_3DSTATE_SAMPLER_STATE_POINTERS_HS_pack(__attribute__((unused)) __gen_user_data *data, 6634 __attribute__((unused)) void * restrict dst, 6635 __attribute__((unused)) const struct GFX125_3DSTATE_SAMPLER_STATE_POINTERS_HS * restrict values) 6636{ 6637 uint32_t * restrict dw = (uint32_t * restrict) dst; 6638 6639 dw[0] = 6640 __gen_uint(values->DWordLength, 0, 7) | 6641 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 6642 __gen_uint(values->_3DCommandOpcode, 24, 26) | 6643 __gen_uint(values->CommandSubType, 27, 28) | 6644 __gen_uint(values->CommandType, 29, 31); 6645 6646 dw[1] = 6647 __gen_offset(values->PointertoHSSamplerState, 5, 31); 6648} 6649 6650#define GFX125_3DSTATE_SAMPLER_STATE_POINTERS_PS_length 2 6651#define GFX125_3DSTATE_SAMPLER_STATE_POINTERS_PS_length_bias 2 6652#define GFX125_3DSTATE_SAMPLER_STATE_POINTERS_PS_header\ 6653 .DWordLength = 0, \ 6654 ._3DCommandSubOpcode = 47, \ 6655 ._3DCommandOpcode = 0, \ 6656 .CommandSubType = 3, \ 6657 .CommandType = 3 6658 6659struct GFX125_3DSTATE_SAMPLER_STATE_POINTERS_PS { 6660 uint32_t DWordLength; 6661 uint32_t _3DCommandSubOpcode; 6662 uint32_t _3DCommandOpcode; 6663 uint32_t CommandSubType; 6664 uint32_t CommandType; 6665 uint64_t PointertoPSSamplerState; 6666}; 6667 6668static inline __attribute__((always_inline)) void 6669GFX125_3DSTATE_SAMPLER_STATE_POINTERS_PS_pack(__attribute__((unused)) __gen_user_data *data, 6670 __attribute__((unused)) void * restrict dst, 6671 __attribute__((unused)) const struct GFX125_3DSTATE_SAMPLER_STATE_POINTERS_PS * restrict values) 6672{ 6673 uint32_t * restrict dw = (uint32_t * restrict) dst; 6674 6675 dw[0] = 6676 __gen_uint(values->DWordLength, 0, 7) | 6677 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 6678 __gen_uint(values->_3DCommandOpcode, 24, 26) | 6679 __gen_uint(values->CommandSubType, 27, 28) | 6680 __gen_uint(values->CommandType, 29, 31); 6681 6682 dw[1] = 6683 __gen_offset(values->PointertoPSSamplerState, 5, 31); 6684} 6685 6686#define GFX125_3DSTATE_SAMPLER_STATE_POINTERS_VS_length 2 6687#define GFX125_3DSTATE_SAMPLER_STATE_POINTERS_VS_length_bias 2 6688#define GFX125_3DSTATE_SAMPLER_STATE_POINTERS_VS_header\ 6689 .DWordLength = 0, \ 6690 ._3DCommandSubOpcode = 43, \ 6691 ._3DCommandOpcode = 0, \ 6692 .CommandSubType = 3, \ 6693 .CommandType = 3 6694 6695struct GFX125_3DSTATE_SAMPLER_STATE_POINTERS_VS { 6696 uint32_t DWordLength; 6697 uint32_t _3DCommandSubOpcode; 6698 uint32_t _3DCommandOpcode; 6699 uint32_t CommandSubType; 6700 uint32_t CommandType; 6701 uint64_t PointertoVSSamplerState; 6702}; 6703 6704static inline __attribute__((always_inline)) void 6705GFX125_3DSTATE_SAMPLER_STATE_POINTERS_VS_pack(__attribute__((unused)) __gen_user_data *data, 6706 __attribute__((unused)) void * restrict dst, 6707 __attribute__((unused)) const struct GFX125_3DSTATE_SAMPLER_STATE_POINTERS_VS * restrict values) 6708{ 6709 uint32_t * restrict dw = (uint32_t * restrict) dst; 6710 6711 dw[0] = 6712 __gen_uint(values->DWordLength, 0, 7) | 6713 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 6714 __gen_uint(values->_3DCommandOpcode, 24, 26) | 6715 __gen_uint(values->CommandSubType, 27, 28) | 6716 __gen_uint(values->CommandType, 29, 31); 6717 6718 dw[1] = 6719 __gen_offset(values->PointertoVSSamplerState, 5, 31); 6720} 6721 6722#define GFX125_3DSTATE_SAMPLE_MASK_length 2 6723#define GFX125_3DSTATE_SAMPLE_MASK_length_bias 2 6724#define GFX125_3DSTATE_SAMPLE_MASK_header \ 6725 .DWordLength = 0, \ 6726 ._3DCommandSubOpcode = 24, \ 6727 ._3DCommandOpcode = 0, \ 6728 .CommandSubType = 3, \ 6729 .CommandType = 3 6730 6731struct GFX125_3DSTATE_SAMPLE_MASK { 6732 uint32_t DWordLength; 6733 uint32_t _3DCommandSubOpcode; 6734 uint32_t _3DCommandOpcode; 6735 uint32_t CommandSubType; 6736 uint32_t CommandType; 6737 uint32_t SampleMask; 6738}; 6739 6740static inline __attribute__((always_inline)) void 6741GFX125_3DSTATE_SAMPLE_MASK_pack(__attribute__((unused)) __gen_user_data *data, 6742 __attribute__((unused)) void * restrict dst, 6743 __attribute__((unused)) const struct GFX125_3DSTATE_SAMPLE_MASK * restrict values) 6744{ 6745 uint32_t * restrict dw = (uint32_t * restrict) dst; 6746 6747 dw[0] = 6748 __gen_uint(values->DWordLength, 0, 7) | 6749 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 6750 __gen_uint(values->_3DCommandOpcode, 24, 26) | 6751 __gen_uint(values->CommandSubType, 27, 28) | 6752 __gen_uint(values->CommandType, 29, 31); 6753 6754 dw[1] = 6755 __gen_uint(values->SampleMask, 0, 15); 6756} 6757 6758#define GFX125_3DSTATE_SAMPLE_PATTERN_length 9 6759#define GFX125_3DSTATE_SAMPLE_PATTERN_length_bias 2 6760#define GFX125_3DSTATE_SAMPLE_PATTERN_header \ 6761 .DWordLength = 7, \ 6762 ._3DCommandSubOpcode = 28, \ 6763 ._3DCommandOpcode = 1, \ 6764 .CommandSubType = 3, \ 6765 .CommandType = 3 6766 6767struct GFX125_3DSTATE_SAMPLE_PATTERN { 6768 uint32_t DWordLength; 6769 uint32_t _3DCommandSubOpcode; 6770 uint32_t _3DCommandOpcode; 6771 uint32_t CommandSubType; 6772 uint32_t CommandType; 6773 float _16xSample0YOffset; 6774 float _16xSample0XOffset; 6775 float _16xSample1YOffset; 6776 float _16xSample1XOffset; 6777 float _16xSample2YOffset; 6778 float _16xSample2XOffset; 6779 float _16xSample3YOffset; 6780 float _16xSample3XOffset; 6781 float _16xSample4YOffset; 6782 float _16xSample4XOffset; 6783 float _16xSample5YOffset; 6784 float _16xSample5XOffset; 6785 float _16xSample6YOffset; 6786 float _16xSample6XOffset; 6787 float _16xSample7YOffset; 6788 float _16xSample7XOffset; 6789 float _16xSample8YOffset; 6790 float _16xSample8XOffset; 6791 float _16xSample9YOffset; 6792 float _16xSample9XOffset; 6793 float _16xSample10YOffset; 6794 float _16xSample10XOffset; 6795 float _16xSample11YOffset; 6796 float _16xSample11XOffset; 6797 float _16xSample12YOffset; 6798 float _16xSample12XOffset; 6799 float _16xSample13YOffset; 6800 float _16xSample13XOffset; 6801 float _16xSample14YOffset; 6802 float _16xSample14XOffset; 6803 float _16xSample15YOffset; 6804 float _16xSample15XOffset; 6805 float _8xSample4YOffset; 6806 float _8xSample4XOffset; 6807 float _8xSample5YOffset; 6808 float _8xSample5XOffset; 6809 float _8xSample6YOffset; 6810 float _8xSample6XOffset; 6811 float _8xSample7YOffset; 6812 float _8xSample7XOffset; 6813 float _8xSample0YOffset; 6814 float _8xSample0XOffset; 6815 float _8xSample1YOffset; 6816 float _8xSample1XOffset; 6817 float _8xSample2YOffset; 6818 float _8xSample2XOffset; 6819 float _8xSample3YOffset; 6820 float _8xSample3XOffset; 6821 float _4xSample0YOffset; 6822 float _4xSample0XOffset; 6823 float _4xSample1YOffset; 6824 float _4xSample1XOffset; 6825 float _4xSample2YOffset; 6826 float _4xSample2XOffset; 6827 float _4xSample3YOffset; 6828 float _4xSample3XOffset; 6829 float _2xSample0YOffset; 6830 float _2xSample0XOffset; 6831 float _2xSample1YOffset; 6832 float _2xSample1XOffset; 6833 float _1xSample0YOffset; 6834 float _1xSample0XOffset; 6835}; 6836 6837static inline __attribute__((always_inline)) void 6838GFX125_3DSTATE_SAMPLE_PATTERN_pack(__attribute__((unused)) __gen_user_data *data, 6839 __attribute__((unused)) void * restrict dst, 6840 __attribute__((unused)) const struct GFX125_3DSTATE_SAMPLE_PATTERN * restrict values) 6841{ 6842 uint32_t * restrict dw = (uint32_t * restrict) dst; 6843 6844 dw[0] = 6845 __gen_uint(values->DWordLength, 0, 7) | 6846 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 6847 __gen_uint(values->_3DCommandOpcode, 24, 26) | 6848 __gen_uint(values->CommandSubType, 27, 28) | 6849 __gen_uint(values->CommandType, 29, 31); 6850 6851 dw[1] = 6852 __gen_ufixed(values->_16xSample0YOffset, 0, 3, 4) | 6853 __gen_ufixed(values->_16xSample0XOffset, 4, 7, 4) | 6854 __gen_ufixed(values->_16xSample1YOffset, 8, 11, 4) | 6855 __gen_ufixed(values->_16xSample1XOffset, 12, 15, 4) | 6856 __gen_ufixed(values->_16xSample2YOffset, 16, 19, 4) | 6857 __gen_ufixed(values->_16xSample2XOffset, 20, 23, 4) | 6858 __gen_ufixed(values->_16xSample3YOffset, 24, 27, 4) | 6859 __gen_ufixed(values->_16xSample3XOffset, 28, 31, 4); 6860 6861 dw[2] = 6862 __gen_ufixed(values->_16xSample4YOffset, 0, 3, 4) | 6863 __gen_ufixed(values->_16xSample4XOffset, 4, 7, 4) | 6864 __gen_ufixed(values->_16xSample5YOffset, 8, 11, 4) | 6865 __gen_ufixed(values->_16xSample5XOffset, 12, 15, 4) | 6866 __gen_ufixed(values->_16xSample6YOffset, 16, 19, 4) | 6867 __gen_ufixed(values->_16xSample6XOffset, 20, 23, 4) | 6868 __gen_ufixed(values->_16xSample7YOffset, 24, 27, 4) | 6869 __gen_ufixed(values->_16xSample7XOffset, 28, 31, 4); 6870 6871 dw[3] = 6872 __gen_ufixed(values->_16xSample8YOffset, 0, 3, 4) | 6873 __gen_ufixed(values->_16xSample8XOffset, 4, 7, 4) | 6874 __gen_ufixed(values->_16xSample9YOffset, 8, 11, 4) | 6875 __gen_ufixed(values->_16xSample9XOffset, 12, 15, 4) | 6876 __gen_ufixed(values->_16xSample10YOffset, 16, 19, 4) | 6877 __gen_ufixed(values->_16xSample10XOffset, 20, 23, 4) | 6878 __gen_ufixed(values->_16xSample11YOffset, 24, 27, 4) | 6879 __gen_ufixed(values->_16xSample11XOffset, 28, 31, 4); 6880 6881 dw[4] = 6882 __gen_ufixed(values->_16xSample12YOffset, 0, 3, 4) | 6883 __gen_ufixed(values->_16xSample12XOffset, 4, 7, 4) | 6884 __gen_ufixed(values->_16xSample13YOffset, 8, 11, 4) | 6885 __gen_ufixed(values->_16xSample13XOffset, 12, 15, 4) | 6886 __gen_ufixed(values->_16xSample14YOffset, 16, 19, 4) | 6887 __gen_ufixed(values->_16xSample14XOffset, 20, 23, 4) | 6888 __gen_ufixed(values->_16xSample15YOffset, 24, 27, 4) | 6889 __gen_ufixed(values->_16xSample15XOffset, 28, 31, 4); 6890 6891 dw[5] = 6892 __gen_ufixed(values->_8xSample4YOffset, 0, 3, 4) | 6893 __gen_ufixed(values->_8xSample4XOffset, 4, 7, 4) | 6894 __gen_ufixed(values->_8xSample5YOffset, 8, 11, 4) | 6895 __gen_ufixed(values->_8xSample5XOffset, 12, 15, 4) | 6896 __gen_ufixed(values->_8xSample6YOffset, 16, 19, 4) | 6897 __gen_ufixed(values->_8xSample6XOffset, 20, 23, 4) | 6898 __gen_ufixed(values->_8xSample7YOffset, 24, 27, 4) | 6899 __gen_ufixed(values->_8xSample7XOffset, 28, 31, 4); 6900 6901 dw[6] = 6902 __gen_ufixed(values->_8xSample0YOffset, 0, 3, 4) | 6903 __gen_ufixed(values->_8xSample0XOffset, 4, 7, 4) | 6904 __gen_ufixed(values->_8xSample1YOffset, 8, 11, 4) | 6905 __gen_ufixed(values->_8xSample1XOffset, 12, 15, 4) | 6906 __gen_ufixed(values->_8xSample2YOffset, 16, 19, 4) | 6907 __gen_ufixed(values->_8xSample2XOffset, 20, 23, 4) | 6908 __gen_ufixed(values->_8xSample3YOffset, 24, 27, 4) | 6909 __gen_ufixed(values->_8xSample3XOffset, 28, 31, 4); 6910 6911 dw[7] = 6912 __gen_ufixed(values->_4xSample0YOffset, 0, 3, 4) | 6913 __gen_ufixed(values->_4xSample0XOffset, 4, 7, 4) | 6914 __gen_ufixed(values->_4xSample1YOffset, 8, 11, 4) | 6915 __gen_ufixed(values->_4xSample1XOffset, 12, 15, 4) | 6916 __gen_ufixed(values->_4xSample2YOffset, 16, 19, 4) | 6917 __gen_ufixed(values->_4xSample2XOffset, 20, 23, 4) | 6918 __gen_ufixed(values->_4xSample3YOffset, 24, 27, 4) | 6919 __gen_ufixed(values->_4xSample3XOffset, 28, 31, 4); 6920 6921 dw[8] = 6922 __gen_ufixed(values->_2xSample0YOffset, 0, 3, 4) | 6923 __gen_ufixed(values->_2xSample0XOffset, 4, 7, 4) | 6924 __gen_ufixed(values->_2xSample1YOffset, 8, 11, 4) | 6925 __gen_ufixed(values->_2xSample1XOffset, 12, 15, 4) | 6926 __gen_ufixed(values->_1xSample0YOffset, 16, 19, 4) | 6927 __gen_ufixed(values->_1xSample0XOffset, 20, 23, 4); 6928} 6929 6930#define GFX125_3DSTATE_SBE_length 6 6931#define GFX125_3DSTATE_SBE_length_bias 2 6932#define GFX125_3DSTATE_SBE_header \ 6933 .DWordLength = 4, \ 6934 ._3DCommandSubOpcode = 31, \ 6935 ._3DCommandOpcode = 0, \ 6936 .CommandSubType = 3, \ 6937 .CommandType = 3 6938 6939struct GFX125_3DSTATE_SBE { 6940 uint32_t DWordLength; 6941 uint32_t _3DCommandSubOpcode; 6942 uint32_t _3DCommandOpcode; 6943 uint32_t CommandSubType; 6944 uint32_t CommandType; 6945 uint32_t PrimitiveIDOverrideAttributeSelect; 6946 uint32_t VertexURBEntryReadOffset; 6947 uint32_t VertexURBEntryReadLength; 6948 bool PrimitiveIDOverrideComponentX; 6949 bool PrimitiveIDOverrideComponentY; 6950 bool PrimitiveIDOverrideComponentZ; 6951 bool PrimitiveIDOverrideComponentW; 6952 uint32_t PointSpriteTextureCoordinateOrigin; 6953#define UPPERLEFT 0 6954#define LOWERLEFT 1 6955 bool AttributeSwizzleEnable; 6956 uint32_t NumberofSFOutputAttributes; 6957 bool ForceVertexURBEntryReadOffset; 6958 bool ForceVertexURBEntryReadLength; 6959 uint32_t PointSpriteTextureCoordinateEnable; 6960 uint32_t ConstantInterpolationEnable; 6961 uint32_t AttributeActiveComponentFormat[32]; 6962#define ACTIVE_COMPONENT_DISABLED 0 6963#define ACTIVE_COMPONENT_XY 1 6964#define ACTIVE_COMPONENT_XYZ 2 6965#define ACTIVE_COMPONENT_XYZW 3 6966}; 6967 6968static inline __attribute__((always_inline)) void 6969GFX125_3DSTATE_SBE_pack(__attribute__((unused)) __gen_user_data *data, 6970 __attribute__((unused)) void * restrict dst, 6971 __attribute__((unused)) const struct GFX125_3DSTATE_SBE * restrict values) 6972{ 6973 uint32_t * restrict dw = (uint32_t * restrict) dst; 6974 6975 dw[0] = 6976 __gen_uint(values->DWordLength, 0, 7) | 6977 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 6978 __gen_uint(values->_3DCommandOpcode, 24, 26) | 6979 __gen_uint(values->CommandSubType, 27, 28) | 6980 __gen_uint(values->CommandType, 29, 31); 6981 6982 dw[1] = 6983 __gen_uint(values->PrimitiveIDOverrideAttributeSelect, 0, 4) | 6984 __gen_uint(values->VertexURBEntryReadOffset, 5, 10) | 6985 __gen_uint(values->VertexURBEntryReadLength, 11, 15) | 6986 __gen_uint(values->PrimitiveIDOverrideComponentX, 16, 16) | 6987 __gen_uint(values->PrimitiveIDOverrideComponentY, 17, 17) | 6988 __gen_uint(values->PrimitiveIDOverrideComponentZ, 18, 18) | 6989 __gen_uint(values->PrimitiveIDOverrideComponentW, 19, 19) | 6990 __gen_uint(values->PointSpriteTextureCoordinateOrigin, 20, 20) | 6991 __gen_uint(values->AttributeSwizzleEnable, 21, 21) | 6992 __gen_uint(values->NumberofSFOutputAttributes, 22, 27) | 6993 __gen_uint(values->ForceVertexURBEntryReadOffset, 28, 28) | 6994 __gen_uint(values->ForceVertexURBEntryReadLength, 29, 29); 6995 6996 dw[2] = 6997 __gen_uint(values->PointSpriteTextureCoordinateEnable, 0, 31); 6998 6999 dw[3] = 7000 __gen_uint(values->ConstantInterpolationEnable, 0, 31); 7001 7002 dw[4] = 7003 __gen_uint(values->AttributeActiveComponentFormat[0], 0, 1) | 7004 __gen_uint(values->AttributeActiveComponentFormat[1], 2, 3) | 7005 __gen_uint(values->AttributeActiveComponentFormat[2], 4, 5) | 7006 __gen_uint(values->AttributeActiveComponentFormat[3], 6, 7) | 7007 __gen_uint(values->AttributeActiveComponentFormat[4], 8, 9) | 7008 __gen_uint(values->AttributeActiveComponentFormat[5], 10, 11) | 7009 __gen_uint(values->AttributeActiveComponentFormat[6], 12, 13) | 7010 __gen_uint(values->AttributeActiveComponentFormat[7], 14, 15) | 7011 __gen_uint(values->AttributeActiveComponentFormat[8], 16, 17) | 7012 __gen_uint(values->AttributeActiveComponentFormat[9], 18, 19) | 7013 __gen_uint(values->AttributeActiveComponentFormat[10], 20, 21) | 7014 __gen_uint(values->AttributeActiveComponentFormat[11], 22, 23) | 7015 __gen_uint(values->AttributeActiveComponentFormat[12], 24, 25) | 7016 __gen_uint(values->AttributeActiveComponentFormat[13], 26, 27) | 7017 __gen_uint(values->AttributeActiveComponentFormat[14], 28, 29) | 7018 __gen_uint(values->AttributeActiveComponentFormat[15], 30, 31); 7019 7020 dw[5] = 7021 __gen_uint(values->AttributeActiveComponentFormat[16], 0, 1) | 7022 __gen_uint(values->AttributeActiveComponentFormat[17], 2, 3) | 7023 __gen_uint(values->AttributeActiveComponentFormat[18], 4, 5) | 7024 __gen_uint(values->AttributeActiveComponentFormat[19], 6, 7) | 7025 __gen_uint(values->AttributeActiveComponentFormat[20], 8, 9) | 7026 __gen_uint(values->AttributeActiveComponentFormat[21], 10, 11) | 7027 __gen_uint(values->AttributeActiveComponentFormat[22], 12, 13) | 7028 __gen_uint(values->AttributeActiveComponentFormat[23], 14, 15) | 7029 __gen_uint(values->AttributeActiveComponentFormat[24], 16, 17) | 7030 __gen_uint(values->AttributeActiveComponentFormat[25], 18, 19) | 7031 __gen_uint(values->AttributeActiveComponentFormat[26], 20, 21) | 7032 __gen_uint(values->AttributeActiveComponentFormat[27], 22, 23) | 7033 __gen_uint(values->AttributeActiveComponentFormat[28], 24, 25) | 7034 __gen_uint(values->AttributeActiveComponentFormat[29], 26, 27) | 7035 __gen_uint(values->AttributeActiveComponentFormat[30], 28, 29) | 7036 __gen_uint(values->AttributeActiveComponentFormat[31], 30, 31); 7037} 7038 7039#define GFX125_3DSTATE_SBE_SWIZ_length 11 7040#define GFX125_3DSTATE_SBE_SWIZ_length_bias 2 7041#define GFX125_3DSTATE_SBE_SWIZ_header \ 7042 .DWordLength = 9, \ 7043 ._3DCommandSubOpcode = 81, \ 7044 ._3DCommandOpcode = 0, \ 7045 .CommandSubType = 3, \ 7046 .CommandType = 3 7047 7048struct GFX125_3DSTATE_SBE_SWIZ { 7049 uint32_t DWordLength; 7050 uint32_t _3DCommandSubOpcode; 7051 uint32_t _3DCommandOpcode; 7052 uint32_t CommandSubType; 7053 uint32_t CommandType; 7054 struct GFX125_SF_OUTPUT_ATTRIBUTE_DETAIL Attribute[16]; 7055 uint32_t AttributeWrapShortestEnables[16]; 7056}; 7057 7058static inline __attribute__((always_inline)) void 7059GFX125_3DSTATE_SBE_SWIZ_pack(__attribute__((unused)) __gen_user_data *data, 7060 __attribute__((unused)) void * restrict dst, 7061 __attribute__((unused)) const struct GFX125_3DSTATE_SBE_SWIZ * restrict values) 7062{ 7063 uint32_t * restrict dw = (uint32_t * restrict) dst; 7064 7065 dw[0] = 7066 __gen_uint(values->DWordLength, 0, 7) | 7067 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 7068 __gen_uint(values->_3DCommandOpcode, 24, 26) | 7069 __gen_uint(values->CommandSubType, 27, 28) | 7070 __gen_uint(values->CommandType, 29, 31); 7071 7072 uint32_t v1_0; 7073 GFX125_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v1_0, &values->Attribute[0]); 7074 7075 uint32_t v1_1; 7076 GFX125_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v1_1, &values->Attribute[1]); 7077 7078 dw[1] = 7079 __gen_uint(v1_0, 0, 15) | 7080 __gen_uint(v1_1, 16, 31); 7081 7082 uint32_t v2_0; 7083 GFX125_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v2_0, &values->Attribute[2]); 7084 7085 uint32_t v2_1; 7086 GFX125_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v2_1, &values->Attribute[3]); 7087 7088 dw[2] = 7089 __gen_uint(v2_0, 0, 15) | 7090 __gen_uint(v2_1, 16, 31); 7091 7092 uint32_t v3_0; 7093 GFX125_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v3_0, &values->Attribute[4]); 7094 7095 uint32_t v3_1; 7096 GFX125_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v3_1, &values->Attribute[5]); 7097 7098 dw[3] = 7099 __gen_uint(v3_0, 0, 15) | 7100 __gen_uint(v3_1, 16, 31); 7101 7102 uint32_t v4_0; 7103 GFX125_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v4_0, &values->Attribute[6]); 7104 7105 uint32_t v4_1; 7106 GFX125_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v4_1, &values->Attribute[7]); 7107 7108 dw[4] = 7109 __gen_uint(v4_0, 0, 15) | 7110 __gen_uint(v4_1, 16, 31); 7111 7112 uint32_t v5_0; 7113 GFX125_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v5_0, &values->Attribute[8]); 7114 7115 uint32_t v5_1; 7116 GFX125_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v5_1, &values->Attribute[9]); 7117 7118 dw[5] = 7119 __gen_uint(v5_0, 0, 15) | 7120 __gen_uint(v5_1, 16, 31); 7121 7122 uint32_t v6_0; 7123 GFX125_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v6_0, &values->Attribute[10]); 7124 7125 uint32_t v6_1; 7126 GFX125_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v6_1, &values->Attribute[11]); 7127 7128 dw[6] = 7129 __gen_uint(v6_0, 0, 15) | 7130 __gen_uint(v6_1, 16, 31); 7131 7132 uint32_t v7_0; 7133 GFX125_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v7_0, &values->Attribute[12]); 7134 7135 uint32_t v7_1; 7136 GFX125_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v7_1, &values->Attribute[13]); 7137 7138 dw[7] = 7139 __gen_uint(v7_0, 0, 15) | 7140 __gen_uint(v7_1, 16, 31); 7141 7142 uint32_t v8_0; 7143 GFX125_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v8_0, &values->Attribute[14]); 7144 7145 uint32_t v8_1; 7146 GFX125_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v8_1, &values->Attribute[15]); 7147 7148 dw[8] = 7149 __gen_uint(v8_0, 0, 15) | 7150 __gen_uint(v8_1, 16, 31); 7151 7152 dw[9] = 7153 __gen_uint(values->AttributeWrapShortestEnables[0], 0, 3) | 7154 __gen_uint(values->AttributeWrapShortestEnables[1], 4, 7) | 7155 __gen_uint(values->AttributeWrapShortestEnables[2], 8, 11) | 7156 __gen_uint(values->AttributeWrapShortestEnables[3], 12, 15) | 7157 __gen_uint(values->AttributeWrapShortestEnables[4], 16, 19) | 7158 __gen_uint(values->AttributeWrapShortestEnables[5], 20, 23) | 7159 __gen_uint(values->AttributeWrapShortestEnables[6], 24, 27) | 7160 __gen_uint(values->AttributeWrapShortestEnables[7], 28, 31); 7161 7162 dw[10] = 7163 __gen_uint(values->AttributeWrapShortestEnables[8], 0, 3) | 7164 __gen_uint(values->AttributeWrapShortestEnables[9], 4, 7) | 7165 __gen_uint(values->AttributeWrapShortestEnables[10], 8, 11) | 7166 __gen_uint(values->AttributeWrapShortestEnables[11], 12, 15) | 7167 __gen_uint(values->AttributeWrapShortestEnables[12], 16, 19) | 7168 __gen_uint(values->AttributeWrapShortestEnables[13], 20, 23) | 7169 __gen_uint(values->AttributeWrapShortestEnables[14], 24, 27) | 7170 __gen_uint(values->AttributeWrapShortestEnables[15], 28, 31); 7171} 7172 7173#define GFX125_3DSTATE_SCISSOR_STATE_POINTERS_length 2 7174#define GFX125_3DSTATE_SCISSOR_STATE_POINTERS_length_bias 2 7175#define GFX125_3DSTATE_SCISSOR_STATE_POINTERS_header\ 7176 .DWordLength = 0, \ 7177 ._3DCommandSubOpcode = 15, \ 7178 ._3DCommandOpcode = 0, \ 7179 .CommandSubType = 3, \ 7180 .CommandType = 3 7181 7182struct GFX125_3DSTATE_SCISSOR_STATE_POINTERS { 7183 uint32_t DWordLength; 7184 uint32_t _3DCommandSubOpcode; 7185 uint32_t _3DCommandOpcode; 7186 uint32_t CommandSubType; 7187 uint32_t CommandType; 7188 uint64_t ScissorRectPointer; 7189}; 7190 7191static inline __attribute__((always_inline)) void 7192GFX125_3DSTATE_SCISSOR_STATE_POINTERS_pack(__attribute__((unused)) __gen_user_data *data, 7193 __attribute__((unused)) void * restrict dst, 7194 __attribute__((unused)) const struct GFX125_3DSTATE_SCISSOR_STATE_POINTERS * restrict values) 7195{ 7196 uint32_t * restrict dw = (uint32_t * restrict) dst; 7197 7198 dw[0] = 7199 __gen_uint(values->DWordLength, 0, 7) | 7200 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 7201 __gen_uint(values->_3DCommandOpcode, 24, 26) | 7202 __gen_uint(values->CommandSubType, 27, 28) | 7203 __gen_uint(values->CommandType, 29, 31); 7204 7205 dw[1] = 7206 __gen_offset(values->ScissorRectPointer, 5, 31); 7207} 7208 7209#define GFX125_3DSTATE_SF_length 4 7210#define GFX125_3DSTATE_SF_length_bias 2 7211#define GFX125_3DSTATE_SF_header \ 7212 .DWordLength = 2, \ 7213 ._3DCommandSubOpcode = 19, \ 7214 ._3DCommandOpcode = 0, \ 7215 .CommandSubType = 3, \ 7216 .CommandType = 3 7217 7218struct GFX125_3DSTATE_SF { 7219 uint32_t DWordLength; 7220 uint32_t _3DCommandSubOpcode; 7221 uint32_t _3DCommandOpcode; 7222 uint32_t CommandSubType; 7223 uint32_t CommandType; 7224 bool ViewportTransformEnable; 7225 bool StatisticsEnable; 7226 bool LegacyGlobalDepthBiasEnable; 7227 float LineWidth; 7228 uint32_t LineEndCapAntialiasingRegionWidth; 7229#define _05pixels 0 7230#define _10pixels 1 7231#define _20pixels 2 7232#define _40pixels 3 7233 uint32_t DerefBlockSize; 7234#define BlockDerefSize32 0 7235#define PerPolyDerefMode 1 7236#define BlockDerefSize8 2 7237 float PointWidth; 7238 uint32_t PointWidthSource; 7239#define Vertex 0 7240#define State 1 7241 uint32_t VertexSubPixelPrecisionSelect; 7242#define _8Bit 0 7243#define _4Bit 1 7244 bool SmoothPointEnable; 7245 uint32_t AALineDistanceMode; 7246#define AALINEDISTANCE_TRUE 1 7247 uint32_t TriangleFanProvokingVertexSelect; 7248 uint32_t LineStripListProvokingVertexSelect; 7249 uint32_t TriangleStripListProvokingVertexSelect; 7250 bool LastPixelEnable; 7251}; 7252 7253static inline __attribute__((always_inline)) void 7254GFX125_3DSTATE_SF_pack(__attribute__((unused)) __gen_user_data *data, 7255 __attribute__((unused)) void * restrict dst, 7256 __attribute__((unused)) const struct GFX125_3DSTATE_SF * restrict values) 7257{ 7258 uint32_t * restrict dw = (uint32_t * restrict) dst; 7259 7260 dw[0] = 7261 __gen_uint(values->DWordLength, 0, 7) | 7262 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 7263 __gen_uint(values->_3DCommandOpcode, 24, 26) | 7264 __gen_uint(values->CommandSubType, 27, 28) | 7265 __gen_uint(values->CommandType, 29, 31); 7266 7267 dw[1] = 7268 __gen_uint(values->ViewportTransformEnable, 1, 1) | 7269 __gen_uint(values->StatisticsEnable, 10, 10) | 7270 __gen_uint(values->LegacyGlobalDepthBiasEnable, 11, 11) | 7271 __gen_ufixed(values->LineWidth, 12, 29, 7); 7272 7273 dw[2] = 7274 __gen_uint(values->LineEndCapAntialiasingRegionWidth, 16, 17) | 7275 __gen_uint(values->DerefBlockSize, 29, 30); 7276 7277 dw[3] = 7278 __gen_ufixed(values->PointWidth, 0, 10, 3) | 7279 __gen_uint(values->PointWidthSource, 11, 11) | 7280 __gen_uint(values->VertexSubPixelPrecisionSelect, 12, 12) | 7281 __gen_uint(values->SmoothPointEnable, 13, 13) | 7282 __gen_uint(values->AALineDistanceMode, 14, 14) | 7283 __gen_uint(values->TriangleFanProvokingVertexSelect, 25, 26) | 7284 __gen_uint(values->LineStripListProvokingVertexSelect, 27, 28) | 7285 __gen_uint(values->TriangleStripListProvokingVertexSelect, 29, 30) | 7286 __gen_uint(values->LastPixelEnable, 31, 31); 7287} 7288 7289#define GFX125_3DSTATE_SUBSLICE_HASH_TABLE_length 14 7290#define GFX125_3DSTATE_SUBSLICE_HASH_TABLE_length_bias 2 7291#define GFX125_3DSTATE_SUBSLICE_HASH_TABLE_header\ 7292 .DWordLength = 12, \ 7293 ._3DCommandSubOpcode = 31, \ 7294 ._3DCommandOpcode = 1, \ 7295 .CommandSubType = 3, \ 7296 .CommandType = 3 7297 7298struct GFX125_3DSTATE_SUBSLICE_HASH_TABLE { 7299 uint32_t DWordLength; 7300 uint32_t _3DCommandSubOpcode; 7301 uint32_t _3DCommandOpcode; 7302 uint32_t CommandSubType; 7303 uint32_t CommandType; 7304 uint32_t SliceHashControl[8]; 7305#define COMPUTED 0 7306#define UNBALANCED_TABLE_0 1 7307#define TABLE_0 2 7308#define TABLE_1 3 7309 uint32_t SliceTableMode; 7310#define SINGLE_TABLE 0 7311#define DUAL_TABLE 1 7312 uint32_t TwoWayTableEntry[8][16]; 7313 uint32_t ThreeWayTableEntry[8][16]; 7314}; 7315 7316static inline __attribute__((always_inline)) void 7317GFX125_3DSTATE_SUBSLICE_HASH_TABLE_pack(__attribute__((unused)) __gen_user_data *data, 7318 __attribute__((unused)) void * restrict dst, 7319 __attribute__((unused)) const struct GFX125_3DSTATE_SUBSLICE_HASH_TABLE * restrict values) 7320{ 7321 uint32_t * restrict dw = (uint32_t * restrict) dst; 7322 7323 dw[0] = 7324 __gen_uint(values->DWordLength, 0, 7) | 7325 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 7326 __gen_uint(values->_3DCommandOpcode, 24, 26) | 7327 __gen_uint(values->CommandSubType, 27, 28) | 7328 __gen_uint(values->CommandType, 29, 31); 7329 7330 dw[1] = 7331 __gen_uint(values->SliceHashControl[0], 0, 1) | 7332 __gen_uint(values->SliceHashControl[1], 2, 3) | 7333 __gen_uint(values->SliceHashControl[2], 4, 5) | 7334 __gen_uint(values->SliceHashControl[3], 6, 7) | 7335 __gen_uint(values->SliceHashControl[4], 8, 9) | 7336 __gen_uint(values->SliceHashControl[5], 10, 11) | 7337 __gen_uint(values->SliceHashControl[6], 12, 13) | 7338 __gen_uint(values->SliceHashControl[7], 14, 15) | 7339 __gen_uint(values->SliceTableMode, 30, 31); 7340 7341 dw[2] = 7342 __gen_uint(values->TwoWayTableEntry[0][0], 0, 0) | 7343 __gen_uint(values->TwoWayTableEntry[0][1], 1, 1) | 7344 __gen_uint(values->TwoWayTableEntry[0][2], 2, 2) | 7345 __gen_uint(values->TwoWayTableEntry[0][3], 3, 3) | 7346 __gen_uint(values->TwoWayTableEntry[0][4], 4, 4) | 7347 __gen_uint(values->TwoWayTableEntry[0][5], 5, 5) | 7348 __gen_uint(values->TwoWayTableEntry[0][6], 6, 6) | 7349 __gen_uint(values->TwoWayTableEntry[0][7], 7, 7) | 7350 __gen_uint(values->TwoWayTableEntry[0][8], 8, 8) | 7351 __gen_uint(values->TwoWayTableEntry[0][9], 9, 9) | 7352 __gen_uint(values->TwoWayTableEntry[0][10], 10, 10) | 7353 __gen_uint(values->TwoWayTableEntry[0][11], 11, 11) | 7354 __gen_uint(values->TwoWayTableEntry[0][12], 12, 12) | 7355 __gen_uint(values->TwoWayTableEntry[0][13], 13, 13) | 7356 __gen_uint(values->TwoWayTableEntry[0][14], 14, 14) | 7357 __gen_uint(values->TwoWayTableEntry[0][15], 15, 15) | 7358 __gen_uint(values->TwoWayTableEntry[1][0], 16, 16) | 7359 __gen_uint(values->TwoWayTableEntry[1][1], 17, 17) | 7360 __gen_uint(values->TwoWayTableEntry[1][2], 18, 18) | 7361 __gen_uint(values->TwoWayTableEntry[1][3], 19, 19) | 7362 __gen_uint(values->TwoWayTableEntry[1][4], 20, 20) | 7363 __gen_uint(values->TwoWayTableEntry[1][5], 21, 21) | 7364 __gen_uint(values->TwoWayTableEntry[1][6], 22, 22) | 7365 __gen_uint(values->TwoWayTableEntry[1][7], 23, 23) | 7366 __gen_uint(values->TwoWayTableEntry[1][8], 24, 24) | 7367 __gen_uint(values->TwoWayTableEntry[1][9], 25, 25) | 7368 __gen_uint(values->TwoWayTableEntry[1][10], 26, 26) | 7369 __gen_uint(values->TwoWayTableEntry[1][11], 27, 27) | 7370 __gen_uint(values->TwoWayTableEntry[1][12], 28, 28) | 7371 __gen_uint(values->TwoWayTableEntry[1][13], 29, 29) | 7372 __gen_uint(values->TwoWayTableEntry[1][14], 30, 30) | 7373 __gen_uint(values->TwoWayTableEntry[1][15], 31, 31); 7374 7375 dw[3] = 7376 __gen_uint(values->TwoWayTableEntry[2][0], 0, 0) | 7377 __gen_uint(values->TwoWayTableEntry[2][1], 1, 1) | 7378 __gen_uint(values->TwoWayTableEntry[2][2], 2, 2) | 7379 __gen_uint(values->TwoWayTableEntry[2][3], 3, 3) | 7380 __gen_uint(values->TwoWayTableEntry[2][4], 4, 4) | 7381 __gen_uint(values->TwoWayTableEntry[2][5], 5, 5) | 7382 __gen_uint(values->TwoWayTableEntry[2][6], 6, 6) | 7383 __gen_uint(values->TwoWayTableEntry[2][7], 7, 7) | 7384 __gen_uint(values->TwoWayTableEntry[2][8], 8, 8) | 7385 __gen_uint(values->TwoWayTableEntry[2][9], 9, 9) | 7386 __gen_uint(values->TwoWayTableEntry[2][10], 10, 10) | 7387 __gen_uint(values->TwoWayTableEntry[2][11], 11, 11) | 7388 __gen_uint(values->TwoWayTableEntry[2][12], 12, 12) | 7389 __gen_uint(values->TwoWayTableEntry[2][13], 13, 13) | 7390 __gen_uint(values->TwoWayTableEntry[2][14], 14, 14) | 7391 __gen_uint(values->TwoWayTableEntry[2][15], 15, 15) | 7392 __gen_uint(values->TwoWayTableEntry[3][0], 16, 16) | 7393 __gen_uint(values->TwoWayTableEntry[3][1], 17, 17) | 7394 __gen_uint(values->TwoWayTableEntry[3][2], 18, 18) | 7395 __gen_uint(values->TwoWayTableEntry[3][3], 19, 19) | 7396 __gen_uint(values->TwoWayTableEntry[3][4], 20, 20) | 7397 __gen_uint(values->TwoWayTableEntry[3][5], 21, 21) | 7398 __gen_uint(values->TwoWayTableEntry[3][6], 22, 22) | 7399 __gen_uint(values->TwoWayTableEntry[3][7], 23, 23) | 7400 __gen_uint(values->TwoWayTableEntry[3][8], 24, 24) | 7401 __gen_uint(values->TwoWayTableEntry[3][9], 25, 25) | 7402 __gen_uint(values->TwoWayTableEntry[3][10], 26, 26) | 7403 __gen_uint(values->TwoWayTableEntry[3][11], 27, 27) | 7404 __gen_uint(values->TwoWayTableEntry[3][12], 28, 28) | 7405 __gen_uint(values->TwoWayTableEntry[3][13], 29, 29) | 7406 __gen_uint(values->TwoWayTableEntry[3][14], 30, 30) | 7407 __gen_uint(values->TwoWayTableEntry[3][15], 31, 31); 7408 7409 dw[4] = 7410 __gen_uint(values->TwoWayTableEntry[4][0], 0, 0) | 7411 __gen_uint(values->TwoWayTableEntry[4][1], 1, 1) | 7412 __gen_uint(values->TwoWayTableEntry[4][2], 2, 2) | 7413 __gen_uint(values->TwoWayTableEntry[4][3], 3, 3) | 7414 __gen_uint(values->TwoWayTableEntry[4][4], 4, 4) | 7415 __gen_uint(values->TwoWayTableEntry[4][5], 5, 5) | 7416 __gen_uint(values->TwoWayTableEntry[4][6], 6, 6) | 7417 __gen_uint(values->TwoWayTableEntry[4][7], 7, 7) | 7418 __gen_uint(values->TwoWayTableEntry[4][8], 8, 8) | 7419 __gen_uint(values->TwoWayTableEntry[4][9], 9, 9) | 7420 __gen_uint(values->TwoWayTableEntry[4][10], 10, 10) | 7421 __gen_uint(values->TwoWayTableEntry[4][11], 11, 11) | 7422 __gen_uint(values->TwoWayTableEntry[4][12], 12, 12) | 7423 __gen_uint(values->TwoWayTableEntry[4][13], 13, 13) | 7424 __gen_uint(values->TwoWayTableEntry[4][14], 14, 14) | 7425 __gen_uint(values->TwoWayTableEntry[4][15], 15, 15) | 7426 __gen_uint(values->TwoWayTableEntry[5][0], 16, 16) | 7427 __gen_uint(values->TwoWayTableEntry[5][1], 17, 17) | 7428 __gen_uint(values->TwoWayTableEntry[5][2], 18, 18) | 7429 __gen_uint(values->TwoWayTableEntry[5][3], 19, 19) | 7430 __gen_uint(values->TwoWayTableEntry[5][4], 20, 20) | 7431 __gen_uint(values->TwoWayTableEntry[5][5], 21, 21) | 7432 __gen_uint(values->TwoWayTableEntry[5][6], 22, 22) | 7433 __gen_uint(values->TwoWayTableEntry[5][7], 23, 23) | 7434 __gen_uint(values->TwoWayTableEntry[5][8], 24, 24) | 7435 __gen_uint(values->TwoWayTableEntry[5][9], 25, 25) | 7436 __gen_uint(values->TwoWayTableEntry[5][10], 26, 26) | 7437 __gen_uint(values->TwoWayTableEntry[5][11], 27, 27) | 7438 __gen_uint(values->TwoWayTableEntry[5][12], 28, 28) | 7439 __gen_uint(values->TwoWayTableEntry[5][13], 29, 29) | 7440 __gen_uint(values->TwoWayTableEntry[5][14], 30, 30) | 7441 __gen_uint(values->TwoWayTableEntry[5][15], 31, 31); 7442 7443 dw[5] = 7444 __gen_uint(values->TwoWayTableEntry[6][0], 0, 0) | 7445 __gen_uint(values->TwoWayTableEntry[6][1], 1, 1) | 7446 __gen_uint(values->TwoWayTableEntry[6][2], 2, 2) | 7447 __gen_uint(values->TwoWayTableEntry[6][3], 3, 3) | 7448 __gen_uint(values->TwoWayTableEntry[6][4], 4, 4) | 7449 __gen_uint(values->TwoWayTableEntry[6][5], 5, 5) | 7450 __gen_uint(values->TwoWayTableEntry[6][6], 6, 6) | 7451 __gen_uint(values->TwoWayTableEntry[6][7], 7, 7) | 7452 __gen_uint(values->TwoWayTableEntry[6][8], 8, 8) | 7453 __gen_uint(values->TwoWayTableEntry[6][9], 9, 9) | 7454 __gen_uint(values->TwoWayTableEntry[6][10], 10, 10) | 7455 __gen_uint(values->TwoWayTableEntry[6][11], 11, 11) | 7456 __gen_uint(values->TwoWayTableEntry[6][12], 12, 12) | 7457 __gen_uint(values->TwoWayTableEntry[6][13], 13, 13) | 7458 __gen_uint(values->TwoWayTableEntry[6][14], 14, 14) | 7459 __gen_uint(values->TwoWayTableEntry[6][15], 15, 15) | 7460 __gen_uint(values->TwoWayTableEntry[7][0], 16, 16) | 7461 __gen_uint(values->TwoWayTableEntry[7][1], 17, 17) | 7462 __gen_uint(values->TwoWayTableEntry[7][2], 18, 18) | 7463 __gen_uint(values->TwoWayTableEntry[7][3], 19, 19) | 7464 __gen_uint(values->TwoWayTableEntry[7][4], 20, 20) | 7465 __gen_uint(values->TwoWayTableEntry[7][5], 21, 21) | 7466 __gen_uint(values->TwoWayTableEntry[7][6], 22, 22) | 7467 __gen_uint(values->TwoWayTableEntry[7][7], 23, 23) | 7468 __gen_uint(values->TwoWayTableEntry[7][8], 24, 24) | 7469 __gen_uint(values->TwoWayTableEntry[7][9], 25, 25) | 7470 __gen_uint(values->TwoWayTableEntry[7][10], 26, 26) | 7471 __gen_uint(values->TwoWayTableEntry[7][11], 27, 27) | 7472 __gen_uint(values->TwoWayTableEntry[7][12], 28, 28) | 7473 __gen_uint(values->TwoWayTableEntry[7][13], 29, 29) | 7474 __gen_uint(values->TwoWayTableEntry[7][14], 30, 30) | 7475 __gen_uint(values->TwoWayTableEntry[7][15], 31, 31); 7476 7477 dw[6] = 7478 __gen_uint(values->ThreeWayTableEntry[0][0], 0, 1) | 7479 __gen_uint(values->ThreeWayTableEntry[0][1], 2, 3) | 7480 __gen_uint(values->ThreeWayTableEntry[0][2], 4, 5) | 7481 __gen_uint(values->ThreeWayTableEntry[0][3], 6, 7) | 7482 __gen_uint(values->ThreeWayTableEntry[0][4], 8, 9) | 7483 __gen_uint(values->ThreeWayTableEntry[0][5], 10, 11) | 7484 __gen_uint(values->ThreeWayTableEntry[0][6], 12, 13) | 7485 __gen_uint(values->ThreeWayTableEntry[0][7], 14, 15) | 7486 __gen_uint(values->ThreeWayTableEntry[0][8], 16, 17) | 7487 __gen_uint(values->ThreeWayTableEntry[0][9], 18, 19) | 7488 __gen_uint(values->ThreeWayTableEntry[0][10], 20, 21) | 7489 __gen_uint(values->ThreeWayTableEntry[0][11], 22, 23) | 7490 __gen_uint(values->ThreeWayTableEntry[0][12], 24, 25) | 7491 __gen_uint(values->ThreeWayTableEntry[0][13], 26, 27) | 7492 __gen_uint(values->ThreeWayTableEntry[0][14], 28, 29) | 7493 __gen_uint(values->ThreeWayTableEntry[0][15], 30, 31); 7494 7495 dw[7] = 7496 __gen_uint(values->ThreeWayTableEntry[1][0], 0, 1) | 7497 __gen_uint(values->ThreeWayTableEntry[1][1], 2, 3) | 7498 __gen_uint(values->ThreeWayTableEntry[1][2], 4, 5) | 7499 __gen_uint(values->ThreeWayTableEntry[1][3], 6, 7) | 7500 __gen_uint(values->ThreeWayTableEntry[1][4], 8, 9) | 7501 __gen_uint(values->ThreeWayTableEntry[1][5], 10, 11) | 7502 __gen_uint(values->ThreeWayTableEntry[1][6], 12, 13) | 7503 __gen_uint(values->ThreeWayTableEntry[1][7], 14, 15) | 7504 __gen_uint(values->ThreeWayTableEntry[1][8], 16, 17) | 7505 __gen_uint(values->ThreeWayTableEntry[1][9], 18, 19) | 7506 __gen_uint(values->ThreeWayTableEntry[1][10], 20, 21) | 7507 __gen_uint(values->ThreeWayTableEntry[1][11], 22, 23) | 7508 __gen_uint(values->ThreeWayTableEntry[1][12], 24, 25) | 7509 __gen_uint(values->ThreeWayTableEntry[1][13], 26, 27) | 7510 __gen_uint(values->ThreeWayTableEntry[1][14], 28, 29) | 7511 __gen_uint(values->ThreeWayTableEntry[1][15], 30, 31); 7512 7513 dw[8] = 7514 __gen_uint(values->ThreeWayTableEntry[2][0], 0, 1) | 7515 __gen_uint(values->ThreeWayTableEntry[2][1], 2, 3) | 7516 __gen_uint(values->ThreeWayTableEntry[2][2], 4, 5) | 7517 __gen_uint(values->ThreeWayTableEntry[2][3], 6, 7) | 7518 __gen_uint(values->ThreeWayTableEntry[2][4], 8, 9) | 7519 __gen_uint(values->ThreeWayTableEntry[2][5], 10, 11) | 7520 __gen_uint(values->ThreeWayTableEntry[2][6], 12, 13) | 7521 __gen_uint(values->ThreeWayTableEntry[2][7], 14, 15) | 7522 __gen_uint(values->ThreeWayTableEntry[2][8], 16, 17) | 7523 __gen_uint(values->ThreeWayTableEntry[2][9], 18, 19) | 7524 __gen_uint(values->ThreeWayTableEntry[2][10], 20, 21) | 7525 __gen_uint(values->ThreeWayTableEntry[2][11], 22, 23) | 7526 __gen_uint(values->ThreeWayTableEntry[2][12], 24, 25) | 7527 __gen_uint(values->ThreeWayTableEntry[2][13], 26, 27) | 7528 __gen_uint(values->ThreeWayTableEntry[2][14], 28, 29) | 7529 __gen_uint(values->ThreeWayTableEntry[2][15], 30, 31); 7530 7531 dw[9] = 7532 __gen_uint(values->ThreeWayTableEntry[3][0], 0, 1) | 7533 __gen_uint(values->ThreeWayTableEntry[3][1], 2, 3) | 7534 __gen_uint(values->ThreeWayTableEntry[3][2], 4, 5) | 7535 __gen_uint(values->ThreeWayTableEntry[3][3], 6, 7) | 7536 __gen_uint(values->ThreeWayTableEntry[3][4], 8, 9) | 7537 __gen_uint(values->ThreeWayTableEntry[3][5], 10, 11) | 7538 __gen_uint(values->ThreeWayTableEntry[3][6], 12, 13) | 7539 __gen_uint(values->ThreeWayTableEntry[3][7], 14, 15) | 7540 __gen_uint(values->ThreeWayTableEntry[3][8], 16, 17) | 7541 __gen_uint(values->ThreeWayTableEntry[3][9], 18, 19) | 7542 __gen_uint(values->ThreeWayTableEntry[3][10], 20, 21) | 7543 __gen_uint(values->ThreeWayTableEntry[3][11], 22, 23) | 7544 __gen_uint(values->ThreeWayTableEntry[3][12], 24, 25) | 7545 __gen_uint(values->ThreeWayTableEntry[3][13], 26, 27) | 7546 __gen_uint(values->ThreeWayTableEntry[3][14], 28, 29) | 7547 __gen_uint(values->ThreeWayTableEntry[3][15], 30, 31); 7548 7549 dw[10] = 7550 __gen_uint(values->ThreeWayTableEntry[4][0], 0, 1) | 7551 __gen_uint(values->ThreeWayTableEntry[4][1], 2, 3) | 7552 __gen_uint(values->ThreeWayTableEntry[4][2], 4, 5) | 7553 __gen_uint(values->ThreeWayTableEntry[4][3], 6, 7) | 7554 __gen_uint(values->ThreeWayTableEntry[4][4], 8, 9) | 7555 __gen_uint(values->ThreeWayTableEntry[4][5], 10, 11) | 7556 __gen_uint(values->ThreeWayTableEntry[4][6], 12, 13) | 7557 __gen_uint(values->ThreeWayTableEntry[4][7], 14, 15) | 7558 __gen_uint(values->ThreeWayTableEntry[4][8], 16, 17) | 7559 __gen_uint(values->ThreeWayTableEntry[4][9], 18, 19) | 7560 __gen_uint(values->ThreeWayTableEntry[4][10], 20, 21) | 7561 __gen_uint(values->ThreeWayTableEntry[4][11], 22, 23) | 7562 __gen_uint(values->ThreeWayTableEntry[4][12], 24, 25) | 7563 __gen_uint(values->ThreeWayTableEntry[4][13], 26, 27) | 7564 __gen_uint(values->ThreeWayTableEntry[4][14], 28, 29) | 7565 __gen_uint(values->ThreeWayTableEntry[4][15], 30, 31); 7566 7567 dw[11] = 7568 __gen_uint(values->ThreeWayTableEntry[5][0], 0, 1) | 7569 __gen_uint(values->ThreeWayTableEntry[5][1], 2, 3) | 7570 __gen_uint(values->ThreeWayTableEntry[5][2], 4, 5) | 7571 __gen_uint(values->ThreeWayTableEntry[5][3], 6, 7) | 7572 __gen_uint(values->ThreeWayTableEntry[5][4], 8, 9) | 7573 __gen_uint(values->ThreeWayTableEntry[5][5], 10, 11) | 7574 __gen_uint(values->ThreeWayTableEntry[5][6], 12, 13) | 7575 __gen_uint(values->ThreeWayTableEntry[5][7], 14, 15) | 7576 __gen_uint(values->ThreeWayTableEntry[5][8], 16, 17) | 7577 __gen_uint(values->ThreeWayTableEntry[5][9], 18, 19) | 7578 __gen_uint(values->ThreeWayTableEntry[5][10], 20, 21) | 7579 __gen_uint(values->ThreeWayTableEntry[5][11], 22, 23) | 7580 __gen_uint(values->ThreeWayTableEntry[5][12], 24, 25) | 7581 __gen_uint(values->ThreeWayTableEntry[5][13], 26, 27) | 7582 __gen_uint(values->ThreeWayTableEntry[5][14], 28, 29) | 7583 __gen_uint(values->ThreeWayTableEntry[5][15], 30, 31); 7584 7585 dw[12] = 7586 __gen_uint(values->ThreeWayTableEntry[6][0], 0, 1) | 7587 __gen_uint(values->ThreeWayTableEntry[6][1], 2, 3) | 7588 __gen_uint(values->ThreeWayTableEntry[6][2], 4, 5) | 7589 __gen_uint(values->ThreeWayTableEntry[6][3], 6, 7) | 7590 __gen_uint(values->ThreeWayTableEntry[6][4], 8, 9) | 7591 __gen_uint(values->ThreeWayTableEntry[6][5], 10, 11) | 7592 __gen_uint(values->ThreeWayTableEntry[6][6], 12, 13) | 7593 __gen_uint(values->ThreeWayTableEntry[6][7], 14, 15) | 7594 __gen_uint(values->ThreeWayTableEntry[6][8], 16, 17) | 7595 __gen_uint(values->ThreeWayTableEntry[6][9], 18, 19) | 7596 __gen_uint(values->ThreeWayTableEntry[6][10], 20, 21) | 7597 __gen_uint(values->ThreeWayTableEntry[6][11], 22, 23) | 7598 __gen_uint(values->ThreeWayTableEntry[6][12], 24, 25) | 7599 __gen_uint(values->ThreeWayTableEntry[6][13], 26, 27) | 7600 __gen_uint(values->ThreeWayTableEntry[6][14], 28, 29) | 7601 __gen_uint(values->ThreeWayTableEntry[6][15], 30, 31); 7602 7603 dw[13] = 7604 __gen_uint(values->ThreeWayTableEntry[7][0], 0, 1) | 7605 __gen_uint(values->ThreeWayTableEntry[7][1], 2, 3) | 7606 __gen_uint(values->ThreeWayTableEntry[7][2], 4, 5) | 7607 __gen_uint(values->ThreeWayTableEntry[7][3], 6, 7) | 7608 __gen_uint(values->ThreeWayTableEntry[7][4], 8, 9) | 7609 __gen_uint(values->ThreeWayTableEntry[7][5], 10, 11) | 7610 __gen_uint(values->ThreeWayTableEntry[7][6], 12, 13) | 7611 __gen_uint(values->ThreeWayTableEntry[7][7], 14, 15) | 7612 __gen_uint(values->ThreeWayTableEntry[7][8], 16, 17) | 7613 __gen_uint(values->ThreeWayTableEntry[7][9], 18, 19) | 7614 __gen_uint(values->ThreeWayTableEntry[7][10], 20, 21) | 7615 __gen_uint(values->ThreeWayTableEntry[7][11], 22, 23) | 7616 __gen_uint(values->ThreeWayTableEntry[7][12], 24, 25) | 7617 __gen_uint(values->ThreeWayTableEntry[7][13], 26, 27) | 7618 __gen_uint(values->ThreeWayTableEntry[7][14], 28, 29) | 7619 __gen_uint(values->ThreeWayTableEntry[7][15], 30, 31); 7620} 7621 7622#define GFX125_3DSTATE_SLICE_TABLE_STATE_POINTERS_length 2 7623#define GFX125_3DSTATE_SLICE_TABLE_STATE_POINTERS_length_bias 2 7624#define GFX125_3DSTATE_SLICE_TABLE_STATE_POINTERS_header\ 7625 .DWordLength = 0, \ 7626 ._3DCommandSubOpcode = 32, \ 7627 ._3DCommandOpcode = 1, \ 7628 .CommandSubType = 3, \ 7629 .CommandType = 3 7630 7631struct GFX125_3DSTATE_SLICE_TABLE_STATE_POINTERS { 7632 uint32_t DWordLength; 7633 uint32_t _3DCommandSubOpcode; 7634 uint32_t _3DCommandOpcode; 7635 uint32_t CommandSubType; 7636 uint32_t CommandType; 7637 bool SliceHashStatePointerValid; 7638 uint64_t SliceHashTableStatePointer; 7639}; 7640 7641static inline __attribute__((always_inline)) void 7642GFX125_3DSTATE_SLICE_TABLE_STATE_POINTERS_pack(__attribute__((unused)) __gen_user_data *data, 7643 __attribute__((unused)) void * restrict dst, 7644 __attribute__((unused)) const struct GFX125_3DSTATE_SLICE_TABLE_STATE_POINTERS * restrict values) 7645{ 7646 uint32_t * restrict dw = (uint32_t * restrict) dst; 7647 7648 dw[0] = 7649 __gen_uint(values->DWordLength, 0, 7) | 7650 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 7651 __gen_uint(values->_3DCommandOpcode, 24, 26) | 7652 __gen_uint(values->CommandSubType, 27, 28) | 7653 __gen_uint(values->CommandType, 29, 31); 7654 7655 dw[1] = 7656 __gen_uint(values->SliceHashStatePointerValid, 0, 0) | 7657 __gen_offset(values->SliceHashTableStatePointer, 6, 31); 7658} 7659 7660#define GFX125_3DSTATE_SO_BUFFER_length 8 7661#define GFX125_3DSTATE_SO_BUFFER_length_bias 2 7662#define GFX125_3DSTATE_SO_BUFFER_header \ 7663 .DWordLength = 6, \ 7664 ._3DCommandSubOpcode = 24, \ 7665 ._3DCommandOpcode = 1, \ 7666 .CommandSubType = 3, \ 7667 .CommandType = 3 7668 7669struct GFX125_3DSTATE_SO_BUFFER { 7670 uint32_t DWordLength; 7671 uint32_t _3DCommandSubOpcode; 7672 uint32_t _3DCommandOpcode; 7673 uint32_t CommandSubType; 7674 uint32_t CommandType; 7675 bool StreamOutputBufferOffsetAddressEnable; 7676 bool StreamOffsetWriteEnable; 7677 uint32_t MOCS; 7678 uint32_t SOBufferIndex; 7679 bool SOBufferEnable; 7680 __gen_address_type SurfaceBaseAddress; 7681 uint32_t SurfaceSize; 7682 __gen_address_type StreamOutputBufferOffsetAddress; 7683 uint32_t StreamOffset; 7684}; 7685 7686static inline __attribute__((always_inline)) void 7687GFX125_3DSTATE_SO_BUFFER_pack(__attribute__((unused)) __gen_user_data *data, 7688 __attribute__((unused)) void * restrict dst, 7689 __attribute__((unused)) const struct GFX125_3DSTATE_SO_BUFFER * restrict values) 7690{ 7691 uint32_t * restrict dw = (uint32_t * restrict) dst; 7692 7693 dw[0] = 7694 __gen_uint(values->DWordLength, 0, 7) | 7695 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 7696 __gen_uint(values->_3DCommandOpcode, 24, 26) | 7697 __gen_uint(values->CommandSubType, 27, 28) | 7698 __gen_uint(values->CommandType, 29, 31); 7699 7700 dw[1] = 7701 __gen_uint(values->StreamOutputBufferOffsetAddressEnable, 20, 20) | 7702 __gen_uint(values->StreamOffsetWriteEnable, 21, 21) | 7703 __gen_uint(values->MOCS, 22, 28) | 7704 __gen_uint(values->SOBufferIndex, 29, 30) | 7705 __gen_uint(values->SOBufferEnable, 31, 31); 7706 7707 const uint64_t v2_address = 7708 __gen_address(data, &dw[2], values->SurfaceBaseAddress, 0, 2, 47); 7709 dw[2] = v2_address; 7710 dw[3] = v2_address >> 32; 7711 7712 dw[4] = 7713 __gen_uint(values->SurfaceSize, 0, 29); 7714 7715 const uint64_t v5_address = 7716 __gen_address(data, &dw[5], values->StreamOutputBufferOffsetAddress, 0, 2, 47); 7717 dw[5] = v5_address; 7718 dw[6] = v5_address >> 32; 7719 7720 dw[7] = 7721 __gen_uint(values->StreamOffset, 0, 31); 7722} 7723 7724#define GFX125_3DSTATE_SO_BUFFER_INDEX_0_length 8 7725#define GFX125_3DSTATE_SO_BUFFER_INDEX_0_length_bias 2 7726#define GFX125_3DSTATE_SO_BUFFER_INDEX_0_header \ 7727 .DWordLength = 6, \ 7728 ._3DCommandSubOpcode = 96, \ 7729 ._3DCommandOpcode = 0, \ 7730 .CommandSubType = 3, \ 7731 .CommandType = 3 7732 7733struct GFX125_3DSTATE_SO_BUFFER_INDEX_0 { 7734 uint32_t DWordLength; 7735 uint32_t _3DCommandSubOpcode; 7736 uint32_t _3DCommandOpcode; 7737 uint32_t CommandSubType; 7738 uint32_t CommandType; 7739 struct GFX125_3DSTATE_SO_BUFFER_INDEX_BODY SOBufferIndexStateBody; 7740}; 7741 7742static inline __attribute__((always_inline)) void 7743GFX125_3DSTATE_SO_BUFFER_INDEX_0_pack(__attribute__((unused)) __gen_user_data *data, 7744 __attribute__((unused)) void * restrict dst, 7745 __attribute__((unused)) const struct GFX125_3DSTATE_SO_BUFFER_INDEX_0 * restrict values) 7746{ 7747 uint32_t * restrict dw = (uint32_t * restrict) dst; 7748 7749 dw[0] = 7750 __gen_uint(values->DWordLength, 0, 7) | 7751 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 7752 __gen_uint(values->_3DCommandOpcode, 24, 26) | 7753 __gen_uint(values->CommandSubType, 27, 28) | 7754 __gen_uint(values->CommandType, 29, 31); 7755 7756 GFX125_3DSTATE_SO_BUFFER_INDEX_BODY_pack(data, &dw[1], &values->SOBufferIndexStateBody); 7757} 7758 7759#define GFX125_3DSTATE_SO_BUFFER_INDEX_1_length 8 7760#define GFX125_3DSTATE_SO_BUFFER_INDEX_1_length_bias 2 7761#define GFX125_3DSTATE_SO_BUFFER_INDEX_1_header \ 7762 .DWordLength = 6, \ 7763 ._3DCommandSubOpcode = 97, \ 7764 ._3DCommandOpcode = 0, \ 7765 .CommandSubType = 3, \ 7766 .CommandType = 3 7767 7768struct GFX125_3DSTATE_SO_BUFFER_INDEX_1 { 7769 uint32_t DWordLength; 7770 uint32_t _3DCommandSubOpcode; 7771 uint32_t _3DCommandOpcode; 7772 uint32_t CommandSubType; 7773 uint32_t CommandType; 7774 struct GFX125_3DSTATE_SO_BUFFER_INDEX_BODY SOBufferIndexStateBody; 7775}; 7776 7777static inline __attribute__((always_inline)) void 7778GFX125_3DSTATE_SO_BUFFER_INDEX_1_pack(__attribute__((unused)) __gen_user_data *data, 7779 __attribute__((unused)) void * restrict dst, 7780 __attribute__((unused)) const struct GFX125_3DSTATE_SO_BUFFER_INDEX_1 * restrict values) 7781{ 7782 uint32_t * restrict dw = (uint32_t * restrict) dst; 7783 7784 dw[0] = 7785 __gen_uint(values->DWordLength, 0, 7) | 7786 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 7787 __gen_uint(values->_3DCommandOpcode, 24, 26) | 7788 __gen_uint(values->CommandSubType, 27, 28) | 7789 __gen_uint(values->CommandType, 29, 31); 7790 7791 GFX125_3DSTATE_SO_BUFFER_INDEX_BODY_pack(data, &dw[1], &values->SOBufferIndexStateBody); 7792} 7793 7794#define GFX125_3DSTATE_SO_BUFFER_INDEX_2_length 8 7795#define GFX125_3DSTATE_SO_BUFFER_INDEX_2_length_bias 2 7796#define GFX125_3DSTATE_SO_BUFFER_INDEX_2_header \ 7797 .DWordLength = 6, \ 7798 ._3DCommandSubOpcode = 98, \ 7799 ._3DCommandOpcode = 0, \ 7800 .CommandSubType = 3, \ 7801 .CommandType = 3 7802 7803struct GFX125_3DSTATE_SO_BUFFER_INDEX_2 { 7804 uint32_t DWordLength; 7805 uint32_t _3DCommandSubOpcode; 7806 uint32_t _3DCommandOpcode; 7807 uint32_t CommandSubType; 7808 uint32_t CommandType; 7809 struct GFX125_3DSTATE_SO_BUFFER_INDEX_BODY SOBufferIndexStateBody; 7810}; 7811 7812static inline __attribute__((always_inline)) void 7813GFX125_3DSTATE_SO_BUFFER_INDEX_2_pack(__attribute__((unused)) __gen_user_data *data, 7814 __attribute__((unused)) void * restrict dst, 7815 __attribute__((unused)) const struct GFX125_3DSTATE_SO_BUFFER_INDEX_2 * restrict values) 7816{ 7817 uint32_t * restrict dw = (uint32_t * restrict) dst; 7818 7819 dw[0] = 7820 __gen_uint(values->DWordLength, 0, 7) | 7821 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 7822 __gen_uint(values->_3DCommandOpcode, 24, 26) | 7823 __gen_uint(values->CommandSubType, 27, 28) | 7824 __gen_uint(values->CommandType, 29, 31); 7825 7826 GFX125_3DSTATE_SO_BUFFER_INDEX_BODY_pack(data, &dw[1], &values->SOBufferIndexStateBody); 7827} 7828 7829#define GFX125_3DSTATE_SO_BUFFER_INDEX_3_length 8 7830#define GFX125_3DSTATE_SO_BUFFER_INDEX_3_length_bias 2 7831#define GFX125_3DSTATE_SO_BUFFER_INDEX_3_header \ 7832 .DWordLength = 6, \ 7833 ._3DCommandSubOpcode = 99, \ 7834 ._3DCommandOpcode = 0, \ 7835 .CommandSubType = 3, \ 7836 .CommandType = 3 7837 7838struct GFX125_3DSTATE_SO_BUFFER_INDEX_3 { 7839 uint32_t DWordLength; 7840 uint32_t _3DCommandSubOpcode; 7841 uint32_t _3DCommandOpcode; 7842 uint32_t CommandSubType; 7843 uint32_t CommandType; 7844 struct GFX125_3DSTATE_SO_BUFFER_INDEX_BODY SOBufferIndexStateBody; 7845}; 7846 7847static inline __attribute__((always_inline)) void 7848GFX125_3DSTATE_SO_BUFFER_INDEX_3_pack(__attribute__((unused)) __gen_user_data *data, 7849 __attribute__((unused)) void * restrict dst, 7850 __attribute__((unused)) const struct GFX125_3DSTATE_SO_BUFFER_INDEX_3 * restrict values) 7851{ 7852 uint32_t * restrict dw = (uint32_t * restrict) dst; 7853 7854 dw[0] = 7855 __gen_uint(values->DWordLength, 0, 7) | 7856 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 7857 __gen_uint(values->_3DCommandOpcode, 24, 26) | 7858 __gen_uint(values->CommandSubType, 27, 28) | 7859 __gen_uint(values->CommandType, 29, 31); 7860 7861 GFX125_3DSTATE_SO_BUFFER_INDEX_BODY_pack(data, &dw[1], &values->SOBufferIndexStateBody); 7862} 7863 7864#define GFX125_3DSTATE_SO_DECL_LIST_length_bias 2 7865#define GFX125_3DSTATE_SO_DECL_LIST_header \ 7866 ._3DCommandSubOpcode = 23, \ 7867 ._3DCommandOpcode = 1, \ 7868 .CommandSubType = 3, \ 7869 .CommandType = 3 7870 7871struct GFX125_3DSTATE_SO_DECL_LIST { 7872 uint32_t DWordLength; 7873 uint32_t _3DCommandSubOpcode; 7874 uint32_t _3DCommandOpcode; 7875 uint32_t CommandSubType; 7876 uint32_t CommandType; 7877 uint32_t StreamtoBufferSelects0; 7878 uint32_t StreamtoBufferSelects1; 7879 uint32_t StreamtoBufferSelects2; 7880 uint32_t StreamtoBufferSelects3; 7881 uint32_t NumEntries0; 7882 uint32_t NumEntries1; 7883 uint32_t NumEntries2; 7884 uint32_t NumEntries3; 7885 /* variable length fields follow */ 7886}; 7887 7888static inline __attribute__((always_inline)) void 7889GFX125_3DSTATE_SO_DECL_LIST_pack(__attribute__((unused)) __gen_user_data *data, 7890 __attribute__((unused)) void * restrict dst, 7891 __attribute__((unused)) const struct GFX125_3DSTATE_SO_DECL_LIST * restrict values) 7892{ 7893 uint32_t * restrict dw = (uint32_t * restrict) dst; 7894 7895 dw[0] = 7896 __gen_uint(values->DWordLength, 0, 8) | 7897 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 7898 __gen_uint(values->_3DCommandOpcode, 24, 26) | 7899 __gen_uint(values->CommandSubType, 27, 28) | 7900 __gen_uint(values->CommandType, 29, 31); 7901 7902 dw[1] = 7903 __gen_uint(values->StreamtoBufferSelects0, 0, 3) | 7904 __gen_uint(values->StreamtoBufferSelects1, 4, 7) | 7905 __gen_uint(values->StreamtoBufferSelects2, 8, 11) | 7906 __gen_uint(values->StreamtoBufferSelects3, 12, 15); 7907 7908 dw[2] = 7909 __gen_uint(values->NumEntries0, 0, 7) | 7910 __gen_uint(values->NumEntries1, 8, 15) | 7911 __gen_uint(values->NumEntries2, 16, 23) | 7912 __gen_uint(values->NumEntries3, 24, 31); 7913} 7914 7915#define GFX125_3DSTATE_STENCIL_BUFFER_length 8 7916#define GFX125_3DSTATE_STENCIL_BUFFER_length_bias 2 7917#define GFX125_3DSTATE_STENCIL_BUFFER_header \ 7918 .DWordLength = 6, \ 7919 ._3DCommandSubOpcode = 6, \ 7920 ._3DCommandOpcode = 0, \ 7921 .CommandSubType = 3, \ 7922 .CommandType = 3 7923 7924struct GFX125_3DSTATE_STENCIL_BUFFER { 7925 uint32_t DWordLength; 7926 uint32_t _3DCommandSubOpcode; 7927 uint32_t _3DCommandOpcode; 7928 uint32_t CommandSubType; 7929 uint32_t CommandType; 7930 uint32_t SurfacePitch; 7931 bool CornerTexelMode; 7932 bool ControlSurfaceEnable; 7933 bool StencilCompressionEnable; 7934 bool NullPageCoherencyEnable; 7935 bool StencilWriteEnable; 7936 uint32_t SurfaceType; 7937#define SURFTYPE_2D 1 7938#define SURFTYPE_CUBE 3 7939#define SURFTYPE_NULL 7 7940 __gen_address_type SurfaceBaseAddress; 7941 uint32_t Width; 7942 uint32_t Height; 7943 uint32_t MOCS; 7944 uint32_t MinimumArrayElement; 7945 uint32_t Depth; 7946 uint32_t RenderCompressionFormat; 7947 bool CompressionMode; 7948 uint32_t MipTailStartLOD; 7949 uint32_t TiledMode; 7950#define TILE64 1 7951#define TILE4 3 7952 uint32_t SurfaceQPitch; 7953 uint32_t SurfLOD; 7954 uint32_t RenderTargetViewExtent; 7955}; 7956 7957static inline __attribute__((always_inline)) void 7958GFX125_3DSTATE_STENCIL_BUFFER_pack(__attribute__((unused)) __gen_user_data *data, 7959 __attribute__((unused)) void * restrict dst, 7960 __attribute__((unused)) const struct GFX125_3DSTATE_STENCIL_BUFFER * restrict values) 7961{ 7962 uint32_t * restrict dw = (uint32_t * restrict) dst; 7963 7964 dw[0] = 7965 __gen_uint(values->DWordLength, 0, 7) | 7966 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 7967 __gen_uint(values->_3DCommandOpcode, 24, 26) | 7968 __gen_uint(values->CommandSubType, 27, 28) | 7969 __gen_uint(values->CommandType, 29, 31); 7970 7971 dw[1] = 7972 __gen_uint(values->SurfacePitch, 0, 16) | 7973 __gen_uint(values->CornerTexelMode, 23, 23) | 7974 __gen_uint(values->ControlSurfaceEnable, 24, 24) | 7975 __gen_uint(values->StencilCompressionEnable, 25, 25) | 7976 __gen_uint(values->NullPageCoherencyEnable, 27, 27) | 7977 __gen_uint(values->StencilWriteEnable, 28, 28) | 7978 __gen_uint(values->SurfaceType, 29, 31); 7979 7980 const uint64_t v2_address = 7981 __gen_address(data, &dw[2], values->SurfaceBaseAddress, 0, 0, 63); 7982 dw[2] = v2_address; 7983 dw[3] = v2_address >> 32; 7984 7985 dw[4] = 7986 __gen_uint(values->Width, 1, 14) | 7987 __gen_uint(values->Height, 17, 30); 7988 7989 dw[5] = 7990 __gen_uint(values->MOCS, 0, 6) | 7991 __gen_uint(values->MinimumArrayElement, 8, 18) | 7992 __gen_uint(values->Depth, 20, 30); 7993 7994 dw[6] = 7995 __gen_uint(values->RenderCompressionFormat, 0, 4) | 7996 __gen_uint(values->CompressionMode, 5, 5) | 7997 __gen_uint(values->MipTailStartLOD, 26, 29) | 7998 __gen_uint(values->TiledMode, 30, 31); 7999 8000 dw[7] = 8001 __gen_uint(values->SurfaceQPitch, 0, 14) | 8002 __gen_uint(values->SurfLOD, 16, 19) | 8003 __gen_uint(values->RenderTargetViewExtent, 21, 31); 8004} 8005 8006#define GFX125_3DSTATE_STREAMOUT_length 5 8007#define GFX125_3DSTATE_STREAMOUT_length_bias 2 8008#define GFX125_3DSTATE_STREAMOUT_header \ 8009 .DWordLength = 3, \ 8010 ._3DCommandSubOpcode = 30, \ 8011 ._3DCommandOpcode = 0, \ 8012 .CommandSubType = 3, \ 8013 .CommandType = 3 8014 8015struct GFX125_3DSTATE_STREAMOUT { 8016 uint32_t DWordLength; 8017 uint32_t _3DCommandSubOpcode; 8018 uint32_t _3DCommandOpcode; 8019 uint32_t CommandSubType; 8020 uint32_t CommandType; 8021 uint32_t ForceRendering; 8022#define Resreved 1 8023#define Force_Off 2 8024#define Force_on 3 8025 bool SOStatisticsEnable; 8026 uint32_t ReorderMode; 8027#define LEADING 0 8028#define TRAILING 1 8029 uint32_t RenderStreamSelect; 8030 bool RenderingDisable; 8031 bool SOFunctionEnable; 8032 uint32_t Stream0VertexReadLength; 8033 uint32_t Stream0VertexReadOffset; 8034 uint32_t Stream1VertexReadLength; 8035 uint32_t Stream1VertexReadOffset; 8036 uint32_t Stream2VertexReadLength; 8037 uint32_t Stream2VertexReadOffset; 8038 uint32_t Stream3VertexReadLength; 8039 uint32_t Stream3VertexReadOffset; 8040 uint32_t Buffer0SurfacePitch; 8041 uint32_t Buffer1SurfacePitch; 8042 uint32_t Buffer2SurfacePitch; 8043 uint32_t Buffer3SurfacePitch; 8044}; 8045 8046static inline __attribute__((always_inline)) void 8047GFX125_3DSTATE_STREAMOUT_pack(__attribute__((unused)) __gen_user_data *data, 8048 __attribute__((unused)) void * restrict dst, 8049 __attribute__((unused)) const struct GFX125_3DSTATE_STREAMOUT * restrict values) 8050{ 8051 uint32_t * restrict dw = (uint32_t * restrict) dst; 8052 8053 dw[0] = 8054 __gen_uint(values->DWordLength, 0, 7) | 8055 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 8056 __gen_uint(values->_3DCommandOpcode, 24, 26) | 8057 __gen_uint(values->CommandSubType, 27, 28) | 8058 __gen_uint(values->CommandType, 29, 31); 8059 8060 dw[1] = 8061 __gen_uint(values->ForceRendering, 23, 24) | 8062 __gen_uint(values->SOStatisticsEnable, 25, 25) | 8063 __gen_uint(values->ReorderMode, 26, 26) | 8064 __gen_uint(values->RenderStreamSelect, 27, 28) | 8065 __gen_uint(values->RenderingDisable, 30, 30) | 8066 __gen_uint(values->SOFunctionEnable, 31, 31); 8067 8068 dw[2] = 8069 __gen_uint(values->Stream0VertexReadLength, 0, 4) | 8070 __gen_uint(values->Stream0VertexReadOffset, 5, 5) | 8071 __gen_uint(values->Stream1VertexReadLength, 8, 12) | 8072 __gen_uint(values->Stream1VertexReadOffset, 13, 13) | 8073 __gen_uint(values->Stream2VertexReadLength, 16, 20) | 8074 __gen_uint(values->Stream2VertexReadOffset, 21, 21) | 8075 __gen_uint(values->Stream3VertexReadLength, 24, 28) | 8076 __gen_uint(values->Stream3VertexReadOffset, 29, 29); 8077 8078 dw[3] = 8079 __gen_uint(values->Buffer0SurfacePitch, 0, 11) | 8080 __gen_uint(values->Buffer1SurfacePitch, 16, 27); 8081 8082 dw[4] = 8083 __gen_uint(values->Buffer2SurfacePitch, 0, 11) | 8084 __gen_uint(values->Buffer3SurfacePitch, 16, 27); 8085} 8086 8087#define GFX125_3DSTATE_TE_length 4 8088#define GFX125_3DSTATE_TE_length_bias 2 8089#define GFX125_3DSTATE_TE_header \ 8090 .DWordLength = 2, \ 8091 ._3DCommandSubOpcode = 28, \ 8092 ._3DCommandOpcode = 0, \ 8093 .CommandSubType = 3, \ 8094 .CommandType = 3 8095 8096struct GFX125_3DSTATE_TE { 8097 uint32_t DWordLength; 8098 uint32_t _3DCommandSubOpcode; 8099 uint32_t _3DCommandOpcode; 8100 uint32_t CommandSubType; 8101 uint32_t CommandType; 8102 bool TEEnable; 8103 uint32_t TEMode; 8104#define HW_TESS 0 8105 uint32_t TEDomain; 8106#define QUAD 0 8107#define TRI 1 8108#define ISOLINE 2 8109 uint32_t OutputTopology; 8110#define OUTPUT_POINT 0 8111#define OUTPUT_LINE 1 8112#define OUTPUT_TRI_CW 2 8113#define OUTPUT_TRI_CCW 3 8114 uint32_t Partitioning; 8115#define INTEGER 0 8116#define ODD_FRACTIONAL 1 8117#define EVEN_FRACTIONAL 2 8118 float MaximumTessellationFactorOdd; 8119 float MaximumTessellationFactorNotOdd; 8120}; 8121 8122static inline __attribute__((always_inline)) void 8123GFX125_3DSTATE_TE_pack(__attribute__((unused)) __gen_user_data *data, 8124 __attribute__((unused)) void * restrict dst, 8125 __attribute__((unused)) const struct GFX125_3DSTATE_TE * restrict values) 8126{ 8127 uint32_t * restrict dw = (uint32_t * restrict) dst; 8128 8129 dw[0] = 8130 __gen_uint(values->DWordLength, 0, 7) | 8131 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 8132 __gen_uint(values->_3DCommandOpcode, 24, 26) | 8133 __gen_uint(values->CommandSubType, 27, 28) | 8134 __gen_uint(values->CommandType, 29, 31); 8135 8136 dw[1] = 8137 __gen_uint(values->TEEnable, 0, 0) | 8138 __gen_uint(values->TEMode, 1, 2) | 8139 __gen_uint(values->TEDomain, 4, 5) | 8140 __gen_uint(values->OutputTopology, 8, 9) | 8141 __gen_uint(values->Partitioning, 12, 13); 8142 8143 dw[2] = 8144 __gen_float(values->MaximumTessellationFactorOdd); 8145 8146 dw[3] = 8147 __gen_float(values->MaximumTessellationFactorNotOdd); 8148} 8149 8150#define GFX125_3DSTATE_URB_CLEAR_length 2 8151#define GFX125_3DSTATE_URB_CLEAR_length_bias 2 8152#define GFX125_3DSTATE_URB_CLEAR_header \ 8153 .DWordLength = 0, \ 8154 ._3DCommandSubOpcode = 29, \ 8155 ._3DCommandOpcode = 1, \ 8156 .CommandSubType = 3, \ 8157 .CommandType = 3 8158 8159struct GFX125_3DSTATE_URB_CLEAR { 8160 uint32_t DWordLength; 8161 uint32_t _3DCommandSubOpcode; 8162 uint32_t _3DCommandOpcode; 8163 uint32_t CommandSubType; 8164 uint32_t CommandType; 8165 uint64_t URBAddress; 8166 uint32_t URBClearLength; 8167}; 8168 8169static inline __attribute__((always_inline)) void 8170GFX125_3DSTATE_URB_CLEAR_pack(__attribute__((unused)) __gen_user_data *data, 8171 __attribute__((unused)) void * restrict dst, 8172 __attribute__((unused)) const struct GFX125_3DSTATE_URB_CLEAR * restrict values) 8173{ 8174 uint32_t * restrict dw = (uint32_t * restrict) dst; 8175 8176 dw[0] = 8177 __gen_uint(values->DWordLength, 0, 7) | 8178 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 8179 __gen_uint(values->_3DCommandOpcode, 24, 26) | 8180 __gen_uint(values->CommandSubType, 27, 28) | 8181 __gen_uint(values->CommandType, 29, 31); 8182 8183 dw[1] = 8184 __gen_offset(values->URBAddress, 0, 14) | 8185 __gen_uint(values->URBClearLength, 16, 29); 8186} 8187 8188#define GFX125_3DSTATE_URB_DS_length 2 8189#define GFX125_3DSTATE_URB_DS_length_bias 2 8190#define GFX125_3DSTATE_URB_DS_header \ 8191 .DWordLength = 0, \ 8192 ._3DCommandSubOpcode = 50, \ 8193 ._3DCommandOpcode = 0, \ 8194 .CommandSubType = 3, \ 8195 .CommandType = 3 8196 8197struct GFX125_3DSTATE_URB_DS { 8198 uint32_t DWordLength; 8199 uint32_t _3DCommandSubOpcode; 8200 uint32_t _3DCommandOpcode; 8201 uint32_t CommandSubType; 8202 uint32_t CommandType; 8203 uint32_t DSNumberofURBEntries; 8204 uint32_t DSURBEntryAllocationSize; 8205 uint32_t DSURBStartingAddress; 8206}; 8207 8208static inline __attribute__((always_inline)) void 8209GFX125_3DSTATE_URB_DS_pack(__attribute__((unused)) __gen_user_data *data, 8210 __attribute__((unused)) void * restrict dst, 8211 __attribute__((unused)) const struct GFX125_3DSTATE_URB_DS * restrict values) 8212{ 8213 uint32_t * restrict dw = (uint32_t * restrict) dst; 8214 8215 dw[0] = 8216 __gen_uint(values->DWordLength, 0, 7) | 8217 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 8218 __gen_uint(values->_3DCommandOpcode, 24, 26) | 8219 __gen_uint(values->CommandSubType, 27, 28) | 8220 __gen_uint(values->CommandType, 29, 31); 8221 8222 dw[1] = 8223 __gen_uint(values->DSNumberofURBEntries, 0, 15) | 8224 __gen_uint(values->DSURBEntryAllocationSize, 16, 24) | 8225 __gen_uint(values->DSURBStartingAddress, 25, 31); 8226} 8227 8228#define GFX125_3DSTATE_URB_GS_length 2 8229#define GFX125_3DSTATE_URB_GS_length_bias 2 8230#define GFX125_3DSTATE_URB_GS_header \ 8231 .DWordLength = 0, \ 8232 ._3DCommandSubOpcode = 51, \ 8233 ._3DCommandOpcode = 0, \ 8234 .CommandSubType = 3, \ 8235 .CommandType = 3 8236 8237struct GFX125_3DSTATE_URB_GS { 8238 uint32_t DWordLength; 8239 uint32_t _3DCommandSubOpcode; 8240 uint32_t _3DCommandOpcode; 8241 uint32_t CommandSubType; 8242 uint32_t CommandType; 8243 uint32_t GSNumberofURBEntries; 8244 uint32_t GSURBEntryAllocationSize; 8245 uint32_t GSURBStartingAddress; 8246}; 8247 8248static inline __attribute__((always_inline)) void 8249GFX125_3DSTATE_URB_GS_pack(__attribute__((unused)) __gen_user_data *data, 8250 __attribute__((unused)) void * restrict dst, 8251 __attribute__((unused)) const struct GFX125_3DSTATE_URB_GS * restrict values) 8252{ 8253 uint32_t * restrict dw = (uint32_t * restrict) dst; 8254 8255 dw[0] = 8256 __gen_uint(values->DWordLength, 0, 7) | 8257 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 8258 __gen_uint(values->_3DCommandOpcode, 24, 26) | 8259 __gen_uint(values->CommandSubType, 27, 28) | 8260 __gen_uint(values->CommandType, 29, 31); 8261 8262 dw[1] = 8263 __gen_uint(values->GSNumberofURBEntries, 0, 15) | 8264 __gen_uint(values->GSURBEntryAllocationSize, 16, 24) | 8265 __gen_uint(values->GSURBStartingAddress, 25, 31); 8266} 8267 8268#define GFX125_3DSTATE_URB_HS_length 2 8269#define GFX125_3DSTATE_URB_HS_length_bias 2 8270#define GFX125_3DSTATE_URB_HS_header \ 8271 .DWordLength = 0, \ 8272 ._3DCommandSubOpcode = 49, \ 8273 ._3DCommandOpcode = 0, \ 8274 .CommandSubType = 3, \ 8275 .CommandType = 3 8276 8277struct GFX125_3DSTATE_URB_HS { 8278 uint32_t DWordLength; 8279 uint32_t _3DCommandSubOpcode; 8280 uint32_t _3DCommandOpcode; 8281 uint32_t CommandSubType; 8282 uint32_t CommandType; 8283 uint32_t HSNumberofURBEntries; 8284 uint32_t HSURBEntryAllocationSize; 8285 uint32_t HSURBStartingAddress; 8286}; 8287 8288static inline __attribute__((always_inline)) void 8289GFX125_3DSTATE_URB_HS_pack(__attribute__((unused)) __gen_user_data *data, 8290 __attribute__((unused)) void * restrict dst, 8291 __attribute__((unused)) const struct GFX125_3DSTATE_URB_HS * restrict values) 8292{ 8293 uint32_t * restrict dw = (uint32_t * restrict) dst; 8294 8295 dw[0] = 8296 __gen_uint(values->DWordLength, 0, 7) | 8297 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 8298 __gen_uint(values->_3DCommandOpcode, 24, 26) | 8299 __gen_uint(values->CommandSubType, 27, 28) | 8300 __gen_uint(values->CommandType, 29, 31); 8301 8302 dw[1] = 8303 __gen_uint(values->HSNumberofURBEntries, 0, 15) | 8304 __gen_uint(values->HSURBEntryAllocationSize, 16, 24) | 8305 __gen_uint(values->HSURBStartingAddress, 25, 31); 8306} 8307 8308#define GFX125_3DSTATE_URB_VS_length 2 8309#define GFX125_3DSTATE_URB_VS_length_bias 2 8310#define GFX125_3DSTATE_URB_VS_header \ 8311 .DWordLength = 0, \ 8312 ._3DCommandSubOpcode = 48, \ 8313 ._3DCommandOpcode = 0, \ 8314 .CommandSubType = 3, \ 8315 .CommandType = 3 8316 8317struct GFX125_3DSTATE_URB_VS { 8318 uint32_t DWordLength; 8319 uint32_t _3DCommandSubOpcode; 8320 uint32_t _3DCommandOpcode; 8321 uint32_t CommandSubType; 8322 uint32_t CommandType; 8323 uint32_t VSNumberofURBEntries; 8324 uint32_t VSURBEntryAllocationSize; 8325 uint32_t VSURBStartingAddress; 8326}; 8327 8328static inline __attribute__((always_inline)) void 8329GFX125_3DSTATE_URB_VS_pack(__attribute__((unused)) __gen_user_data *data, 8330 __attribute__((unused)) void * restrict dst, 8331 __attribute__((unused)) const struct GFX125_3DSTATE_URB_VS * restrict values) 8332{ 8333 uint32_t * restrict dw = (uint32_t * restrict) dst; 8334 8335 dw[0] = 8336 __gen_uint(values->DWordLength, 0, 7) | 8337 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 8338 __gen_uint(values->_3DCommandOpcode, 24, 26) | 8339 __gen_uint(values->CommandSubType, 27, 28) | 8340 __gen_uint(values->CommandType, 29, 31); 8341 8342 dw[1] = 8343 __gen_uint(values->VSNumberofURBEntries, 0, 15) | 8344 __gen_uint(values->VSURBEntryAllocationSize, 16, 24) | 8345 __gen_uint(values->VSURBStartingAddress, 25, 31); 8346} 8347 8348#define GFX125_3DSTATE_VERTEX_BUFFERS_length_bias 2 8349#define GFX125_3DSTATE_VERTEX_BUFFERS_header \ 8350 .DWordLength = 3, \ 8351 ._3DCommandSubOpcode = 8, \ 8352 ._3DCommandOpcode = 0, \ 8353 .CommandSubType = 3, \ 8354 .CommandType = 3 8355 8356struct GFX125_3DSTATE_VERTEX_BUFFERS { 8357 uint32_t DWordLength; 8358 uint32_t _3DCommandSubOpcode; 8359 uint32_t _3DCommandOpcode; 8360 uint32_t CommandSubType; 8361 uint32_t CommandType; 8362 /* variable length fields follow */ 8363}; 8364 8365static inline __attribute__((always_inline)) void 8366GFX125_3DSTATE_VERTEX_BUFFERS_pack(__attribute__((unused)) __gen_user_data *data, 8367 __attribute__((unused)) void * restrict dst, 8368 __attribute__((unused)) const struct GFX125_3DSTATE_VERTEX_BUFFERS * restrict values) 8369{ 8370 uint32_t * restrict dw = (uint32_t * restrict) dst; 8371 8372 dw[0] = 8373 __gen_uint(values->DWordLength, 0, 7) | 8374 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 8375 __gen_uint(values->_3DCommandOpcode, 24, 26) | 8376 __gen_uint(values->CommandSubType, 27, 28) | 8377 __gen_uint(values->CommandType, 29, 31); 8378} 8379 8380#define GFX125_3DSTATE_VERTEX_ELEMENTS_length_bias 2 8381#define GFX125_3DSTATE_VERTEX_ELEMENTS_header \ 8382 .DWordLength = 1, \ 8383 ._3DCommandSubOpcode = 9, \ 8384 ._3DCommandOpcode = 0, \ 8385 .CommandSubType = 3, \ 8386 .CommandType = 3 8387 8388struct GFX125_3DSTATE_VERTEX_ELEMENTS { 8389 uint32_t DWordLength; 8390 uint32_t _3DCommandSubOpcode; 8391 uint32_t _3DCommandOpcode; 8392 uint32_t CommandSubType; 8393 uint32_t CommandType; 8394 /* variable length fields follow */ 8395}; 8396 8397static inline __attribute__((always_inline)) void 8398GFX125_3DSTATE_VERTEX_ELEMENTS_pack(__attribute__((unused)) __gen_user_data *data, 8399 __attribute__((unused)) void * restrict dst, 8400 __attribute__((unused)) const struct GFX125_3DSTATE_VERTEX_ELEMENTS * restrict values) 8401{ 8402 uint32_t * restrict dw = (uint32_t * restrict) dst; 8403 8404 dw[0] = 8405 __gen_uint(values->DWordLength, 0, 7) | 8406 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 8407 __gen_uint(values->_3DCommandOpcode, 24, 26) | 8408 __gen_uint(values->CommandSubType, 27, 28) | 8409 __gen_uint(values->CommandType, 29, 31); 8410} 8411 8412#define GFX125_3DSTATE_VF_length 2 8413#define GFX125_3DSTATE_VF_length_bias 2 8414#define GFX125_3DSTATE_VF_header \ 8415 .DWordLength = 0, \ 8416 ._3DCommandSubOpcode = 12, \ 8417 ._3DCommandOpcode = 0, \ 8418 .CommandSubType = 3, \ 8419 .CommandType = 3 8420 8421struct GFX125_3DSTATE_VF { 8422 uint32_t DWordLength; 8423 bool IndexedDrawCutIndexEnable; 8424 bool ComponentPackingEnable; 8425 bool SequentialDrawCutIndexEnable; 8426 bool VertexIDOffsetEnable; 8427 uint32_t _3DCommandSubOpcode; 8428 uint32_t _3DCommandOpcode; 8429 uint32_t CommandSubType; 8430 uint32_t CommandType; 8431 uint32_t CutIndex; 8432}; 8433 8434static inline __attribute__((always_inline)) void 8435GFX125_3DSTATE_VF_pack(__attribute__((unused)) __gen_user_data *data, 8436 __attribute__((unused)) void * restrict dst, 8437 __attribute__((unused)) const struct GFX125_3DSTATE_VF * restrict values) 8438{ 8439 uint32_t * restrict dw = (uint32_t * restrict) dst; 8440 8441 dw[0] = 8442 __gen_uint(values->DWordLength, 0, 7) | 8443 __gen_uint(values->IndexedDrawCutIndexEnable, 8, 8) | 8444 __gen_uint(values->ComponentPackingEnable, 9, 9) | 8445 __gen_uint(values->SequentialDrawCutIndexEnable, 10, 10) | 8446 __gen_uint(values->VertexIDOffsetEnable, 11, 11) | 8447 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 8448 __gen_uint(values->_3DCommandOpcode, 24, 26) | 8449 __gen_uint(values->CommandSubType, 27, 28) | 8450 __gen_uint(values->CommandType, 29, 31); 8451 8452 dw[1] = 8453 __gen_uint(values->CutIndex, 0, 31); 8454} 8455 8456#define GFX125_3DSTATE_VF_COMPONENT_PACKING_length 5 8457#define GFX125_3DSTATE_VF_COMPONENT_PACKING_length_bias 2 8458#define GFX125_3DSTATE_VF_COMPONENT_PACKING_header\ 8459 .DWordLength = 3, \ 8460 ._3DCommandSubOpcode = 85, \ 8461 ._3DCommandOpcode = 0, \ 8462 .CommandSubType = 3, \ 8463 .CommandType = 3 8464 8465struct GFX125_3DSTATE_VF_COMPONENT_PACKING { 8466 uint32_t DWordLength; 8467 uint32_t _3DCommandSubOpcode; 8468 uint32_t _3DCommandOpcode; 8469 uint32_t CommandSubType; 8470 uint32_t CommandType; 8471 uint32_t VertexElement00Enables; 8472 uint32_t VertexElement01Enables; 8473 uint32_t VertexElement02Enables; 8474 uint32_t VertexElement03Enables; 8475 uint32_t VertexElement04Enables; 8476 uint32_t VertexElement05Enables; 8477 uint32_t VertexElement06Enables; 8478 uint32_t VertexElement07Enables; 8479 uint32_t VertexElement08Enables; 8480 uint32_t VertexElement09Enables; 8481 uint32_t VertexElement10Enables; 8482 uint32_t VertexElement11Enables; 8483 uint32_t VertexElement12Enables; 8484 uint32_t VertexElement13Enables; 8485 uint32_t VertexElement14Enables; 8486 uint32_t VertexElement15Enables; 8487 uint32_t VertexElement16Enables; 8488 uint32_t VertexElement17Enables; 8489 uint32_t VertexElement18Enables; 8490 uint32_t VertexElement19Enables; 8491 uint32_t VertexElement20Enables; 8492 uint32_t VertexElement21Enables; 8493 uint32_t VertexElement22Enables; 8494 uint32_t VertexElement23Enables; 8495 uint32_t VertexElement24Enables; 8496 uint32_t VertexElement25Enables; 8497 uint32_t VertexElement26Enables; 8498 uint32_t VertexElement27Enables; 8499 uint32_t VertexElement28Enables; 8500 uint32_t VertexElement29Enables; 8501 uint32_t VertexElement30Enables; 8502 uint32_t VertexElement31Enables; 8503}; 8504 8505static inline __attribute__((always_inline)) void 8506GFX125_3DSTATE_VF_COMPONENT_PACKING_pack(__attribute__((unused)) __gen_user_data *data, 8507 __attribute__((unused)) void * restrict dst, 8508 __attribute__((unused)) const struct GFX125_3DSTATE_VF_COMPONENT_PACKING * restrict values) 8509{ 8510 uint32_t * restrict dw = (uint32_t * restrict) dst; 8511 8512 dw[0] = 8513 __gen_uint(values->DWordLength, 0, 7) | 8514 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 8515 __gen_uint(values->_3DCommandOpcode, 24, 26) | 8516 __gen_uint(values->CommandSubType, 27, 28) | 8517 __gen_uint(values->CommandType, 29, 31); 8518 8519 dw[1] = 8520 __gen_uint(values->VertexElement00Enables, 0, 3) | 8521 __gen_uint(values->VertexElement01Enables, 4, 7) | 8522 __gen_uint(values->VertexElement02Enables, 8, 11) | 8523 __gen_uint(values->VertexElement03Enables, 12, 15) | 8524 __gen_uint(values->VertexElement04Enables, 16, 19) | 8525 __gen_uint(values->VertexElement05Enables, 20, 23) | 8526 __gen_uint(values->VertexElement06Enables, 24, 27) | 8527 __gen_uint(values->VertexElement07Enables, 28, 31); 8528 8529 dw[2] = 8530 __gen_uint(values->VertexElement08Enables, 0, 3) | 8531 __gen_uint(values->VertexElement09Enables, 4, 7) | 8532 __gen_uint(values->VertexElement10Enables, 8, 11) | 8533 __gen_uint(values->VertexElement11Enables, 12, 15) | 8534 __gen_uint(values->VertexElement12Enables, 16, 19) | 8535 __gen_uint(values->VertexElement13Enables, 20, 23) | 8536 __gen_uint(values->VertexElement14Enables, 24, 27) | 8537 __gen_uint(values->VertexElement15Enables, 28, 31); 8538 8539 dw[3] = 8540 __gen_uint(values->VertexElement16Enables, 0, 3) | 8541 __gen_uint(values->VertexElement17Enables, 4, 7) | 8542 __gen_uint(values->VertexElement18Enables, 8, 11) | 8543 __gen_uint(values->VertexElement19Enables, 12, 15) | 8544 __gen_uint(values->VertexElement20Enables, 16, 19) | 8545 __gen_uint(values->VertexElement21Enables, 20, 23) | 8546 __gen_uint(values->VertexElement22Enables, 24, 27) | 8547 __gen_uint(values->VertexElement23Enables, 28, 31); 8548 8549 dw[4] = 8550 __gen_uint(values->VertexElement24Enables, 0, 3) | 8551 __gen_uint(values->VertexElement25Enables, 4, 7) | 8552 __gen_uint(values->VertexElement26Enables, 8, 11) | 8553 __gen_uint(values->VertexElement27Enables, 12, 15) | 8554 __gen_uint(values->VertexElement28Enables, 16, 19) | 8555 __gen_uint(values->VertexElement29Enables, 20, 23) | 8556 __gen_uint(values->VertexElement30Enables, 24, 27) | 8557 __gen_uint(values->VertexElement31Enables, 28, 31); 8558} 8559 8560#define GFX125_3DSTATE_VF_INSTANCING_length 3 8561#define GFX125_3DSTATE_VF_INSTANCING_length_bias 2 8562#define GFX125_3DSTATE_VF_INSTANCING_header \ 8563 .DWordLength = 1, \ 8564 ._3DCommandSubOpcode = 73, \ 8565 ._3DCommandOpcode = 0, \ 8566 .CommandSubType = 3, \ 8567 .CommandType = 3 8568 8569struct GFX125_3DSTATE_VF_INSTANCING { 8570 uint32_t DWordLength; 8571 uint32_t _3DCommandSubOpcode; 8572 uint32_t _3DCommandOpcode; 8573 uint32_t CommandSubType; 8574 uint32_t CommandType; 8575 uint32_t VertexElementIndex; 8576 bool InstancingEnable; 8577 uint32_t InstanceDataStepRate; 8578}; 8579 8580static inline __attribute__((always_inline)) void 8581GFX125_3DSTATE_VF_INSTANCING_pack(__attribute__((unused)) __gen_user_data *data, 8582 __attribute__((unused)) void * restrict dst, 8583 __attribute__((unused)) const struct GFX125_3DSTATE_VF_INSTANCING * restrict values) 8584{ 8585 uint32_t * restrict dw = (uint32_t * restrict) dst; 8586 8587 dw[0] = 8588 __gen_uint(values->DWordLength, 0, 7) | 8589 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 8590 __gen_uint(values->_3DCommandOpcode, 24, 26) | 8591 __gen_uint(values->CommandSubType, 27, 28) | 8592 __gen_uint(values->CommandType, 29, 31); 8593 8594 dw[1] = 8595 __gen_uint(values->VertexElementIndex, 0, 5) | 8596 __gen_uint(values->InstancingEnable, 8, 8); 8597 8598 dw[2] = 8599 __gen_uint(values->InstanceDataStepRate, 0, 31); 8600} 8601 8602#define GFX125_3DSTATE_VF_SGVS_length 2 8603#define GFX125_3DSTATE_VF_SGVS_length_bias 2 8604#define GFX125_3DSTATE_VF_SGVS_header \ 8605 .DWordLength = 0, \ 8606 ._3DCommandSubOpcode = 74, \ 8607 ._3DCommandOpcode = 0, \ 8608 .CommandSubType = 3, \ 8609 .CommandType = 3 8610 8611struct GFX125_3DSTATE_VF_SGVS { 8612 uint32_t DWordLength; 8613 uint32_t _3DCommandSubOpcode; 8614 uint32_t _3DCommandOpcode; 8615 uint32_t CommandSubType; 8616 uint32_t CommandType; 8617 uint32_t VertexIDElementOffset; 8618 uint32_t VertexIDComponentNumber; 8619#define COMP_0 0 8620#define COMP_1 1 8621#define COMP_2 2 8622#define COMP_3 3 8623 bool VertexIDEnable; 8624 uint32_t InstanceIDElementOffset; 8625 uint32_t InstanceIDComponentNumber; 8626#define COMP_0 0 8627#define COMP_1 1 8628#define COMP_2 2 8629#define COMP_3 3 8630 bool InstanceIDEnable; 8631}; 8632 8633static inline __attribute__((always_inline)) void 8634GFX125_3DSTATE_VF_SGVS_pack(__attribute__((unused)) __gen_user_data *data, 8635 __attribute__((unused)) void * restrict dst, 8636 __attribute__((unused)) const struct GFX125_3DSTATE_VF_SGVS * restrict values) 8637{ 8638 uint32_t * restrict dw = (uint32_t * restrict) dst; 8639 8640 dw[0] = 8641 __gen_uint(values->DWordLength, 0, 7) | 8642 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 8643 __gen_uint(values->_3DCommandOpcode, 24, 26) | 8644 __gen_uint(values->CommandSubType, 27, 28) | 8645 __gen_uint(values->CommandType, 29, 31); 8646 8647 dw[1] = 8648 __gen_uint(values->VertexIDElementOffset, 0, 5) | 8649 __gen_uint(values->VertexIDComponentNumber, 13, 14) | 8650 __gen_uint(values->VertexIDEnable, 15, 15) | 8651 __gen_uint(values->InstanceIDElementOffset, 16, 21) | 8652 __gen_uint(values->InstanceIDComponentNumber, 29, 30) | 8653 __gen_uint(values->InstanceIDEnable, 31, 31); 8654} 8655 8656#define GFX125_3DSTATE_VF_SGVS_2_length 3 8657#define GFX125_3DSTATE_VF_SGVS_2_length_bias 2 8658#define GFX125_3DSTATE_VF_SGVS_2_header \ 8659 .DWordLength = 1, \ 8660 ._3DCommandSubOpcode = 86, \ 8661 ._3DCommandOpcode = 0, \ 8662 .CommandSubType = 3, \ 8663 .CommandType = 3 8664 8665struct GFX125_3DSTATE_VF_SGVS_2 { 8666 uint32_t DWordLength; 8667 uint32_t _3DCommandSubOpcode; 8668 uint32_t _3DCommandOpcode; 8669 uint32_t CommandSubType; 8670 uint32_t CommandType; 8671 uint32_t XP0ElementOffset; 8672 uint32_t XP0SourceSelect; 8673#define VERTEX_LOCATION 1 8674#define XP0_PARAMETER 0 8675 uint32_t XP0ComponentNumber; 8676#define COMP_0 0 8677#define COMP_1 1 8678#define COMP_2 2 8679#define COMP_3 3 8680 uint32_t XP0Enable; 8681 uint32_t XP1ElementOffset; 8682 uint32_t XP1SourceSelect; 8683#define StartingInstanceLocation 1 8684#define XP1_PARAMETER 0 8685 uint32_t XP1ComponentNumber; 8686#define COMP_0 0 8687#define COMP_1 1 8688#define COMP_2 2 8689#define COMP_3 3 8690 uint32_t XP1Enable; 8691 uint32_t XP2ElementOffset; 8692 uint32_t XP2ComponentNumber; 8693#define COMP_0 0 8694#define COMP_1 1 8695#define COMP_2 2 8696#define COMP_3 3 8697 uint32_t XP2Enable; 8698}; 8699 8700static inline __attribute__((always_inline)) void 8701GFX125_3DSTATE_VF_SGVS_2_pack(__attribute__((unused)) __gen_user_data *data, 8702 __attribute__((unused)) void * restrict dst, 8703 __attribute__((unused)) const struct GFX125_3DSTATE_VF_SGVS_2 * restrict values) 8704{ 8705 uint32_t * restrict dw = (uint32_t * restrict) dst; 8706 8707 dw[0] = 8708 __gen_uint(values->DWordLength, 0, 7) | 8709 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 8710 __gen_uint(values->_3DCommandOpcode, 24, 26) | 8711 __gen_uint(values->CommandSubType, 27, 28) | 8712 __gen_uint(values->CommandType, 29, 31); 8713 8714 dw[1] = 8715 __gen_uint(values->XP0ElementOffset, 0, 5) | 8716 __gen_uint(values->XP0SourceSelect, 12, 12) | 8717 __gen_uint(values->XP0ComponentNumber, 13, 14) | 8718 __gen_uint(values->XP0Enable, 15, 15) | 8719 __gen_uint(values->XP1ElementOffset, 16, 21) | 8720 __gen_uint(values->XP1SourceSelect, 28, 28) | 8721 __gen_uint(values->XP1ComponentNumber, 29, 30) | 8722 __gen_uint(values->XP1Enable, 31, 31); 8723 8724 dw[2] = 8725 __gen_uint(values->XP2ElementOffset, 0, 5) | 8726 __gen_uint(values->XP2ComponentNumber, 13, 14) | 8727 __gen_uint(values->XP2Enable, 15, 15); 8728} 8729 8730#define GFX125_3DSTATE_VF_STATISTICS_length 1 8731#define GFX125_3DSTATE_VF_STATISTICS_length_bias 1 8732#define GFX125_3DSTATE_VF_STATISTICS_header \ 8733 ._3DCommandSubOpcode = 11, \ 8734 ._3DCommandOpcode = 0, \ 8735 .CommandSubType = 1, \ 8736 .CommandType = 3 8737 8738struct GFX125_3DSTATE_VF_STATISTICS { 8739 bool StatisticsEnable; 8740 uint32_t _3DCommandSubOpcode; 8741 uint32_t _3DCommandOpcode; 8742 uint32_t CommandSubType; 8743 uint32_t CommandType; 8744}; 8745 8746static inline __attribute__((always_inline)) void 8747GFX125_3DSTATE_VF_STATISTICS_pack(__attribute__((unused)) __gen_user_data *data, 8748 __attribute__((unused)) void * restrict dst, 8749 __attribute__((unused)) const struct GFX125_3DSTATE_VF_STATISTICS * restrict values) 8750{ 8751 uint32_t * restrict dw = (uint32_t * restrict) dst; 8752 8753 dw[0] = 8754 __gen_uint(values->StatisticsEnable, 0, 0) | 8755 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 8756 __gen_uint(values->_3DCommandOpcode, 24, 26) | 8757 __gen_uint(values->CommandSubType, 27, 28) | 8758 __gen_uint(values->CommandType, 29, 31); 8759} 8760 8761#define GFX125_3DSTATE_VF_TOPOLOGY_length 2 8762#define GFX125_3DSTATE_VF_TOPOLOGY_length_bias 2 8763#define GFX125_3DSTATE_VF_TOPOLOGY_header \ 8764 .DWordLength = 0, \ 8765 ._3DCommandSubOpcode = 75, \ 8766 ._3DCommandOpcode = 0, \ 8767 .CommandSubType = 3, \ 8768 .CommandType = 3 8769 8770struct GFX125_3DSTATE_VF_TOPOLOGY { 8771 uint32_t DWordLength; 8772 uint32_t _3DCommandSubOpcode; 8773 uint32_t _3DCommandOpcode; 8774 uint32_t CommandSubType; 8775 uint32_t CommandType; 8776 enum GFX125_3D_Prim_Topo_Type PrimitiveTopologyType; 8777}; 8778 8779static inline __attribute__((always_inline)) void 8780GFX125_3DSTATE_VF_TOPOLOGY_pack(__attribute__((unused)) __gen_user_data *data, 8781 __attribute__((unused)) void * restrict dst, 8782 __attribute__((unused)) const struct GFX125_3DSTATE_VF_TOPOLOGY * restrict values) 8783{ 8784 uint32_t * restrict dw = (uint32_t * restrict) dst; 8785 8786 dw[0] = 8787 __gen_uint(values->DWordLength, 0, 7) | 8788 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 8789 __gen_uint(values->_3DCommandOpcode, 24, 26) | 8790 __gen_uint(values->CommandSubType, 27, 28) | 8791 __gen_uint(values->CommandType, 29, 31); 8792 8793 dw[1] = 8794 __gen_uint(values->PrimitiveTopologyType, 0, 5); 8795} 8796 8797#define GFX125_3DSTATE_VIEWPORT_STATE_POINTERS_CC_length 2 8798#define GFX125_3DSTATE_VIEWPORT_STATE_POINTERS_CC_length_bias 2 8799#define GFX125_3DSTATE_VIEWPORT_STATE_POINTERS_CC_header\ 8800 .DWordLength = 0, \ 8801 ._3DCommandSubOpcode = 35, \ 8802 ._3DCommandOpcode = 0, \ 8803 .CommandSubType = 3, \ 8804 .CommandType = 3 8805 8806struct GFX125_3DSTATE_VIEWPORT_STATE_POINTERS_CC { 8807 uint32_t DWordLength; 8808 uint32_t _3DCommandSubOpcode; 8809 uint32_t _3DCommandOpcode; 8810 uint32_t CommandSubType; 8811 uint32_t CommandType; 8812 uint64_t CCViewportPointer; 8813}; 8814 8815static inline __attribute__((always_inline)) void 8816GFX125_3DSTATE_VIEWPORT_STATE_POINTERS_CC_pack(__attribute__((unused)) __gen_user_data *data, 8817 __attribute__((unused)) void * restrict dst, 8818 __attribute__((unused)) const struct GFX125_3DSTATE_VIEWPORT_STATE_POINTERS_CC * restrict values) 8819{ 8820 uint32_t * restrict dw = (uint32_t * restrict) dst; 8821 8822 dw[0] = 8823 __gen_uint(values->DWordLength, 0, 7) | 8824 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 8825 __gen_uint(values->_3DCommandOpcode, 24, 26) | 8826 __gen_uint(values->CommandSubType, 27, 28) | 8827 __gen_uint(values->CommandType, 29, 31); 8828 8829 dw[1] = 8830 __gen_offset(values->CCViewportPointer, 5, 31); 8831} 8832 8833#define GFX125_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_length 2 8834#define GFX125_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_length_bias 2 8835#define GFX125_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_header\ 8836 .DWordLength = 0, \ 8837 ._3DCommandSubOpcode = 33, \ 8838 ._3DCommandOpcode = 0, \ 8839 .CommandSubType = 3, \ 8840 .CommandType = 3 8841 8842struct GFX125_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP { 8843 uint32_t DWordLength; 8844 uint32_t _3DCommandSubOpcode; 8845 uint32_t _3DCommandOpcode; 8846 uint32_t CommandSubType; 8847 uint32_t CommandType; 8848 uint64_t SFClipViewportPointer; 8849}; 8850 8851static inline __attribute__((always_inline)) void 8852GFX125_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_pack(__attribute__((unused)) __gen_user_data *data, 8853 __attribute__((unused)) void * restrict dst, 8854 __attribute__((unused)) const struct GFX125_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP * restrict values) 8855{ 8856 uint32_t * restrict dw = (uint32_t * restrict) dst; 8857 8858 dw[0] = 8859 __gen_uint(values->DWordLength, 0, 7) | 8860 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 8861 __gen_uint(values->_3DCommandOpcode, 24, 26) | 8862 __gen_uint(values->CommandSubType, 27, 28) | 8863 __gen_uint(values->CommandType, 29, 31); 8864 8865 dw[1] = 8866 __gen_offset(values->SFClipViewportPointer, 6, 31); 8867} 8868 8869#define GFX125_3DSTATE_VS_length 9 8870#define GFX125_3DSTATE_VS_length_bias 2 8871#define GFX125_3DSTATE_VS_header \ 8872 .DWordLength = 7, \ 8873 ._3DCommandSubOpcode = 16, \ 8874 ._3DCommandOpcode = 0, \ 8875 .CommandSubType = 3, \ 8876 .CommandType = 3 8877 8878struct GFX125_3DSTATE_VS { 8879 uint32_t DWordLength; 8880 uint32_t _3DCommandSubOpcode; 8881 uint32_t _3DCommandOpcode; 8882 uint32_t CommandSubType; 8883 uint32_t CommandType; 8884 uint64_t KernelStartPointer; 8885 bool SoftwareExceptionEnable; 8886 bool AccessesUAV; 8887 bool IllegalOpcodeExceptionEnable; 8888 uint32_t FloatingPointMode; 8889#define IEEE754 0 8890#define Alternate 1 8891 uint32_t ThreadDispatchPriority; 8892#define High 1 8893 uint32_t BindingTableEntryCount; 8894 uint32_t SamplerCount; 8895#define NoSamplers 0 8896#define _14Samplers 1 8897#define _58Samplers 2 8898#define _912Samplers 3 8899#define _1316Samplers 4 8900 bool VectorMaskEnable; 8901 uint32_t ScratchSpaceBuffer; 8902 uint32_t VertexURBEntryReadOffset; 8903 uint32_t VertexURBEntryReadLength; 8904 uint32_t DispatchGRFStartRegisterForURBData; 8905 bool Enable; 8906 bool VertexCacheDisable; 8907 bool SIMD8DispatchEnable; 8908 bool SIMD8SingleInstanceDispatchEnable; 8909 bool StatisticsEnable; 8910 uint32_t MaximumNumberofThreads; 8911 uint32_t UserClipDistanceCullTestEnableBitmask; 8912 uint32_t UserClipDistanceClipTestEnableBitmask; 8913 uint32_t VertexURBEntryOutputLength; 8914 uint32_t VertexURBEntryOutputReadOffset; 8915}; 8916 8917static inline __attribute__((always_inline)) void 8918GFX125_3DSTATE_VS_pack(__attribute__((unused)) __gen_user_data *data, 8919 __attribute__((unused)) void * restrict dst, 8920 __attribute__((unused)) const struct GFX125_3DSTATE_VS * restrict values) 8921{ 8922 uint32_t * restrict dw = (uint32_t * restrict) dst; 8923 8924 dw[0] = 8925 __gen_uint(values->DWordLength, 0, 7) | 8926 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 8927 __gen_uint(values->_3DCommandOpcode, 24, 26) | 8928 __gen_uint(values->CommandSubType, 27, 28) | 8929 __gen_uint(values->CommandType, 29, 31); 8930 8931 const uint64_t v1 = 8932 __gen_offset(values->KernelStartPointer, 6, 63); 8933 dw[1] = v1; 8934 dw[2] = v1 >> 32; 8935 8936 dw[3] = 8937 __gen_uint(values->SoftwareExceptionEnable, 7, 7) | 8938 __gen_uint(values->AccessesUAV, 12, 12) | 8939 __gen_uint(values->IllegalOpcodeExceptionEnable, 13, 13) | 8940 __gen_uint(values->FloatingPointMode, 16, 16) | 8941 __gen_uint(values->ThreadDispatchPriority, 17, 17) | 8942 __gen_uint(values->BindingTableEntryCount, 18, 25) | 8943 __gen_uint(values->SamplerCount, 27, 29) | 8944 __gen_uint(values->VectorMaskEnable, 30, 30); 8945 8946 dw[4] = 8947 __gen_uint(values->ScratchSpaceBuffer, 10, 31); 8948 8949 dw[5] = 0; 8950 8951 dw[6] = 8952 __gen_uint(values->VertexURBEntryReadOffset, 4, 9) | 8953 __gen_uint(values->VertexURBEntryReadLength, 11, 16) | 8954 __gen_uint(values->DispatchGRFStartRegisterForURBData, 20, 24); 8955 8956 dw[7] = 8957 __gen_uint(values->Enable, 0, 0) | 8958 __gen_uint(values->VertexCacheDisable, 1, 1) | 8959 __gen_uint(values->SIMD8DispatchEnable, 2, 2) | 8960 __gen_uint(values->SIMD8SingleInstanceDispatchEnable, 9, 9) | 8961 __gen_uint(values->StatisticsEnable, 10, 10) | 8962 __gen_uint(values->MaximumNumberofThreads, 22, 31); 8963 8964 dw[8] = 8965 __gen_uint(values->UserClipDistanceCullTestEnableBitmask, 0, 7) | 8966 __gen_uint(values->UserClipDistanceClipTestEnableBitmask, 8, 15) | 8967 __gen_uint(values->VertexURBEntryOutputLength, 16, 20) | 8968 __gen_uint(values->VertexURBEntryOutputReadOffset, 21, 26); 8969} 8970 8971#define GFX125_3DSTATE_WM_length 2 8972#define GFX125_3DSTATE_WM_length_bias 2 8973#define GFX125_3DSTATE_WM_header \ 8974 .DWordLength = 0, \ 8975 ._3DCommandSubOpcode = 20, \ 8976 ._3DCommandOpcode = 0, \ 8977 .CommandSubType = 3, \ 8978 .CommandType = 3 8979 8980struct GFX125_3DSTATE_WM { 8981 uint32_t DWordLength; 8982 uint32_t _3DCommandSubOpcode; 8983 uint32_t _3DCommandOpcode; 8984 uint32_t CommandSubType; 8985 uint32_t CommandType; 8986 uint32_t ForceKillPixelEnable; 8987#define ForceOff 1 8988#define ForceON 2 8989 uint32_t PointRasterizationRule; 8990#define RASTRULE_UPPER_LEFT 0 8991#define RASTRULE_UPPER_RIGHT 1 8992 bool LineStippleEnable; 8993 bool PolygonStippleEnable; 8994 uint32_t LineAntialiasingRegionWidth; 8995#define _05pixels 0 8996#define _10pixels 1 8997#define _20pixels 2 8998#define _40pixels 3 8999 uint32_t LineEndCapAntialiasingRegionWidth; 9000#define _05pixels 0 9001#define _10pixels 1 9002#define _20pixels 2 9003#define _40pixels 3 9004 uint32_t BarycentricInterpolationMode; 9005#define BIM_PERSPECTIVE_PIXEL 1 9006#define BIM_PERSPECTIVE_CENTROID 2 9007#define BIM_PERSPECTIVE_SAMPLE 4 9008#define BIM_LINEAR_PIXEL 8 9009#define BIM_LINEAR_CENTROID 16 9010#define BIM_LINEAR_SAMPLE 32 9011 uint32_t PositionZWInterpolationMode; 9012#define INTERP_PIXEL 0 9013#define INTERP_CENTROID 2 9014#define INTERP_SAMPLE 3 9015 uint32_t ForceThreadDispatchEnable; 9016#define ForceOff 1 9017#define ForceON 2 9018 uint32_t EarlyDepthStencilControl; 9019#define EDSC_NORMAL 0 9020#define EDSC_PSEXEC 1 9021#define EDSC_PREPS 2 9022 bool LegacyDiamondLineRasterization; 9023 bool LegacyHierarchicalDepthBufferResolveEnable; 9024 bool LegacyDepthBufferResolveEnable; 9025 bool LegacyDepthBufferClearEnable; 9026 bool StatisticsEnable; 9027}; 9028 9029static inline __attribute__((always_inline)) void 9030GFX125_3DSTATE_WM_pack(__attribute__((unused)) __gen_user_data *data, 9031 __attribute__((unused)) void * restrict dst, 9032 __attribute__((unused)) const struct GFX125_3DSTATE_WM * restrict values) 9033{ 9034 uint32_t * restrict dw = (uint32_t * restrict) dst; 9035 9036 dw[0] = 9037 __gen_uint(values->DWordLength, 0, 7) | 9038 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 9039 __gen_uint(values->_3DCommandOpcode, 24, 26) | 9040 __gen_uint(values->CommandSubType, 27, 28) | 9041 __gen_uint(values->CommandType, 29, 31); 9042 9043 dw[1] = 9044 __gen_uint(values->ForceKillPixelEnable, 0, 1) | 9045 __gen_uint(values->PointRasterizationRule, 2, 2) | 9046 __gen_uint(values->LineStippleEnable, 3, 3) | 9047 __gen_uint(values->PolygonStippleEnable, 4, 4) | 9048 __gen_uint(values->LineAntialiasingRegionWidth, 6, 7) | 9049 __gen_uint(values->LineEndCapAntialiasingRegionWidth, 8, 9) | 9050 __gen_uint(values->BarycentricInterpolationMode, 11, 16) | 9051 __gen_uint(values->PositionZWInterpolationMode, 17, 18) | 9052 __gen_uint(values->ForceThreadDispatchEnable, 19, 20) | 9053 __gen_uint(values->EarlyDepthStencilControl, 21, 22) | 9054 __gen_uint(values->LegacyDiamondLineRasterization, 26, 26) | 9055 __gen_uint(values->LegacyHierarchicalDepthBufferResolveEnable, 27, 27) | 9056 __gen_uint(values->LegacyDepthBufferResolveEnable, 28, 28) | 9057 __gen_uint(values->LegacyDepthBufferClearEnable, 30, 30) | 9058 __gen_uint(values->StatisticsEnable, 31, 31); 9059} 9060 9061#define GFX125_3DSTATE_WM_CHROMAKEY_length 2 9062#define GFX125_3DSTATE_WM_CHROMAKEY_length_bias 2 9063#define GFX125_3DSTATE_WM_CHROMAKEY_header \ 9064 .DWordLength = 0, \ 9065 ._3DCommandSubOpcode = 76, \ 9066 ._3DCommandOpcode = 0, \ 9067 .CommandSubType = 3, \ 9068 .CommandType = 3 9069 9070struct GFX125_3DSTATE_WM_CHROMAKEY { 9071 uint32_t DWordLength; 9072 uint32_t _3DCommandSubOpcode; 9073 uint32_t _3DCommandOpcode; 9074 uint32_t CommandSubType; 9075 uint32_t CommandType; 9076 bool ChromaKeyKillEnable; 9077}; 9078 9079static inline __attribute__((always_inline)) void 9080GFX125_3DSTATE_WM_CHROMAKEY_pack(__attribute__((unused)) __gen_user_data *data, 9081 __attribute__((unused)) void * restrict dst, 9082 __attribute__((unused)) const struct GFX125_3DSTATE_WM_CHROMAKEY * restrict values) 9083{ 9084 uint32_t * restrict dw = (uint32_t * restrict) dst; 9085 9086 dw[0] = 9087 __gen_uint(values->DWordLength, 0, 7) | 9088 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 9089 __gen_uint(values->_3DCommandOpcode, 24, 26) | 9090 __gen_uint(values->CommandSubType, 27, 28) | 9091 __gen_uint(values->CommandType, 29, 31); 9092 9093 dw[1] = 9094 __gen_uint(values->ChromaKeyKillEnable, 31, 31); 9095} 9096 9097#define GFX125_3DSTATE_WM_DEPTH_STENCIL_length 4 9098#define GFX125_3DSTATE_WM_DEPTH_STENCIL_length_bias 2 9099#define GFX125_3DSTATE_WM_DEPTH_STENCIL_header \ 9100 .DWordLength = 2, \ 9101 ._3DCommandSubOpcode = 78, \ 9102 ._3DCommandOpcode = 0, \ 9103 .CommandSubType = 3, \ 9104 .CommandType = 3 9105 9106struct GFX125_3DSTATE_WM_DEPTH_STENCIL { 9107 uint32_t DWordLength; 9108 bool StencilReferenceValueModifyDisable; 9109 bool StencilTestMaskModifyDisable; 9110 bool StencilWriteMaskModifyDisable; 9111 bool StencilStateModifyDisable; 9112 bool DepthStateModifyDisable; 9113 uint32_t _3DCommandSubOpcode; 9114 uint32_t _3DCommandOpcode; 9115 uint32_t CommandSubType; 9116 uint32_t CommandType; 9117 bool DepthBufferWriteEnable; 9118 bool DepthTestEnable; 9119 bool StencilBufferWriteEnable; 9120 bool StencilTestEnable; 9121 bool DoubleSidedStencilEnable; 9122 enum GFX125_3D_Compare_Function DepthTestFunction; 9123 enum GFX125_3D_Compare_Function StencilTestFunction; 9124 enum GFX125_3D_Stencil_Operation BackfaceStencilPassDepthPassOp; 9125 enum GFX125_3D_Stencil_Operation BackfaceStencilPassDepthFailOp; 9126 enum GFX125_3D_Stencil_Operation BackfaceStencilFailOp; 9127 enum GFX125_3D_Compare_Function BackfaceStencilTestFunction; 9128 enum GFX125_3D_Stencil_Operation StencilPassDepthPassOp; 9129 enum GFX125_3D_Stencil_Operation StencilPassDepthFailOp; 9130 enum GFX125_3D_Stencil_Operation StencilFailOp; 9131 uint32_t BackfaceStencilWriteMask; 9132 uint32_t BackfaceStencilTestMask; 9133 uint32_t StencilWriteMask; 9134 uint32_t StencilTestMask; 9135 uint32_t BackfaceStencilReferenceValue; 9136 uint32_t StencilReferenceValue; 9137}; 9138 9139static inline __attribute__((always_inline)) void 9140GFX125_3DSTATE_WM_DEPTH_STENCIL_pack(__attribute__((unused)) __gen_user_data *data, 9141 __attribute__((unused)) void * restrict dst, 9142 __attribute__((unused)) const struct GFX125_3DSTATE_WM_DEPTH_STENCIL * restrict values) 9143{ 9144 uint32_t * restrict dw = (uint32_t * restrict) dst; 9145 9146 dw[0] = 9147 __gen_uint(values->DWordLength, 0, 7) | 9148 __gen_uint(values->StencilReferenceValueModifyDisable, 8, 8) | 9149 __gen_uint(values->StencilTestMaskModifyDisable, 9, 9) | 9150 __gen_uint(values->StencilWriteMaskModifyDisable, 10, 10) | 9151 __gen_uint(values->StencilStateModifyDisable, 11, 11) | 9152 __gen_uint(values->DepthStateModifyDisable, 12, 12) | 9153 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 9154 __gen_uint(values->_3DCommandOpcode, 24, 26) | 9155 __gen_uint(values->CommandSubType, 27, 28) | 9156 __gen_uint(values->CommandType, 29, 31); 9157 9158 dw[1] = 9159 __gen_uint(values->DepthBufferWriteEnable, 0, 0) | 9160 __gen_uint(values->DepthTestEnable, 1, 1) | 9161 __gen_uint(values->StencilBufferWriteEnable, 2, 2) | 9162 __gen_uint(values->StencilTestEnable, 3, 3) | 9163 __gen_uint(values->DoubleSidedStencilEnable, 4, 4) | 9164 __gen_uint(values->DepthTestFunction, 5, 7) | 9165 __gen_uint(values->StencilTestFunction, 8, 10) | 9166 __gen_uint(values->BackfaceStencilPassDepthPassOp, 11, 13) | 9167 __gen_uint(values->BackfaceStencilPassDepthFailOp, 14, 16) | 9168 __gen_uint(values->BackfaceStencilFailOp, 17, 19) | 9169 __gen_uint(values->BackfaceStencilTestFunction, 20, 22) | 9170 __gen_uint(values->StencilPassDepthPassOp, 23, 25) | 9171 __gen_uint(values->StencilPassDepthFailOp, 26, 28) | 9172 __gen_uint(values->StencilFailOp, 29, 31); 9173 9174 dw[2] = 9175 __gen_uint(values->BackfaceStencilWriteMask, 0, 7) | 9176 __gen_uint(values->BackfaceStencilTestMask, 8, 15) | 9177 __gen_uint(values->StencilWriteMask, 16, 23) | 9178 __gen_uint(values->StencilTestMask, 24, 31); 9179 9180 dw[3] = 9181 __gen_uint(values->BackfaceStencilReferenceValue, 0, 7) | 9182 __gen_uint(values->StencilReferenceValue, 8, 15); 9183} 9184 9185#define GFX125_3DSTATE_WM_HZ_OP_length 5 9186#define GFX125_3DSTATE_WM_HZ_OP_length_bias 2 9187#define GFX125_3DSTATE_WM_HZ_OP_header \ 9188 .DWordLength = 3, \ 9189 ._3DCommandSubOpcode = 82, \ 9190 ._3DCommandOpcode = 0, \ 9191 .CommandSubType = 3, \ 9192 .CommandType = 3 9193 9194struct GFX125_3DSTATE_WM_HZ_OP { 9195 uint32_t DWordLength; 9196 uint32_t _3DCommandSubOpcode; 9197 uint32_t _3DCommandOpcode; 9198 uint32_t CommandSubType; 9199 uint32_t CommandType; 9200 uint32_t NumberofMultisamples; 9201 uint32_t StencilClearValue; 9202 bool StencilBufferResolveEnable; 9203 bool FullSurfaceDepthandStencilClear; 9204 bool PixelPositionOffsetEnable; 9205 bool HierarchicalDepthBufferResolveEnable; 9206 bool DepthBufferResolveEnable; 9207 bool ScissorRectangleEnable; 9208 bool DepthBufferClearEnable; 9209 bool StencilBufferClearEnable; 9210 uint32_t ClearRectangleXMin; 9211 uint32_t ClearRectangleYMin; 9212 uint32_t ClearRectangleXMax; 9213 uint32_t ClearRectangleYMax; 9214 uint32_t SampleMask; 9215}; 9216 9217static inline __attribute__((always_inline)) void 9218GFX125_3DSTATE_WM_HZ_OP_pack(__attribute__((unused)) __gen_user_data *data, 9219 __attribute__((unused)) void * restrict dst, 9220 __attribute__((unused)) const struct GFX125_3DSTATE_WM_HZ_OP * restrict values) 9221{ 9222 uint32_t * restrict dw = (uint32_t * restrict) dst; 9223 9224 dw[0] = 9225 __gen_uint(values->DWordLength, 0, 7) | 9226 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 9227 __gen_uint(values->_3DCommandOpcode, 24, 26) | 9228 __gen_uint(values->CommandSubType, 27, 28) | 9229 __gen_uint(values->CommandType, 29, 31); 9230 9231 dw[1] = 9232 __gen_uint(values->NumberofMultisamples, 13, 15) | 9233 __gen_uint(values->StencilClearValue, 16, 23) | 9234 __gen_uint(values->StencilBufferResolveEnable, 24, 24) | 9235 __gen_uint(values->FullSurfaceDepthandStencilClear, 25, 25) | 9236 __gen_uint(values->PixelPositionOffsetEnable, 26, 26) | 9237 __gen_uint(values->HierarchicalDepthBufferResolveEnable, 27, 27) | 9238 __gen_uint(values->DepthBufferResolveEnable, 28, 28) | 9239 __gen_uint(values->ScissorRectangleEnable, 29, 29) | 9240 __gen_uint(values->DepthBufferClearEnable, 30, 30) | 9241 __gen_uint(values->StencilBufferClearEnable, 31, 31); 9242 9243 dw[2] = 9244 __gen_uint(values->ClearRectangleXMin, 0, 15) | 9245 __gen_uint(values->ClearRectangleYMin, 16, 31); 9246 9247 dw[3] = 9248 __gen_uint(values->ClearRectangleXMax, 0, 15) | 9249 __gen_uint(values->ClearRectangleYMax, 16, 31); 9250 9251 dw[4] = 9252 __gen_uint(values->SampleMask, 0, 15); 9253} 9254 9255#define GFX125_CFE_STATE_length 6 9256#define GFX125_CFE_STATE_length_bias 2 9257#define GFX125_CFE_STATE_header \ 9258 .DWordLength = 4, \ 9259 .CFESubOpcodeVariant = 0, \ 9260 .CFESubOpcode = 0, \ 9261 .ComputeCommandOpcode = 2, \ 9262 .Pipeline = 2, \ 9263 .CommandType = 3 9264 9265struct GFX125_CFE_STATE { 9266 uint32_t DWordLength; 9267 uint32_t CFESubOpcodeVariant; 9268 uint32_t CFESubOpcode; 9269 uint32_t ComputeCommandOpcode; 9270 uint32_t Pipeline; 9271 uint32_t CommandType; 9272 uint32_t ScratchSpaceBuffer; 9273 uint32_t NumberofWalkers; 9274 bool FusedEUDispatch; 9275 bool SingleSliceDispatchCCSMode; 9276 uint32_t OverDispatchControl; 9277#define OverDispatchNone 0 9278#define OverDispatchLow 1 9279#define OverDispatchNormal 2 9280#define OverDispatchHigh 3 9281 uint32_t MaximumNumberofThreads; 9282}; 9283 9284static inline __attribute__((always_inline)) void 9285GFX125_CFE_STATE_pack(__attribute__((unused)) __gen_user_data *data, 9286 __attribute__((unused)) void * restrict dst, 9287 __attribute__((unused)) const struct GFX125_CFE_STATE * restrict values) 9288{ 9289 uint32_t * restrict dw = (uint32_t * restrict) dst; 9290 9291 dw[0] = 9292 __gen_uint(values->DWordLength, 0, 7) | 9293 __gen_uint(values->CFESubOpcodeVariant, 16, 17) | 9294 __gen_uint(values->CFESubOpcode, 18, 23) | 9295 __gen_uint(values->ComputeCommandOpcode, 24, 26) | 9296 __gen_uint(values->Pipeline, 27, 28) | 9297 __gen_uint(values->CommandType, 29, 31); 9298 9299 dw[1] = 9300 __gen_uint(values->ScratchSpaceBuffer, 10, 31); 9301 9302 dw[2] = 0; 9303 9304 dw[3] = 9305 __gen_uint(values->NumberofWalkers, 3, 5) | 9306 __gen_uint(values->FusedEUDispatch, 6, 6) | 9307 __gen_uint(values->SingleSliceDispatchCCSMode, 13, 13) | 9308 __gen_uint(values->OverDispatchControl, 14, 15) | 9309 __gen_uint(values->MaximumNumberofThreads, 16, 31); 9310 9311 dw[4] = 0; 9312 9313 dw[5] = 0; 9314} 9315 9316#define GFX125_COMPUTE_WALKER_length 39 9317#define GFX125_COMPUTE_WALKER_length_bias 2 9318#define GFX125_COMPUTE_WALKER_header \ 9319 .DWordLength = 37, \ 9320 .CFESubOpcodeVariant = 0, \ 9321 .CFESubOpcode = 2, \ 9322 .ComputeCommandOpcode = 2, \ 9323 .Pipeline = 2, \ 9324 .CommandType = 3 9325 9326struct GFX125_COMPUTE_WALKER { 9327 uint32_t DWordLength; 9328 bool PredicateEnable; 9329 bool WorkloadPartitionEnable; 9330 bool IndirectParameterEnable; 9331 bool SystolicModeEnable; 9332 uint32_t CFESubOpcodeVariant; 9333 uint32_t CFESubOpcode; 9334 uint32_t ComputeCommandOpcode; 9335 uint32_t Pipeline; 9336 uint32_t CommandType; 9337 uint32_t IndirectDataLength; 9338 bool L3prefetchdisable; 9339 uint32_t PartitionType; 9340#define WALKER_PARTITION_X 1 9341#define WALKER_PARTITION_Y 2 9342#define WALKER_PARTITION_Z 3 9343 uint64_t IndirectDataStartAddress; 9344 uint32_t MessageSIMD; 9345#define SIMD8 0 9346#define SIMD16 1 9347#define SIMD32 2 9348 uint32_t TileLayout; 9349#define Linear 0 9350#define TileY32bpe 1 9351#define TileY64bpe 2 9352#define TileY128bpe 3 9353 uint32_t WalkOrder; 9354#define Walk012 0 9355#define Walk021 1 9356#define Walk102 2 9357#define Walk120 3 9358#define Walk201 4 9359#define Walk210 5 9360 bool EmitInlineParameter; 9361 uint32_t EmitLocal; 9362#define EmitNone 0 9363#define EmitX 1 9364#define EmitXY 3 9365#define EmitXYZ 7 9366 bool GenerateLocalID; 9367 uint32_t SIMDSize; 9368#define SIMD8 0 9369#define SIMD16 1 9370#define SIMD32 2 9371 uint32_t ExecutionMask; 9372 uint32_t LocalXMaximum; 9373 uint32_t LocalYMaximum; 9374 uint32_t LocalZMaximum; 9375 uint32_t ThreadGroupIDXDimension; 9376 uint32_t ThreadGroupIDYDimension; 9377 uint32_t ThreadGroupIDZDimension; 9378 uint32_t ThreadGroupIDStartingX; 9379 uint32_t ThreadGroupIDStartingY; 9380 uint32_t ThreadGroupIDStartingZ; 9381 uint32_t PartitionID; 9382 uint32_t PartitionSize; 9383 uint32_t PreemptX; 9384 uint32_t PreemptY; 9385 uint32_t PreemptZ; 9386 struct GFX125_INTERFACE_DESCRIPTOR_DATA InterfaceDescriptor; 9387 struct GFX125_POSTSYNC_DATA PostSync; 9388 uint32_t InlineData[8]; 9389}; 9390 9391static inline __attribute__((always_inline)) void 9392GFX125_COMPUTE_WALKER_pack(__attribute__((unused)) __gen_user_data *data, 9393 __attribute__((unused)) void * restrict dst, 9394 __attribute__((unused)) const struct GFX125_COMPUTE_WALKER * restrict values) 9395{ 9396 uint32_t * restrict dw = (uint32_t * restrict) dst; 9397 9398 dw[0] = 9399 __gen_uint(values->DWordLength, 0, 7) | 9400 __gen_uint(values->PredicateEnable, 8, 8) | 9401 __gen_uint(values->WorkloadPartitionEnable, 9, 9) | 9402 __gen_uint(values->IndirectParameterEnable, 10, 10) | 9403 __gen_uint(values->SystolicModeEnable, 14, 14) | 9404 __gen_uint(values->CFESubOpcodeVariant, 16, 17) | 9405 __gen_uint(values->CFESubOpcode, 18, 23) | 9406 __gen_uint(values->ComputeCommandOpcode, 24, 26) | 9407 __gen_uint(values->Pipeline, 27, 28) | 9408 __gen_uint(values->CommandType, 29, 31); 9409 9410 dw[1] = 0; 9411 9412 dw[2] = 9413 __gen_uint(values->IndirectDataLength, 0, 16) | 9414 __gen_uint(values->L3prefetchdisable, 17, 17) | 9415 __gen_uint(values->PartitionType, 30, 31); 9416 9417 dw[3] = 9418 __gen_offset(values->IndirectDataStartAddress, 6, 31); 9419 9420 dw[4] = 9421 __gen_uint(values->MessageSIMD, 17, 18) | 9422 __gen_uint(values->TileLayout, 19, 21) | 9423 __gen_uint(values->WalkOrder, 22, 24) | 9424 __gen_uint(values->EmitInlineParameter, 25, 25) | 9425 __gen_uint(values->EmitLocal, 26, 28) | 9426 __gen_uint(values->GenerateLocalID, 29, 29) | 9427 __gen_uint(values->SIMDSize, 30, 31); 9428 9429 dw[5] = 9430 __gen_uint(values->ExecutionMask, 0, 31); 9431 9432 dw[6] = 9433 __gen_uint(values->LocalXMaximum, 0, 9) | 9434 __gen_uint(values->LocalYMaximum, 10, 19) | 9435 __gen_uint(values->LocalZMaximum, 20, 29); 9436 9437 dw[7] = 9438 __gen_uint(values->ThreadGroupIDXDimension, 0, 31); 9439 9440 dw[8] = 9441 __gen_uint(values->ThreadGroupIDYDimension, 0, 31); 9442 9443 dw[9] = 9444 __gen_uint(values->ThreadGroupIDZDimension, 0, 31); 9445 9446 dw[10] = 9447 __gen_uint(values->ThreadGroupIDStartingX, 0, 31); 9448 9449 dw[11] = 9450 __gen_uint(values->ThreadGroupIDStartingY, 0, 31); 9451 9452 dw[12] = 9453 __gen_uint(values->ThreadGroupIDStartingZ, 0, 31); 9454 9455 dw[13] = 9456 __gen_uint(values->PartitionID, 0, 31); 9457 9458 dw[14] = 9459 __gen_uint(values->PartitionSize, 0, 31); 9460 9461 dw[15] = 9462 __gen_uint(values->PreemptX, 0, 31); 9463 9464 dw[16] = 9465 __gen_uint(values->PreemptY, 0, 31); 9466 9467 dw[17] = 9468 __gen_uint(values->PreemptZ, 0, 31); 9469 9470 GFX125_INTERFACE_DESCRIPTOR_DATA_pack(data, &dw[18], &values->InterfaceDescriptor); 9471 9472 GFX125_POSTSYNC_DATA_pack(data, &dw[26], &values->PostSync); 9473 9474 dw[31] = 9475 __gen_uint(values->InlineData[0], 0, 31); 9476 9477 dw[32] = 9478 __gen_uint(values->InlineData[1], 0, 31); 9479 9480 dw[33] = 9481 __gen_uint(values->InlineData[2], 0, 31); 9482 9483 dw[34] = 9484 __gen_uint(values->InlineData[3], 0, 31); 9485 9486 dw[35] = 9487 __gen_uint(values->InlineData[4], 0, 31); 9488 9489 dw[36] = 9490 __gen_uint(values->InlineData[5], 0, 31); 9491 9492 dw[37] = 9493 __gen_uint(values->InlineData[6], 0, 31); 9494 9495 dw[38] = 9496 __gen_uint(values->InlineData[7], 0, 31); 9497} 9498 9499#define GFX125_MI_ARB_CHECK_length 1 9500#define GFX125_MI_ARB_CHECK_length_bias 1 9501#define GFX125_MI_ARB_CHECK_header \ 9502 .MICommandOpcode = 5, \ 9503 .CommandType = 0 9504 9505struct GFX125_MI_ARB_CHECK { 9506 uint32_t MICommandOpcode; 9507 uint32_t CommandType; 9508}; 9509 9510static inline __attribute__((always_inline)) void 9511GFX125_MI_ARB_CHECK_pack(__attribute__((unused)) __gen_user_data *data, 9512 __attribute__((unused)) void * restrict dst, 9513 __attribute__((unused)) const struct GFX125_MI_ARB_CHECK * restrict values) 9514{ 9515 uint32_t * restrict dw = (uint32_t * restrict) dst; 9516 9517 dw[0] = 9518 __gen_uint(values->MICommandOpcode, 23, 28) | 9519 __gen_uint(values->CommandType, 29, 31); 9520} 9521 9522#define GFX125_MI_ARB_ON_OFF_length 1 9523#define GFX125_MI_ARB_ON_OFF_length_bias 1 9524#define GFX125_MI_ARB_ON_OFF_header \ 9525 .ArbitrationEnable = 1, \ 9526 .MICommandOpcode = 8, \ 9527 .CommandType = 0 9528 9529struct GFX125_MI_ARB_ON_OFF { 9530 bool ArbitrationEnable; 9531 bool AllowLiteRestore; 9532 uint32_t MICommandOpcode; 9533 uint32_t CommandType; 9534}; 9535 9536static inline __attribute__((always_inline)) void 9537GFX125_MI_ARB_ON_OFF_pack(__attribute__((unused)) __gen_user_data *data, 9538 __attribute__((unused)) void * restrict dst, 9539 __attribute__((unused)) const struct GFX125_MI_ARB_ON_OFF * restrict values) 9540{ 9541 uint32_t * restrict dw = (uint32_t * restrict) dst; 9542 9543 dw[0] = 9544 __gen_uint(values->ArbitrationEnable, 0, 0) | 9545 __gen_uint(values->AllowLiteRestore, 1, 1) | 9546 __gen_uint(values->MICommandOpcode, 23, 28) | 9547 __gen_uint(values->CommandType, 29, 31); 9548} 9549 9550#define GFX125_MI_ATOMIC_length 3 9551#define GFX125_MI_ATOMIC_length_bias 2 9552#define GFX125_MI_ATOMIC_header \ 9553 .DWordLength = 1, \ 9554 .MICommandOpcode = 47, \ 9555 .CommandType = 0 9556 9557struct GFX125_MI_ATOMIC { 9558 uint32_t DWordLength; 9559 enum GFX125_Atomic_OPCODE ATOMICOPCODE; 9560 bool ReturnDataControl; 9561 bool CSSTALL; 9562 bool InlineData; 9563 uint32_t DataSize; 9564#define MI_ATOMIC_DWORD 0 9565#define MI_ATOMIC_QWORD 1 9566#define MI_ATOMIC_OCTWORD 2 9567#define MI_ATOMIC_RESERVED 3 9568 bool PostSyncOperation; 9569 uint32_t MemoryType; 9570#define PerProcessGraphicsAddress 0 9571#define GlobalGraphicsAddress 1 9572 uint32_t MICommandOpcode; 9573 uint32_t CommandType; 9574 __gen_address_type MemoryAddress; 9575 uint32_t Operand1DataDword0; 9576 uint32_t Operand2DataDword0; 9577 uint32_t Operand1DataDword1; 9578 uint32_t Operand2DataDword1; 9579 uint32_t Operand1DataDword2; 9580 uint32_t Operand2DataDword2; 9581 uint32_t Operand1DataDword3; 9582 uint32_t Operand2DataDword3; 9583}; 9584 9585static inline __attribute__((always_inline)) void 9586GFX125_MI_ATOMIC_pack(__attribute__((unused)) __gen_user_data *data, 9587 __attribute__((unused)) void * restrict dst, 9588 __attribute__((unused)) const struct GFX125_MI_ATOMIC * restrict values) 9589{ 9590 uint32_t * restrict dw = (uint32_t * restrict) dst; 9591 9592 dw[0] = 9593 __gen_uint(values->DWordLength, 0, 7) | 9594 __gen_uint(values->ATOMICOPCODE, 8, 15) | 9595 __gen_uint(values->ReturnDataControl, 16, 16) | 9596 __gen_uint(values->CSSTALL, 17, 17) | 9597 __gen_uint(values->InlineData, 18, 18) | 9598 __gen_uint(values->DataSize, 19, 20) | 9599 __gen_uint(values->PostSyncOperation, 21, 21) | 9600 __gen_uint(values->MemoryType, 22, 22) | 9601 __gen_uint(values->MICommandOpcode, 23, 28) | 9602 __gen_uint(values->CommandType, 29, 31); 9603 9604 const uint64_t v1_address = 9605 __gen_address(data, &dw[1], values->MemoryAddress, 0, 2, 47); 9606 dw[1] = v1_address; 9607 dw[2] = v1_address >> 32; 9608} 9609 9610#define GFX125_MI_BATCH_BUFFER_END_length 1 9611#define GFX125_MI_BATCH_BUFFER_END_length_bias 1 9612#define GFX125_MI_BATCH_BUFFER_END_header \ 9613 .MICommandOpcode = 10, \ 9614 .CommandType = 0 9615 9616struct GFX125_MI_BATCH_BUFFER_END { 9617 bool EndContext; 9618 uint32_t MICommandOpcode; 9619 uint32_t CommandType; 9620}; 9621 9622static inline __attribute__((always_inline)) void 9623GFX125_MI_BATCH_BUFFER_END_pack(__attribute__((unused)) __gen_user_data *data, 9624 __attribute__((unused)) void * restrict dst, 9625 __attribute__((unused)) const struct GFX125_MI_BATCH_BUFFER_END * restrict values) 9626{ 9627 uint32_t * restrict dw = (uint32_t * restrict) dst; 9628 9629 dw[0] = 9630 __gen_uint(values->EndContext, 0, 0) | 9631 __gen_uint(values->MICommandOpcode, 23, 28) | 9632 __gen_uint(values->CommandType, 29, 31); 9633} 9634 9635#define GFX125_MI_BATCH_BUFFER_START_length 3 9636#define GFX125_MI_BATCH_BUFFER_START_length_bias 2 9637#define GFX125_MI_BATCH_BUFFER_START_header \ 9638 .DWordLength = 1, \ 9639 .MICommandOpcode = 49, \ 9640 .CommandType = 0 9641 9642struct GFX125_MI_BATCH_BUFFER_START { 9643 uint32_t DWordLength; 9644 uint32_t AddressSpaceIndicator; 9645#define ASI_GGTT 0 9646#define ASI_PPGTT 1 9647 bool ResourceStreamerEnable; 9648 bool PredicationEnable; 9649 uint32_t SecondLevelBatchBuffer; 9650#define Firstlevelbatch 0 9651#define Secondlevelbatch 1 9652 uint32_t MICommandOpcode; 9653 uint32_t CommandType; 9654 __gen_address_type BatchBufferStartAddress; 9655}; 9656 9657static inline __attribute__((always_inline)) void 9658GFX125_MI_BATCH_BUFFER_START_pack(__attribute__((unused)) __gen_user_data *data, 9659 __attribute__((unused)) void * restrict dst, 9660 __attribute__((unused)) const struct GFX125_MI_BATCH_BUFFER_START * restrict values) 9661{ 9662 uint32_t * restrict dw = (uint32_t * restrict) dst; 9663 9664 dw[0] = 9665 __gen_uint(values->DWordLength, 0, 7) | 9666 __gen_uint(values->AddressSpaceIndicator, 8, 8) | 9667 __gen_uint(values->ResourceStreamerEnable, 10, 10) | 9668 __gen_uint(values->PredicationEnable, 15, 15) | 9669 __gen_uint(values->SecondLevelBatchBuffer, 22, 22) | 9670 __gen_uint(values->MICommandOpcode, 23, 28) | 9671 __gen_uint(values->CommandType, 29, 31); 9672 9673 const uint64_t v1_address = 9674 __gen_address(data, &dw[1], values->BatchBufferStartAddress, 0, 2, 63); 9675 dw[1] = v1_address; 9676 dw[2] = v1_address >> 32; 9677} 9678 9679#define GFX125_MI_CLFLUSH_length_bias 2 9680#define GFX125_MI_CLFLUSH_header \ 9681 .DWordLength = 1, \ 9682 .MICommandOpcode = 39, \ 9683 .CommandType = 0 9684 9685struct GFX125_MI_CLFLUSH { 9686 uint32_t DWordLength; 9687 bool UseGlobalGTT; 9688 uint32_t MICommandOpcode; 9689 uint32_t CommandType; 9690 uint32_t StartingCachelineOffset; 9691 __gen_address_type PageBaseAddress; 9692 /* variable length fields follow */ 9693}; 9694 9695static inline __attribute__((always_inline)) void 9696GFX125_MI_CLFLUSH_pack(__attribute__((unused)) __gen_user_data *data, 9697 __attribute__((unused)) void * restrict dst, 9698 __attribute__((unused)) const struct GFX125_MI_CLFLUSH * restrict values) 9699{ 9700 uint32_t * restrict dw = (uint32_t * restrict) dst; 9701 9702 dw[0] = 9703 __gen_uint(values->DWordLength, 0, 9) | 9704 __gen_uint(values->UseGlobalGTT, 22, 22) | 9705 __gen_uint(values->MICommandOpcode, 23, 28) | 9706 __gen_uint(values->CommandType, 29, 31); 9707 9708 const uint64_t v1 = 9709 __gen_uint(values->StartingCachelineOffset, 6, 11); 9710 const uint64_t v1_address = 9711 __gen_address(data, &dw[1], values->PageBaseAddress, v1, 12, 47); 9712 dw[1] = v1_address; 9713 dw[2] = (v1_address >> 32) | (v1 >> 32); 9714} 9715 9716#define GFX125_MI_CONDITIONAL_BATCH_BUFFER_END_length 4 9717#define GFX125_MI_CONDITIONAL_BATCH_BUFFER_END_length_bias 2 9718#define GFX125_MI_CONDITIONAL_BATCH_BUFFER_END_header\ 9719 .DWordLength = 2, \ 9720 .CompareSemaphore = 0, \ 9721 .MICommandOpcode = 54, \ 9722 .CommandType = 0 9723 9724struct GFX125_MI_CONDITIONAL_BATCH_BUFFER_END { 9725 uint32_t DWordLength; 9726 uint32_t CompareMaskMode; 9727#define CompareMaskModeDisabled 0 9728#define CompareMaskModeEnabled 1 9729 uint32_t CompareSemaphore; 9730 bool UseGlobalGTT; 9731 uint32_t MICommandOpcode; 9732 uint32_t CommandType; 9733 uint32_t CompareDataDword; 9734 __gen_address_type CompareAddress; 9735}; 9736 9737static inline __attribute__((always_inline)) void 9738GFX125_MI_CONDITIONAL_BATCH_BUFFER_END_pack(__attribute__((unused)) __gen_user_data *data, 9739 __attribute__((unused)) void * restrict dst, 9740 __attribute__((unused)) const struct GFX125_MI_CONDITIONAL_BATCH_BUFFER_END * restrict values) 9741{ 9742 uint32_t * restrict dw = (uint32_t * restrict) dst; 9743 9744 dw[0] = 9745 __gen_uint(values->DWordLength, 0, 7) | 9746 __gen_uint(values->CompareMaskMode, 19, 19) | 9747 __gen_uint(values->CompareSemaphore, 21, 21) | 9748 __gen_uint(values->UseGlobalGTT, 22, 22) | 9749 __gen_uint(values->MICommandOpcode, 23, 28) | 9750 __gen_uint(values->CommandType, 29, 31); 9751 9752 dw[1] = 9753 __gen_uint(values->CompareDataDword, 0, 31); 9754 9755 const uint64_t v2_address = 9756 __gen_address(data, &dw[2], values->CompareAddress, 0, 3, 63); 9757 dw[2] = v2_address; 9758 dw[3] = v2_address >> 32; 9759} 9760 9761#define GFX125_MI_COPY_MEM_MEM_length 5 9762#define GFX125_MI_COPY_MEM_MEM_length_bias 2 9763#define GFX125_MI_COPY_MEM_MEM_header \ 9764 .DWordLength = 3, \ 9765 .MICommandOpcode = 46, \ 9766 .CommandType = 0 9767 9768struct GFX125_MI_COPY_MEM_MEM { 9769 uint32_t DWordLength; 9770 bool UseGlobalGTTDestination; 9771 bool UseGlobalGTTSource; 9772 uint32_t MICommandOpcode; 9773 uint32_t CommandType; 9774 __gen_address_type DestinationMemoryAddress; 9775 __gen_address_type SourceMemoryAddress; 9776}; 9777 9778static inline __attribute__((always_inline)) void 9779GFX125_MI_COPY_MEM_MEM_pack(__attribute__((unused)) __gen_user_data *data, 9780 __attribute__((unused)) void * restrict dst, 9781 __attribute__((unused)) const struct GFX125_MI_COPY_MEM_MEM * restrict values) 9782{ 9783 uint32_t * restrict dw = (uint32_t * restrict) dst; 9784 9785 dw[0] = 9786 __gen_uint(values->DWordLength, 0, 7) | 9787 __gen_uint(values->UseGlobalGTTDestination, 21, 21) | 9788 __gen_uint(values->UseGlobalGTTSource, 22, 22) | 9789 __gen_uint(values->MICommandOpcode, 23, 28) | 9790 __gen_uint(values->CommandType, 29, 31); 9791 9792 const uint64_t v1_address = 9793 __gen_address(data, &dw[1], values->DestinationMemoryAddress, 0, 2, 63); 9794 dw[1] = v1_address; 9795 dw[2] = v1_address >> 32; 9796 9797 const uint64_t v3_address = 9798 __gen_address(data, &dw[3], values->SourceMemoryAddress, 0, 2, 63); 9799 dw[3] = v3_address; 9800 dw[4] = v3_address >> 32; 9801} 9802 9803#define GFX125_MI_DISPLAY_FLIP_length 3 9804#define GFX125_MI_DISPLAY_FLIP_length_bias 2 9805#define GFX125_MI_DISPLAY_FLIP_header \ 9806 .DWordLength = 1, \ 9807 .MICommandOpcode = 20, \ 9808 .CommandType = 0 9809 9810struct GFX125_MI_DISPLAY_FLIP { 9811 uint32_t DWordLength; 9812 uint32_t DisplayPlaneSelect; 9813#define DisplayPlane1 0 9814#define DisplayPlane2 1 9815#define DisplayPlane3 2 9816#define DisplayPlane4 4 9817#define DisplayPlane5 5 9818#define DisplayPlane6 6 9819#define DisplayPlane7 7 9820#define DisplayPlane8 8 9821#define DisplayPlane9 9 9822#define DisplayPlane10 10 9823#define DisplayPlane11 11 9824#define DisplayPlane12 12 9825#define DisplayPlane13 13 9826#define DisplayPlane14 14 9827#define DisplayPlane15 15 9828#define DisplayPlane16 16 9829#define DisplayPlane17 17 9830#define DisplayPlane18 18 9831#define DisplayPlane19 19 9832#define DisplayPlane20 20 9833#define DisplayPlane21 21 9834#define DisplayPlane22 22 9835#define DisplayPlane23 23 9836#define DisplayPlane24 24 9837#define DisplayPlane25 25 9838#define DisplayPlane26 26 9839#define DisplayPlane27 27 9840#define DisplayPlane28 28 9841#define DisplayPlane29 29 9842#define DisplayPlane30 30 9843#define DisplayPlane31 31 9844#define DisplayPlane32 32 9845 bool AsyncFlipIndicator; 9846 uint32_t MICommandOpcode; 9847 uint32_t CommandType; 9848 uint32_t TileParameter; 9849 uint32_t DisplayBufferPitch; 9850 bool Stereoscopic3DMode; 9851 uint32_t FlipType; 9852#define SyncFlip 0 9853#define AsyncFlip 1 9854#define Stereo3DFlip 2 9855 uint32_t VRRMasterFlip; 9856 __gen_address_type DisplayBufferBaseAddress; 9857 __gen_address_type LeftEyeDisplayBufferBaseAddress; 9858}; 9859 9860static inline __attribute__((always_inline)) void 9861GFX125_MI_DISPLAY_FLIP_pack(__attribute__((unused)) __gen_user_data *data, 9862 __attribute__((unused)) void * restrict dst, 9863 __attribute__((unused)) const struct GFX125_MI_DISPLAY_FLIP * restrict values) 9864{ 9865 uint32_t * restrict dw = (uint32_t * restrict) dst; 9866 9867 dw[0] = 9868 __gen_uint(values->DWordLength, 0, 7) | 9869 __gen_uint(values->DisplayPlaneSelect, 8, 13) | 9870 __gen_uint(values->AsyncFlipIndicator, 22, 22) | 9871 __gen_uint(values->MICommandOpcode, 23, 28) | 9872 __gen_uint(values->CommandType, 29, 31); 9873 9874 dw[1] = 9875 __gen_uint(values->TileParameter, 0, 2) | 9876 __gen_uint(values->DisplayBufferPitch, 6, 15) | 9877 __gen_uint(values->Stereoscopic3DMode, 31, 31); 9878 9879 const uint32_t v2 = 9880 __gen_uint(values->FlipType, 0, 1) | 9881 __gen_uint(values->VRRMasterFlip, 11, 11); 9882 dw[2] = __gen_address(data, &dw[2], values->DisplayBufferBaseAddress, v2, 12, 31); 9883} 9884 9885#define GFX125_MI_FORCE_WAKEUP_length 2 9886#define GFX125_MI_FORCE_WAKEUP_length_bias 2 9887#define GFX125_MI_FORCE_WAKEUP_header \ 9888 .DWordLength = 0, \ 9889 .MICommandOpcode = 29, \ 9890 .CommandType = 0 9891 9892struct GFX125_MI_FORCE_WAKEUP { 9893 uint32_t DWordLength; 9894 uint32_t MICommandOpcode; 9895 uint32_t CommandType; 9896 uint32_t ForceMediaSlice0Awake; 9897 uint32_t ForceRenderAwake; 9898 uint32_t ForceMediaSlice1Awake; 9899 uint32_t ForceMediaSlice2Awake; 9900 uint32_t ForceMediaSlice3Awake; 9901 uint32_t MaskBits; 9902}; 9903 9904static inline __attribute__((always_inline)) void 9905GFX125_MI_FORCE_WAKEUP_pack(__attribute__((unused)) __gen_user_data *data, 9906 __attribute__((unused)) void * restrict dst, 9907 __attribute__((unused)) const struct GFX125_MI_FORCE_WAKEUP * restrict values) 9908{ 9909 uint32_t * restrict dw = (uint32_t * restrict) dst; 9910 9911 dw[0] = 9912 __gen_uint(values->DWordLength, 0, 7) | 9913 __gen_uint(values->MICommandOpcode, 23, 28) | 9914 __gen_uint(values->CommandType, 29, 31); 9915 9916 dw[1] = 9917 __gen_uint(values->ForceMediaSlice0Awake, 0, 0) | 9918 __gen_uint(values->ForceRenderAwake, 1, 1) | 9919 __gen_uint(values->ForceMediaSlice1Awake, 2, 2) | 9920 __gen_uint(values->ForceMediaSlice2Awake, 3, 3) | 9921 __gen_uint(values->ForceMediaSlice3Awake, 4, 4) | 9922 __gen_uint(values->MaskBits, 16, 31); 9923} 9924 9925#define GFX125_MI_LOAD_REGISTER_IMM_length 3 9926#define GFX125_MI_LOAD_REGISTER_IMM_length_bias 2 9927#define GFX125_MI_LOAD_REGISTER_IMM_header \ 9928 .DWordLength = 1, \ 9929 .MICommandOpcode = 34, \ 9930 .CommandType = 0 9931 9932struct GFX125_MI_LOAD_REGISTER_IMM { 9933 uint32_t DWordLength; 9934 uint32_t ByteWriteDisables; 9935 uint32_t AddCSMMIOStartOffset; 9936 uint32_t MICommandOpcode; 9937 uint32_t CommandType; 9938 uint64_t RegisterOffset; 9939 uint32_t DataDWord; 9940 /* variable length fields follow */ 9941}; 9942 9943static inline __attribute__((always_inline)) void 9944GFX125_MI_LOAD_REGISTER_IMM_pack(__attribute__((unused)) __gen_user_data *data, 9945 __attribute__((unused)) void * restrict dst, 9946 __attribute__((unused)) const struct GFX125_MI_LOAD_REGISTER_IMM * restrict values) 9947{ 9948 uint32_t * restrict dw = (uint32_t * restrict) dst; 9949 9950 dw[0] = 9951 __gen_uint(values->DWordLength, 0, 7) | 9952 __gen_uint(values->ByteWriteDisables, 8, 11) | 9953 __gen_uint(values->AddCSMMIOStartOffset, 19, 19) | 9954 __gen_uint(values->MICommandOpcode, 23, 28) | 9955 __gen_uint(values->CommandType, 29, 31); 9956 9957 dw[1] = 9958 __gen_offset(values->RegisterOffset, 2, 22); 9959 9960 dw[2] = 9961 __gen_uint(values->DataDWord, 0, 31); 9962} 9963 9964#define GFX125_MI_LOAD_REGISTER_MEM_length 4 9965#define GFX125_MI_LOAD_REGISTER_MEM_length_bias 2 9966#define GFX125_MI_LOAD_REGISTER_MEM_header \ 9967 .DWordLength = 2, \ 9968 .MICommandOpcode = 41, \ 9969 .CommandType = 0 9970 9971struct GFX125_MI_LOAD_REGISTER_MEM { 9972 uint32_t DWordLength; 9973 uint32_t AddCSMMIOStartOffset; 9974 uint32_t AddLoopVariable; 9975 bool AsyncModeEnable; 9976 bool UseGlobalGTT; 9977 uint32_t MICommandOpcode; 9978 uint32_t CommandType; 9979 uint64_t RegisterAddress; 9980 __gen_address_type MemoryAddress; 9981}; 9982 9983static inline __attribute__((always_inline)) void 9984GFX125_MI_LOAD_REGISTER_MEM_pack(__attribute__((unused)) __gen_user_data *data, 9985 __attribute__((unused)) void * restrict dst, 9986 __attribute__((unused)) const struct GFX125_MI_LOAD_REGISTER_MEM * restrict values) 9987{ 9988 uint32_t * restrict dw = (uint32_t * restrict) dst; 9989 9990 dw[0] = 9991 __gen_uint(values->DWordLength, 0, 7) | 9992 __gen_uint(values->AddCSMMIOStartOffset, 19, 19) | 9993 __gen_uint(values->AddLoopVariable, 20, 20) | 9994 __gen_uint(values->AsyncModeEnable, 21, 21) | 9995 __gen_uint(values->UseGlobalGTT, 22, 22) | 9996 __gen_uint(values->MICommandOpcode, 23, 28) | 9997 __gen_uint(values->CommandType, 29, 31); 9998 9999 dw[1] = 10000 __gen_offset(values->RegisterAddress, 2, 22); 10001 10002 const uint64_t v2_address = 10003 __gen_address(data, &dw[2], values->MemoryAddress, 0, 2, 63); 10004 dw[2] = v2_address; 10005 dw[3] = v2_address >> 32; 10006} 10007 10008#define GFX125_MI_LOAD_REGISTER_REG_length 3 10009#define GFX125_MI_LOAD_REGISTER_REG_length_bias 2 10010#define GFX125_MI_LOAD_REGISTER_REG_header \ 10011 .DWordLength = 1, \ 10012 .MICommandOpcode = 42, \ 10013 .CommandType = 0 10014 10015struct GFX125_MI_LOAD_REGISTER_REG { 10016 uint32_t DWordLength; 10017 uint32_t AddCSMMIOStartOffsetSource; 10018 uint32_t AddCSMMIOStartOffsetDestination; 10019 uint32_t MICommandOpcode; 10020 uint32_t CommandType; 10021 uint64_t SourceRegisterAddress; 10022 uint64_t DestinationRegisterAddress; 10023}; 10024 10025static inline __attribute__((always_inline)) void 10026GFX125_MI_LOAD_REGISTER_REG_pack(__attribute__((unused)) __gen_user_data *data, 10027 __attribute__((unused)) void * restrict dst, 10028 __attribute__((unused)) const struct GFX125_MI_LOAD_REGISTER_REG * restrict values) 10029{ 10030 uint32_t * restrict dw = (uint32_t * restrict) dst; 10031 10032 dw[0] = 10033 __gen_uint(values->DWordLength, 0, 7) | 10034 __gen_uint(values->AddCSMMIOStartOffsetSource, 18, 18) | 10035 __gen_uint(values->AddCSMMIOStartOffsetDestination, 19, 19) | 10036 __gen_uint(values->MICommandOpcode, 23, 28) | 10037 __gen_uint(values->CommandType, 29, 31); 10038 10039 dw[1] = 10040 __gen_offset(values->SourceRegisterAddress, 2, 22); 10041 10042 dw[2] = 10043 __gen_offset(values->DestinationRegisterAddress, 2, 22); 10044} 10045 10046#define GFX125_MI_LOAD_SCAN_LINES_EXCL_length 2 10047#define GFX125_MI_LOAD_SCAN_LINES_EXCL_length_bias 2 10048#define GFX125_MI_LOAD_SCAN_LINES_EXCL_header \ 10049 .DWordLength = 0, \ 10050 .MICommandOpcode = 19, \ 10051 .CommandType = 0 10052 10053struct GFX125_MI_LOAD_SCAN_LINES_EXCL { 10054 uint32_t DWordLength; 10055 uint32_t DisplayPlaneSelect; 10056#define DisplayPlaneA 0 10057#define DisplayPlaneB 1 10058#define DisplayPlaneC 4 10059#define DisplayPlaneD 5 10060 uint32_t MICommandOpcode; 10061 uint32_t CommandType; 10062 uint32_t EndScanLineNumber; 10063 uint32_t StartScanLineNumber; 10064}; 10065 10066static inline __attribute__((always_inline)) void 10067GFX125_MI_LOAD_SCAN_LINES_EXCL_pack(__attribute__((unused)) __gen_user_data *data, 10068 __attribute__((unused)) void * restrict dst, 10069 __attribute__((unused)) const struct GFX125_MI_LOAD_SCAN_LINES_EXCL * restrict values) 10070{ 10071 uint32_t * restrict dw = (uint32_t * restrict) dst; 10072 10073 dw[0] = 10074 __gen_uint(values->DWordLength, 0, 5) | 10075 __gen_uint(values->DisplayPlaneSelect, 19, 21) | 10076 __gen_uint(values->MICommandOpcode, 23, 28) | 10077 __gen_uint(values->CommandType, 29, 31); 10078 10079 dw[1] = 10080 __gen_uint(values->EndScanLineNumber, 0, 12) | 10081 __gen_uint(values->StartScanLineNumber, 16, 28); 10082} 10083 10084#define GFX125_MI_LOAD_SCAN_LINES_INCL_length 2 10085#define GFX125_MI_LOAD_SCAN_LINES_INCL_length_bias 2 10086#define GFX125_MI_LOAD_SCAN_LINES_INCL_header \ 10087 .DWordLength = 0, \ 10088 .MICommandOpcode = 18, \ 10089 .CommandType = 0 10090 10091struct GFX125_MI_LOAD_SCAN_LINES_INCL { 10092 uint32_t DWordLength; 10093 uint32_t ScanLineEventDoneForward; 10094 uint32_t DisplayPlaneSelect; 10095#define DisplayPlane1A 0 10096#define DisplayPlane1B 1 10097#define DisplayPlane1C 4 10098#define DisplayPlane1D 5 10099 uint32_t MICommandOpcode; 10100 uint32_t CommandType; 10101 uint32_t EndScanLineNumber; 10102 uint32_t StartScanLineNumber; 10103}; 10104 10105static inline __attribute__((always_inline)) void 10106GFX125_MI_LOAD_SCAN_LINES_INCL_pack(__attribute__((unused)) __gen_user_data *data, 10107 __attribute__((unused)) void * restrict dst, 10108 __attribute__((unused)) const struct GFX125_MI_LOAD_SCAN_LINES_INCL * restrict values) 10109{ 10110 uint32_t * restrict dw = (uint32_t * restrict) dst; 10111 10112 dw[0] = 10113 __gen_uint(values->DWordLength, 0, 5) | 10114 __gen_uint(values->ScanLineEventDoneForward, 17, 18) | 10115 __gen_uint(values->DisplayPlaneSelect, 19, 21) | 10116 __gen_uint(values->MICommandOpcode, 23, 28) | 10117 __gen_uint(values->CommandType, 29, 31); 10118 10119 dw[1] = 10120 __gen_uint(values->EndScanLineNumber, 0, 12) | 10121 __gen_uint(values->StartScanLineNumber, 16, 28); 10122} 10123 10124#define GFX125_MI_MATH_length_bias 2 10125#define GFX125_MI_MATH_header \ 10126 .DWordLength = 0, \ 10127 .MICommandOpcode = 26, \ 10128 .CommandType = 0 10129 10130struct GFX125_MI_MATH { 10131 uint32_t DWordLength; 10132 uint32_t MICommandOpcode; 10133 uint32_t CommandType; 10134 /* variable length fields follow */ 10135}; 10136 10137static inline __attribute__((always_inline)) void 10138GFX125_MI_MATH_pack(__attribute__((unused)) __gen_user_data *data, 10139 __attribute__((unused)) void * restrict dst, 10140 __attribute__((unused)) const struct GFX125_MI_MATH * restrict values) 10141{ 10142 uint32_t * restrict dw = (uint32_t * restrict) dst; 10143 10144 dw[0] = 10145 __gen_uint(values->DWordLength, 0, 7) | 10146 __gen_uint(values->MICommandOpcode, 23, 28) | 10147 __gen_uint(values->CommandType, 29, 31); 10148} 10149 10150#define GFX125_MI_NOOP_length 1 10151#define GFX125_MI_NOOP_length_bias 1 10152#define GFX125_MI_NOOP_header \ 10153 .MICommandOpcode = 0, \ 10154 .CommandType = 0 10155 10156struct GFX125_MI_NOOP { 10157 uint32_t IdentificationNumber; 10158 bool IdentificationNumberRegisterWriteEnable; 10159 uint32_t MICommandOpcode; 10160 uint32_t CommandType; 10161}; 10162 10163static inline __attribute__((always_inline)) void 10164GFX125_MI_NOOP_pack(__attribute__((unused)) __gen_user_data *data, 10165 __attribute__((unused)) void * restrict dst, 10166 __attribute__((unused)) const struct GFX125_MI_NOOP * restrict values) 10167{ 10168 uint32_t * restrict dw = (uint32_t * restrict) dst; 10169 10170 dw[0] = 10171 __gen_uint(values->IdentificationNumber, 0, 21) | 10172 __gen_uint(values->IdentificationNumberRegisterWriteEnable, 22, 22) | 10173 __gen_uint(values->MICommandOpcode, 23, 28) | 10174 __gen_uint(values->CommandType, 29, 31); 10175} 10176 10177#define GFX125_MI_PREDICATE_length 1 10178#define GFX125_MI_PREDICATE_length_bias 1 10179#define GFX125_MI_PREDICATE_header \ 10180 .MICommandOpcode = 12, \ 10181 .CommandType = 0 10182 10183struct GFX125_MI_PREDICATE { 10184 uint32_t CompareOperation; 10185#define COMPARE_TRUE 0 10186#define COMPARE_FALSE 1 10187#define COMPARE_SRCS_EQUAL 2 10188#define COMPARE_DELTAS_EQUAL 3 10189 uint32_t CombineOperation; 10190#define COMBINE_SET 0 10191#define COMBINE_AND 1 10192#define COMBINE_OR 2 10193#define COMBINE_XOR 3 10194 uint32_t LoadOperation; 10195#define LOAD_KEEP 0 10196#define LOAD_LOAD 2 10197#define LOAD_LOADINV 3 10198 uint32_t MICommandOpcode; 10199 uint32_t CommandType; 10200}; 10201 10202static inline __attribute__((always_inline)) void 10203GFX125_MI_PREDICATE_pack(__attribute__((unused)) __gen_user_data *data, 10204 __attribute__((unused)) void * restrict dst, 10205 __attribute__((unused)) const struct GFX125_MI_PREDICATE * restrict values) 10206{ 10207 uint32_t * restrict dw = (uint32_t * restrict) dst; 10208 10209 dw[0] = 10210 __gen_uint(values->CompareOperation, 0, 1) | 10211 __gen_uint(values->CombineOperation, 3, 4) | 10212 __gen_uint(values->LoadOperation, 6, 7) | 10213 __gen_uint(values->MICommandOpcode, 23, 28) | 10214 __gen_uint(values->CommandType, 29, 31); 10215} 10216 10217#define GFX125_MI_REPORT_HEAD_length 1 10218#define GFX125_MI_REPORT_HEAD_length_bias 1 10219#define GFX125_MI_REPORT_HEAD_header \ 10220 .MICommandOpcode = 7, \ 10221 .CommandType = 0 10222 10223struct GFX125_MI_REPORT_HEAD { 10224 uint32_t MICommandOpcode; 10225 uint32_t CommandType; 10226}; 10227 10228static inline __attribute__((always_inline)) void 10229GFX125_MI_REPORT_HEAD_pack(__attribute__((unused)) __gen_user_data *data, 10230 __attribute__((unused)) void * restrict dst, 10231 __attribute__((unused)) const struct GFX125_MI_REPORT_HEAD * restrict values) 10232{ 10233 uint32_t * restrict dw = (uint32_t * restrict) dst; 10234 10235 dw[0] = 10236 __gen_uint(values->MICommandOpcode, 23, 28) | 10237 __gen_uint(values->CommandType, 29, 31); 10238} 10239 10240#define GFX125_MI_REPORT_PERF_COUNT_length 4 10241#define GFX125_MI_REPORT_PERF_COUNT_length_bias 2 10242#define GFX125_MI_REPORT_PERF_COUNT_header \ 10243 .DWordLength = 2, \ 10244 .MICommandOpcode = 40, \ 10245 .CommandType = 0 10246 10247struct GFX125_MI_REPORT_PERF_COUNT { 10248 uint32_t DWordLength; 10249 uint32_t MICommandOpcode; 10250 uint32_t CommandType; 10251 bool UseGlobalGTT; 10252 uint32_t CoreModeEnable; 10253 __gen_address_type MemoryAddress; 10254 uint32_t ReportID; 10255}; 10256 10257static inline __attribute__((always_inline)) void 10258GFX125_MI_REPORT_PERF_COUNT_pack(__attribute__((unused)) __gen_user_data *data, 10259 __attribute__((unused)) void * restrict dst, 10260 __attribute__((unused)) const struct GFX125_MI_REPORT_PERF_COUNT * restrict values) 10261{ 10262 uint32_t * restrict dw = (uint32_t * restrict) dst; 10263 10264 dw[0] = 10265 __gen_uint(values->DWordLength, 0, 5) | 10266 __gen_uint(values->MICommandOpcode, 23, 28) | 10267 __gen_uint(values->CommandType, 29, 31); 10268 10269 const uint64_t v1 = 10270 __gen_uint(values->UseGlobalGTT, 0, 0) | 10271 __gen_uint(values->CoreModeEnable, 4, 4); 10272 const uint64_t v1_address = 10273 __gen_address(data, &dw[1], values->MemoryAddress, v1, 6, 63); 10274 dw[1] = v1_address; 10275 dw[2] = (v1_address >> 32) | (v1 >> 32); 10276 10277 dw[3] = 10278 __gen_uint(values->ReportID, 0, 31); 10279} 10280 10281#define GFX125_MI_RS_CONTEXT_length 1 10282#define GFX125_MI_RS_CONTEXT_length_bias 1 10283#define GFX125_MI_RS_CONTEXT_header \ 10284 .MICommandOpcode = 15, \ 10285 .CommandType = 0 10286 10287struct GFX125_MI_RS_CONTEXT { 10288 uint32_t ResourceStreamerSave; 10289#define RS_Restore 0 10290#define RS_Save 1 10291 uint32_t MICommandOpcode; 10292 uint32_t CommandType; 10293}; 10294 10295static inline __attribute__((always_inline)) void 10296GFX125_MI_RS_CONTEXT_pack(__attribute__((unused)) __gen_user_data *data, 10297 __attribute__((unused)) void * restrict dst, 10298 __attribute__((unused)) const struct GFX125_MI_RS_CONTEXT * restrict values) 10299{ 10300 uint32_t * restrict dw = (uint32_t * restrict) dst; 10301 10302 dw[0] = 10303 __gen_uint(values->ResourceStreamerSave, 0, 0) | 10304 __gen_uint(values->MICommandOpcode, 23, 28) | 10305 __gen_uint(values->CommandType, 29, 31); 10306} 10307 10308#define GFX125_MI_RS_CONTROL_length 1 10309#define GFX125_MI_RS_CONTROL_length_bias 1 10310#define GFX125_MI_RS_CONTROL_header \ 10311 .MICommandOpcode = 6, \ 10312 .CommandType = 0 10313 10314struct GFX125_MI_RS_CONTROL { 10315 uint32_t ResourceStreamerControl; 10316#define RS_Stop 0 10317#define RS_Start 1 10318 uint32_t MICommandOpcode; 10319 uint32_t CommandType; 10320}; 10321 10322static inline __attribute__((always_inline)) void 10323GFX125_MI_RS_CONTROL_pack(__attribute__((unused)) __gen_user_data *data, 10324 __attribute__((unused)) void * restrict dst, 10325 __attribute__((unused)) const struct GFX125_MI_RS_CONTROL * restrict values) 10326{ 10327 uint32_t * restrict dw = (uint32_t * restrict) dst; 10328 10329 dw[0] = 10330 __gen_uint(values->ResourceStreamerControl, 0, 0) | 10331 __gen_uint(values->MICommandOpcode, 23, 28) | 10332 __gen_uint(values->CommandType, 29, 31); 10333} 10334 10335#define GFX125_MI_RS_STORE_DATA_IMM_length 4 10336#define GFX125_MI_RS_STORE_DATA_IMM_length_bias 2 10337#define GFX125_MI_RS_STORE_DATA_IMM_header \ 10338 .DWordLength = 2, \ 10339 .MICommandOpcode = 43, \ 10340 .CommandType = 0 10341 10342struct GFX125_MI_RS_STORE_DATA_IMM { 10343 uint32_t DWordLength; 10344 uint32_t MICommandOpcode; 10345 uint32_t CommandType; 10346 uint32_t CoreModeEnable; 10347 __gen_address_type DestinationAddress; 10348 uint32_t DataDWord0; 10349}; 10350 10351static inline __attribute__((always_inline)) void 10352GFX125_MI_RS_STORE_DATA_IMM_pack(__attribute__((unused)) __gen_user_data *data, 10353 __attribute__((unused)) void * restrict dst, 10354 __attribute__((unused)) const struct GFX125_MI_RS_STORE_DATA_IMM * restrict values) 10355{ 10356 uint32_t * restrict dw = (uint32_t * restrict) dst; 10357 10358 dw[0] = 10359 __gen_uint(values->DWordLength, 0, 7) | 10360 __gen_uint(values->MICommandOpcode, 23, 28) | 10361 __gen_uint(values->CommandType, 29, 31); 10362 10363 const uint64_t v1 = 10364 __gen_uint(values->CoreModeEnable, 0, 0); 10365 const uint64_t v1_address = 10366 __gen_address(data, &dw[1], values->DestinationAddress, v1, 2, 63); 10367 dw[1] = v1_address; 10368 dw[2] = (v1_address >> 32) | (v1 >> 32); 10369 10370 dw[3] = 10371 __gen_uint(values->DataDWord0, 0, 31); 10372} 10373 10374#define GFX125_MI_SEMAPHORE_SIGNAL_length 2 10375#define GFX125_MI_SEMAPHORE_SIGNAL_length_bias 2 10376#define GFX125_MI_SEMAPHORE_SIGNAL_header \ 10377 .DWordLength = 0, \ 10378 .MICommandOpcode = 27, \ 10379 .CommandType = 0 10380 10381struct GFX125_MI_SEMAPHORE_SIGNAL { 10382 uint32_t DWordLength; 10383 uint32_t TargetEngineSelect; 10384#define RCS 0 10385#define VCS0 1 10386#define BCS 2 10387#define VECS 3 10388#define VCS1 4 10389#define VCS2 6 10390#define VCS3 7 10391#define VCS4 8 10392#define VCS5 9 10393#define VCS6 10 10394#define VCS7 11 10395#define VECS1 12 10396#define VECS2 13 10397#define VECS3 14 10398 bool PostSyncOperation; 10399 uint32_t MICommandOpcode; 10400 uint32_t CommandType; 10401 uint32_t TargetContextID; 10402}; 10403 10404static inline __attribute__((always_inline)) void 10405GFX125_MI_SEMAPHORE_SIGNAL_pack(__attribute__((unused)) __gen_user_data *data, 10406 __attribute__((unused)) void * restrict dst, 10407 __attribute__((unused)) const struct GFX125_MI_SEMAPHORE_SIGNAL * restrict values) 10408{ 10409 uint32_t * restrict dw = (uint32_t * restrict) dst; 10410 10411 dw[0] = 10412 __gen_uint(values->DWordLength, 0, 7) | 10413 __gen_uint(values->TargetEngineSelect, 15, 18) | 10414 __gen_uint(values->PostSyncOperation, 21, 21) | 10415 __gen_uint(values->MICommandOpcode, 23, 28) | 10416 __gen_uint(values->CommandType, 29, 31); 10417 10418 dw[1] = 10419 __gen_uint(values->TargetContextID, 0, 31); 10420} 10421 10422#define GFX125_MI_SEMAPHORE_WAIT_length 4 10423#define GFX125_MI_SEMAPHORE_WAIT_length_bias 2 10424#define GFX125_MI_SEMAPHORE_WAIT_header \ 10425 .DWordLength = 2, \ 10426 .MICommandOpcode = 28, \ 10427 .CommandType = 0 10428 10429struct GFX125_MI_SEMAPHORE_WAIT { 10430 uint32_t DWordLength; 10431 uint32_t CompareOperation; 10432#define COMPARE_SAD_GREATER_THAN_SDD 0 10433#define COMPARE_SAD_GREATER_THAN_OR_EQUAL_SDD 1 10434#define COMPARE_SAD_LESS_THAN_SDD 2 10435#define COMPARE_SAD_LESS_THAN_OR_EQUAL_SDD 3 10436#define COMPARE_SAD_EQUAL_SDD 4 10437#define COMPARE_SAD_NOT_EQUAL_SDD 5 10438 uint32_t WaitMode; 10439#define PollingMode 1 10440#define SignalMode 0 10441 bool RegisterPollMode; 10442 uint32_t MemoryType; 10443#define PerProcessGraphicsAddress 0 10444#define GlobalGraphicsAddress 1 10445 uint32_t MICommandOpcode; 10446 uint32_t CommandType; 10447 uint32_t SemaphoreDataDword; 10448 __gen_address_type SemaphoreAddress; 10449}; 10450 10451static inline __attribute__((always_inline)) void 10452GFX125_MI_SEMAPHORE_WAIT_pack(__attribute__((unused)) __gen_user_data *data, 10453 __attribute__((unused)) void * restrict dst, 10454 __attribute__((unused)) const struct GFX125_MI_SEMAPHORE_WAIT * restrict values) 10455{ 10456 uint32_t * restrict dw = (uint32_t * restrict) dst; 10457 10458 dw[0] = 10459 __gen_uint(values->DWordLength, 0, 7) | 10460 __gen_uint(values->CompareOperation, 12, 14) | 10461 __gen_uint(values->WaitMode, 15, 15) | 10462 __gen_uint(values->RegisterPollMode, 16, 16) | 10463 __gen_uint(values->MemoryType, 22, 22) | 10464 __gen_uint(values->MICommandOpcode, 23, 28) | 10465 __gen_uint(values->CommandType, 29, 31); 10466 10467 dw[1] = 10468 __gen_uint(values->SemaphoreDataDword, 0, 31); 10469 10470 const uint64_t v2_address = 10471 __gen_address(data, &dw[2], values->SemaphoreAddress, 0, 2, 63); 10472 dw[2] = v2_address; 10473 dw[3] = v2_address >> 32; 10474} 10475 10476#define GFX125_MI_SET_APPID_length 1 10477#define GFX125_MI_SET_APPID_length_bias 1 10478#define GFX125_MI_SET_APPID_header \ 10479 .MICommandOpcode = 14, \ 10480 .CommandType = 0 10481 10482struct GFX125_MI_SET_APPID { 10483 uint32_t ProtectedMemoryApplicationID; 10484 uint32_t ProtectedMemoryApplicationIDType; 10485#define DISPLAY_APP 0 10486#define TRANSCODE_APP 1 10487 uint32_t MICommandOpcode; 10488 uint32_t CommandType; 10489}; 10490 10491static inline __attribute__((always_inline)) void 10492GFX125_MI_SET_APPID_pack(__attribute__((unused)) __gen_user_data *data, 10493 __attribute__((unused)) void * restrict dst, 10494 __attribute__((unused)) const struct GFX125_MI_SET_APPID * restrict values) 10495{ 10496 uint32_t * restrict dw = (uint32_t * restrict) dst; 10497 10498 dw[0] = 10499 __gen_uint(values->ProtectedMemoryApplicationID, 0, 6) | 10500 __gen_uint(values->ProtectedMemoryApplicationIDType, 7, 7) | 10501 __gen_uint(values->MICommandOpcode, 23, 28) | 10502 __gen_uint(values->CommandType, 29, 31); 10503} 10504 10505#define GFX125_MI_SET_CONTEXT_length 2 10506#define GFX125_MI_SET_CONTEXT_length_bias 2 10507#define GFX125_MI_SET_CONTEXT_header \ 10508 .DWordLength = 0, \ 10509 .MICommandOpcode = 24, \ 10510 .CommandType = 0 10511 10512struct GFX125_MI_SET_CONTEXT { 10513 uint32_t DWordLength; 10514 uint32_t MICommandOpcode; 10515 uint32_t CommandType; 10516 uint32_t RestoreInhibit; 10517 uint32_t ForceRestore; 10518 bool ResourceStreamerStateRestoreEnable; 10519 bool ResourceStreamerStateSaveEnable; 10520 bool CoreModeEnable; 10521 uint32_t ReservedMustbe1; 10522 __gen_address_type LogicalContextAddress; 10523}; 10524 10525static inline __attribute__((always_inline)) void 10526GFX125_MI_SET_CONTEXT_pack(__attribute__((unused)) __gen_user_data *data, 10527 __attribute__((unused)) void * restrict dst, 10528 __attribute__((unused)) const struct GFX125_MI_SET_CONTEXT * restrict values) 10529{ 10530 uint32_t * restrict dw = (uint32_t * restrict) dst; 10531 10532 dw[0] = 10533 __gen_uint(values->DWordLength, 0, 7) | 10534 __gen_uint(values->MICommandOpcode, 23, 28) | 10535 __gen_uint(values->CommandType, 29, 31); 10536 10537 const uint32_t v1 = 10538 __gen_uint(values->RestoreInhibit, 0, 0) | 10539 __gen_uint(values->ForceRestore, 1, 1) | 10540 __gen_uint(values->ResourceStreamerStateRestoreEnable, 2, 2) | 10541 __gen_uint(values->ResourceStreamerStateSaveEnable, 3, 3) | 10542 __gen_uint(values->CoreModeEnable, 4, 4) | 10543 __gen_uint(values->ReservedMustbe1, 8, 8); 10544 dw[1] = __gen_address(data, &dw[1], values->LogicalContextAddress, v1, 12, 31); 10545} 10546 10547#define GFX125_MI_SET_PREDICATE_length 1 10548#define GFX125_MI_SET_PREDICATE_length_bias 1 10549#define GFX125_MI_SET_PREDICATE_header \ 10550 .MICommandOpcode = 1, \ 10551 .CommandType = 0 10552 10553struct GFX125_MI_SET_PREDICATE { 10554 uint32_t PredicateEnable; 10555#define NOOPNever 0 10556#define NOOPOnResult2Clear 1 10557#define NOOPOnResult2Set 2 10558#define NOOPOnResultClear 3 10559#define NOOPOnResultSet 4 10560#define NOOPAlways 15 10561 uint32_t MICommandOpcode; 10562 uint32_t CommandType; 10563}; 10564 10565static inline __attribute__((always_inline)) void 10566GFX125_MI_SET_PREDICATE_pack(__attribute__((unused)) __gen_user_data *data, 10567 __attribute__((unused)) void * restrict dst, 10568 __attribute__((unused)) const struct GFX125_MI_SET_PREDICATE * restrict values) 10569{ 10570 uint32_t * restrict dw = (uint32_t * restrict) dst; 10571 10572 dw[0] = 10573 __gen_uint(values->PredicateEnable, 0, 3) | 10574 __gen_uint(values->MICommandOpcode, 23, 28) | 10575 __gen_uint(values->CommandType, 29, 31); 10576} 10577 10578#define GFX125_MI_STORE_DATA_IMM_length 4 10579#define GFX125_MI_STORE_DATA_IMM_length_bias 2 10580#define GFX125_MI_STORE_DATA_IMM_header \ 10581 .DWordLength = 2, \ 10582 .MICommandOpcode = 32, \ 10583 .CommandType = 0 10584 10585struct GFX125_MI_STORE_DATA_IMM { 10586 uint32_t DWordLength; 10587 bool ForceWriteCompletionCheck; 10588 uint32_t StoreQword; 10589 bool UseGlobalGTT; 10590 uint32_t MICommandOpcode; 10591 uint32_t CommandType; 10592 uint32_t CoreModeEnable; 10593 __gen_address_type Address; 10594 uint64_t ImmediateData; 10595}; 10596 10597static inline __attribute__((always_inline)) void 10598GFX125_MI_STORE_DATA_IMM_pack(__attribute__((unused)) __gen_user_data *data, 10599 __attribute__((unused)) void * restrict dst, 10600 __attribute__((unused)) const struct GFX125_MI_STORE_DATA_IMM * restrict values) 10601{ 10602 uint32_t * restrict dw = (uint32_t * restrict) dst; 10603 10604 dw[0] = 10605 __gen_uint(values->DWordLength, 0, 9) | 10606 __gen_uint(values->ForceWriteCompletionCheck, 10, 10) | 10607 __gen_uint(values->StoreQword, 21, 21) | 10608 __gen_uint(values->UseGlobalGTT, 22, 22) | 10609 __gen_uint(values->MICommandOpcode, 23, 28) | 10610 __gen_uint(values->CommandType, 29, 31); 10611 10612 const uint64_t v1 = 10613 __gen_uint(values->CoreModeEnable, 0, 0); 10614 const uint64_t v1_address = 10615 __gen_address(data, &dw[1], values->Address, v1, 2, 47); 10616 dw[1] = v1_address; 10617 dw[2] = (v1_address >> 32) | (v1 >> 32); 10618 10619 const uint64_t v3 = 10620 __gen_uint(values->ImmediateData, 0, 63); 10621 dw[3] = v3; 10622 dw[4] = v3 >> 32; 10623} 10624 10625#define GFX125_MI_STORE_DATA_INDEX_length 3 10626#define GFX125_MI_STORE_DATA_INDEX_length_bias 2 10627#define GFX125_MI_STORE_DATA_INDEX_header \ 10628 .DWordLength = 1, \ 10629 .MICommandOpcode = 33, \ 10630 .CommandType = 0 10631 10632struct GFX125_MI_STORE_DATA_INDEX { 10633 uint32_t DWordLength; 10634 uint32_t UsePerProcessHardwareStatusPage; 10635 uint32_t MICommandOpcode; 10636 uint32_t CommandType; 10637 uint32_t Offset; 10638 uint32_t DataDWord0; 10639 uint32_t DataDWord1; 10640}; 10641 10642static inline __attribute__((always_inline)) void 10643GFX125_MI_STORE_DATA_INDEX_pack(__attribute__((unused)) __gen_user_data *data, 10644 __attribute__((unused)) void * restrict dst, 10645 __attribute__((unused)) const struct GFX125_MI_STORE_DATA_INDEX * restrict values) 10646{ 10647 uint32_t * restrict dw = (uint32_t * restrict) dst; 10648 10649 dw[0] = 10650 __gen_uint(values->DWordLength, 0, 7) | 10651 __gen_uint(values->UsePerProcessHardwareStatusPage, 21, 21) | 10652 __gen_uint(values->MICommandOpcode, 23, 28) | 10653 __gen_uint(values->CommandType, 29, 31); 10654 10655 dw[1] = 10656 __gen_uint(values->Offset, 2, 11); 10657 10658 dw[2] = 10659 __gen_uint(values->DataDWord0, 0, 31); 10660} 10661 10662#define GFX125_MI_STORE_REGISTER_MEM_length 4 10663#define GFX125_MI_STORE_REGISTER_MEM_length_bias 2 10664#define GFX125_MI_STORE_REGISTER_MEM_header \ 10665 .DWordLength = 2, \ 10666 .MICommandOpcode = 36, \ 10667 .CommandType = 0 10668 10669struct GFX125_MI_STORE_REGISTER_MEM { 10670 uint32_t DWordLength; 10671 uint32_t AddCSMMIOStartOffset; 10672 bool PredicateEnable; 10673 bool UseGlobalGTT; 10674 uint32_t MICommandOpcode; 10675 uint32_t CommandType; 10676 uint64_t RegisterAddress; 10677 __gen_address_type MemoryAddress; 10678}; 10679 10680static inline __attribute__((always_inline)) void 10681GFX125_MI_STORE_REGISTER_MEM_pack(__attribute__((unused)) __gen_user_data *data, 10682 __attribute__((unused)) void * restrict dst, 10683 __attribute__((unused)) const struct GFX125_MI_STORE_REGISTER_MEM * restrict values) 10684{ 10685 uint32_t * restrict dw = (uint32_t * restrict) dst; 10686 10687 dw[0] = 10688 __gen_uint(values->DWordLength, 0, 7) | 10689 __gen_uint(values->AddCSMMIOStartOffset, 19, 19) | 10690 __gen_uint(values->PredicateEnable, 21, 21) | 10691 __gen_uint(values->UseGlobalGTT, 22, 22) | 10692 __gen_uint(values->MICommandOpcode, 23, 28) | 10693 __gen_uint(values->CommandType, 29, 31); 10694 10695 dw[1] = 10696 __gen_offset(values->RegisterAddress, 2, 22); 10697 10698 const uint64_t v2_address = 10699 __gen_address(data, &dw[2], values->MemoryAddress, 0, 2, 63); 10700 dw[2] = v2_address; 10701 dw[3] = v2_address >> 32; 10702} 10703 10704#define GFX125_MI_SUSPEND_FLUSH_length 1 10705#define GFX125_MI_SUSPEND_FLUSH_length_bias 1 10706#define GFX125_MI_SUSPEND_FLUSH_header \ 10707 .MICommandOpcode = 11, \ 10708 .CommandType = 0 10709 10710struct GFX125_MI_SUSPEND_FLUSH { 10711 bool SuspendFlush; 10712 uint32_t MICommandOpcode; 10713 uint32_t CommandType; 10714}; 10715 10716static inline __attribute__((always_inline)) void 10717GFX125_MI_SUSPEND_FLUSH_pack(__attribute__((unused)) __gen_user_data *data, 10718 __attribute__((unused)) void * restrict dst, 10719 __attribute__((unused)) const struct GFX125_MI_SUSPEND_FLUSH * restrict values) 10720{ 10721 uint32_t * restrict dw = (uint32_t * restrict) dst; 10722 10723 dw[0] = 10724 __gen_uint(values->SuspendFlush, 0, 0) | 10725 __gen_uint(values->MICommandOpcode, 23, 28) | 10726 __gen_uint(values->CommandType, 29, 31); 10727} 10728 10729#define GFX125_MI_TOPOLOGY_FILTER_length 1 10730#define GFX125_MI_TOPOLOGY_FILTER_length_bias 1 10731#define GFX125_MI_TOPOLOGY_FILTER_header \ 10732 .MICommandOpcode = 13, \ 10733 .CommandType = 0 10734 10735struct GFX125_MI_TOPOLOGY_FILTER { 10736 enum GFX125_3D_Prim_Topo_Type TopologyFilterValue; 10737 uint32_t MICommandOpcode; 10738 uint32_t CommandType; 10739}; 10740 10741static inline __attribute__((always_inline)) void 10742GFX125_MI_TOPOLOGY_FILTER_pack(__attribute__((unused)) __gen_user_data *data, 10743 __attribute__((unused)) void * restrict dst, 10744 __attribute__((unused)) const struct GFX125_MI_TOPOLOGY_FILTER * restrict values) 10745{ 10746 uint32_t * restrict dw = (uint32_t * restrict) dst; 10747 10748 dw[0] = 10749 __gen_uint(values->TopologyFilterValue, 0, 5) | 10750 __gen_uint(values->MICommandOpcode, 23, 28) | 10751 __gen_uint(values->CommandType, 29, 31); 10752} 10753 10754#define GFX125_MI_USER_INTERRUPT_length 1 10755#define GFX125_MI_USER_INTERRUPT_length_bias 1 10756#define GFX125_MI_USER_INTERRUPT_header \ 10757 .MICommandOpcode = 2, \ 10758 .CommandType = 0 10759 10760struct GFX125_MI_USER_INTERRUPT { 10761 uint32_t MICommandOpcode; 10762 uint32_t CommandType; 10763}; 10764 10765static inline __attribute__((always_inline)) void 10766GFX125_MI_USER_INTERRUPT_pack(__attribute__((unused)) __gen_user_data *data, 10767 __attribute__((unused)) void * restrict dst, 10768 __attribute__((unused)) const struct GFX125_MI_USER_INTERRUPT * restrict values) 10769{ 10770 uint32_t * restrict dw = (uint32_t * restrict) dst; 10771 10772 dw[0] = 10773 __gen_uint(values->MICommandOpcode, 23, 28) | 10774 __gen_uint(values->CommandType, 29, 31); 10775} 10776 10777#define GFX125_MI_WAIT_FOR_EVENT_length 1 10778#define GFX125_MI_WAIT_FOR_EVENT_length_bias 1 10779#define GFX125_MI_WAIT_FOR_EVENT_header \ 10780 .MICommandOpcode = 3, \ 10781 .CommandType = 0 10782 10783struct GFX125_MI_WAIT_FOR_EVENT { 10784 bool DisplayPlnae1AScanLineWaitEnable; 10785 bool DisplayPlane1FlipPendingWaitEnable; 10786 bool DisplayPlane4FlipPendingWaitEnable; 10787 bool DisplayPlane1AVerticalBlankWaitEnable; 10788 bool DisplayPlane7FlipPendingWaitEnable; 10789 bool DisplayPlane8FlipPendingWaitEnable; 10790 bool DisplayPlane1BScanLineWaitEnable; 10791 bool DisplayPlane2FlipPendingWaitEnable; 10792 bool DisplayPlane5FlipPendingWaitEnable; 10793 bool DisplayPlane1BVerticalBlankWaitEnable; 10794 bool DisplayPlane1CScanLineWaitEnable; 10795 bool DisplayPlane3FlipPendingWaitEnable; 10796 bool DisplayPlane9FlipPendingWaitEnable; 10797 bool DisplayPlane10FlipPendingWaitEnable; 10798 bool DisplayPlane11FlipPendingWaitEnable; 10799 bool DisplayPlane12FlipPendingWaitEnable; 10800 bool DisplayPlane6FlipPendingWaitEnable; 10801 bool DisplayPlane1CVerticalBlankWaitEnable; 10802 uint32_t MICommandOpcode; 10803 uint32_t CommandType; 10804}; 10805 10806static inline __attribute__((always_inline)) void 10807GFX125_MI_WAIT_FOR_EVENT_pack(__attribute__((unused)) __gen_user_data *data, 10808 __attribute__((unused)) void * restrict dst, 10809 __attribute__((unused)) const struct GFX125_MI_WAIT_FOR_EVENT * restrict values) 10810{ 10811 uint32_t * restrict dw = (uint32_t * restrict) dst; 10812 10813 dw[0] = 10814 __gen_uint(values->DisplayPlnae1AScanLineWaitEnable, 0, 0) | 10815 __gen_uint(values->DisplayPlane1FlipPendingWaitEnable, 1, 1) | 10816 __gen_uint(values->DisplayPlane4FlipPendingWaitEnable, 2, 2) | 10817 __gen_uint(values->DisplayPlane1AVerticalBlankWaitEnable, 3, 3) | 10818 __gen_uint(values->DisplayPlane7FlipPendingWaitEnable, 6, 6) | 10819 __gen_uint(values->DisplayPlane8FlipPendingWaitEnable, 7, 7) | 10820 __gen_uint(values->DisplayPlane1BScanLineWaitEnable, 8, 8) | 10821 __gen_uint(values->DisplayPlane2FlipPendingWaitEnable, 9, 9) | 10822 __gen_uint(values->DisplayPlane5FlipPendingWaitEnable, 10, 10) | 10823 __gen_uint(values->DisplayPlane1BVerticalBlankWaitEnable, 11, 11) | 10824 __gen_uint(values->DisplayPlane1CScanLineWaitEnable, 14, 14) | 10825 __gen_uint(values->DisplayPlane3FlipPendingWaitEnable, 15, 15) | 10826 __gen_uint(values->DisplayPlane9FlipPendingWaitEnable, 16, 16) | 10827 __gen_uint(values->DisplayPlane10FlipPendingWaitEnable, 17, 17) | 10828 __gen_uint(values->DisplayPlane11FlipPendingWaitEnable, 18, 18) | 10829 __gen_uint(values->DisplayPlane12FlipPendingWaitEnable, 19, 19) | 10830 __gen_uint(values->DisplayPlane6FlipPendingWaitEnable, 20, 20) | 10831 __gen_uint(values->DisplayPlane1CVerticalBlankWaitEnable, 21, 21) | 10832 __gen_uint(values->MICommandOpcode, 23, 28) | 10833 __gen_uint(values->CommandType, 29, 31); 10834} 10835 10836#define GFX125_MI_WAIT_FOR_EVENT_2_length 1 10837#define GFX125_MI_WAIT_FOR_EVENT_2_length_bias 1 10838#define GFX125_MI_WAIT_FOR_EVENT_2_header \ 10839 .MICommandOpcode = 4, \ 10840 .CommandType = 0 10841 10842struct GFX125_MI_WAIT_FOR_EVENT_2 { 10843 uint32_t DisplayPlaneFlipPendingWaitEnable; 10844 uint32_t DisplayPipeVerticalBlankWaitEnable; 10845 uint32_t DisplayPipeScanLineWaitEnable; 10846 uint32_t MICommandOpcode; 10847 uint32_t CommandType; 10848}; 10849 10850static inline __attribute__((always_inline)) void 10851GFX125_MI_WAIT_FOR_EVENT_2_pack(__attribute__((unused)) __gen_user_data *data, 10852 __attribute__((unused)) void * restrict dst, 10853 __attribute__((unused)) const struct GFX125_MI_WAIT_FOR_EVENT_2 * restrict values) 10854{ 10855 uint32_t * restrict dw = (uint32_t * restrict) dst; 10856 10857 dw[0] = 10858 __gen_uint(values->DisplayPlaneFlipPendingWaitEnable, 0, 5) | 10859 __gen_uint(values->DisplayPipeVerticalBlankWaitEnable, 8, 10) | 10860 __gen_uint(values->DisplayPipeScanLineWaitEnable, 12, 14) | 10861 __gen_uint(values->MICommandOpcode, 23, 28) | 10862 __gen_uint(values->CommandType, 29, 31); 10863} 10864 10865#define GFX125_PIPELINE_SELECT_length 1 10866#define GFX125_PIPELINE_SELECT_length_bias 1 10867#define GFX125_PIPELINE_SELECT_header \ 10868 ._3DCommandSubOpcode = 4, \ 10869 ._3DCommandOpcode = 1, \ 10870 .CommandSubType = 1, \ 10871 .CommandType = 3 10872 10873struct GFX125_PIPELINE_SELECT { 10874 uint32_t PipelineSelection; 10875#define _3D 0 10876#define Media 1 10877#define GPGPU 2 10878 bool MediaSamplerDOPClockGateEnable; 10879 bool ForceMediaAwake; 10880 uint32_t MaskBits; 10881 uint32_t _3DCommandSubOpcode; 10882 uint32_t _3DCommandOpcode; 10883 uint32_t CommandSubType; 10884 uint32_t CommandType; 10885}; 10886 10887static inline __attribute__((always_inline)) void 10888GFX125_PIPELINE_SELECT_pack(__attribute__((unused)) __gen_user_data *data, 10889 __attribute__((unused)) void * restrict dst, 10890 __attribute__((unused)) const struct GFX125_PIPELINE_SELECT * restrict values) 10891{ 10892 uint32_t * restrict dw = (uint32_t * restrict) dst; 10893 10894 dw[0] = 10895 __gen_uint(values->PipelineSelection, 0, 1) | 10896 __gen_uint(values->MediaSamplerDOPClockGateEnable, 4, 4) | 10897 __gen_uint(values->ForceMediaAwake, 5, 5) | 10898 __gen_uint(values->MaskBits, 8, 15) | 10899 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 10900 __gen_uint(values->_3DCommandOpcode, 24, 26) | 10901 __gen_uint(values->CommandSubType, 27, 28) | 10902 __gen_uint(values->CommandType, 29, 31); 10903} 10904 10905#define GFX125_PIPE_CONTROL_length 6 10906#define GFX125_PIPE_CONTROL_length_bias 2 10907#define GFX125_PIPE_CONTROL_header \ 10908 .DWordLength = 4, \ 10909 ._3DCommandSubOpcode = 0, \ 10910 ._3DCommandOpcode = 2, \ 10911 .CommandSubType = 3, \ 10912 .CommandType = 3 10913 10914struct GFX125_PIPE_CONTROL { 10915 uint32_t DWordLength; 10916 bool HDCPipelineFlushEnable; 10917 bool L3ReadOnlyCacheInvalidationEnable; 10918 uint32_t _3DCommandSubOpcode; 10919 uint32_t _3DCommandOpcode; 10920 uint32_t CommandSubType; 10921 uint32_t CommandType; 10922 bool DepthCacheFlushEnable; 10923 bool StallAtPixelScoreboard; 10924 bool StateCacheInvalidationEnable; 10925 bool ConstantCacheInvalidationEnable; 10926 bool VFCacheInvalidationEnable; 10927 bool DCFlushEnable; 10928 bool PipeControlFlushEnable; 10929 bool NotifyEnable; 10930 bool IndirectStatePointersDisable; 10931 bool TextureCacheInvalidationEnable; 10932 bool InstructionCacheInvalidateEnable; 10933 bool RenderTargetCacheFlushEnable; 10934 bool DepthStallEnable; 10935 uint32_t PostSyncOperation; 10936#define NoWrite 0 10937#define WriteImmediateData 1 10938#define WritePSDepthCount 2 10939#define WriteTimestamp 3 10940 bool GenericMediaStateClear; 10941 bool PSDSyncEnable; 10942 bool TLBInvalidate; 10943 bool GlobalSnapshotCountReset; 10944 bool CommandStreamerStallEnable; 10945 uint32_t StoreDataIndex; 10946 bool ProtectedMemoryEnable; 10947 uint32_t LRIPostSyncOperation; 10948#define NoLRIOperation 0 10949#define MMIOWriteImmediateData 1 10950 uint32_t DestinationAddressType; 10951#define DAT_PPGTT 0 10952#define DAT_GGTT 1 10953 bool FlushLLC; 10954 bool ProtectedMemoryDisable; 10955 bool TileCacheFlushEnable; 10956 bool CommandCacheInvalidateEnable; 10957 __gen_address_type Address; 10958 uint64_t ImmediateData; 10959}; 10960 10961static inline __attribute__((always_inline)) void 10962GFX125_PIPE_CONTROL_pack(__attribute__((unused)) __gen_user_data *data, 10963 __attribute__((unused)) void * restrict dst, 10964 __attribute__((unused)) const struct GFX125_PIPE_CONTROL * restrict values) 10965{ 10966 uint32_t * restrict dw = (uint32_t * restrict) dst; 10967 10968 dw[0] = 10969 __gen_uint(values->DWordLength, 0, 7) | 10970 __gen_uint(values->HDCPipelineFlushEnable, 9, 9) | 10971 __gen_uint(values->L3ReadOnlyCacheInvalidationEnable, 10, 10) | 10972 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 10973 __gen_uint(values->_3DCommandOpcode, 24, 26) | 10974 __gen_uint(values->CommandSubType, 27, 28) | 10975 __gen_uint(values->CommandType, 29, 31); 10976 10977 dw[1] = 10978 __gen_uint(values->DepthCacheFlushEnable, 0, 0) | 10979 __gen_uint(values->StallAtPixelScoreboard, 1, 1) | 10980 __gen_uint(values->StateCacheInvalidationEnable, 2, 2) | 10981 __gen_uint(values->ConstantCacheInvalidationEnable, 3, 3) | 10982 __gen_uint(values->VFCacheInvalidationEnable, 4, 4) | 10983 __gen_uint(values->DCFlushEnable, 5, 5) | 10984 __gen_uint(values->PipeControlFlushEnable, 7, 7) | 10985 __gen_uint(values->NotifyEnable, 8, 8) | 10986 __gen_uint(values->IndirectStatePointersDisable, 9, 9) | 10987 __gen_uint(values->TextureCacheInvalidationEnable, 10, 10) | 10988 __gen_uint(values->InstructionCacheInvalidateEnable, 11, 11) | 10989 __gen_uint(values->RenderTargetCacheFlushEnable, 12, 12) | 10990 __gen_uint(values->DepthStallEnable, 13, 13) | 10991 __gen_uint(values->PostSyncOperation, 14, 15) | 10992 __gen_uint(values->GenericMediaStateClear, 16, 16) | 10993 __gen_uint(values->PSDSyncEnable, 17, 17) | 10994 __gen_uint(values->TLBInvalidate, 18, 18) | 10995 __gen_uint(values->GlobalSnapshotCountReset, 19, 19) | 10996 __gen_uint(values->CommandStreamerStallEnable, 20, 20) | 10997 __gen_uint(values->StoreDataIndex, 21, 21) | 10998 __gen_uint(values->ProtectedMemoryEnable, 22, 22) | 10999 __gen_uint(values->LRIPostSyncOperation, 23, 23) | 11000 __gen_uint(values->DestinationAddressType, 24, 24) | 11001 __gen_uint(values->FlushLLC, 26, 26) | 11002 __gen_uint(values->ProtectedMemoryDisable, 27, 27) | 11003 __gen_uint(values->TileCacheFlushEnable, 28, 28) | 11004 __gen_uint(values->CommandCacheInvalidateEnable, 29, 29); 11005 11006 const uint64_t v2_address = 11007 __gen_address(data, &dw[2], values->Address, 0, 2, 47); 11008 dw[2] = v2_address; 11009 dw[3] = v2_address >> 32; 11010 11011 const uint64_t v4 = 11012 __gen_uint(values->ImmediateData, 0, 63); 11013 dw[4] = v4; 11014 dw[5] = v4 >> 32; 11015} 11016 11017#define GFX125_STATE_BASE_ADDRESS_length 22 11018#define GFX125_STATE_BASE_ADDRESS_length_bias 2 11019#define GFX125_STATE_BASE_ADDRESS_header \ 11020 .DWordLength = 20, \ 11021 ._3DCommandSubOpcode = 1, \ 11022 ._3DCommandOpcode = 1, \ 11023 .CommandSubType = 0, \ 11024 .CommandType = 3 11025 11026struct GFX125_STATE_BASE_ADDRESS { 11027 uint32_t DWordLength; 11028 uint32_t _3DCommandSubOpcode; 11029 uint32_t _3DCommandOpcode; 11030 uint32_t CommandSubType; 11031 uint32_t CommandType; 11032 bool GeneralStateBaseAddressModifyEnable; 11033 uint32_t GeneralStateMOCS; 11034 __gen_address_type GeneralStateBaseAddress; 11035 uint32_t StatelessDataPortAccessMOCS; 11036 bool SurfaceStateBaseAddressModifyEnable; 11037 uint32_t SurfaceStateMOCS; 11038 __gen_address_type SurfaceStateBaseAddress; 11039 bool DynamicStateBaseAddressModifyEnable; 11040 uint32_t DynamicStateMOCS; 11041 __gen_address_type DynamicStateBaseAddress; 11042 bool IndirectObjectBaseAddressModifyEnable; 11043 uint32_t IndirectObjectMOCS; 11044 __gen_address_type IndirectObjectBaseAddress; 11045 bool InstructionBaseAddressModifyEnable; 11046 uint32_t InstructionMOCS; 11047 __gen_address_type InstructionBaseAddress; 11048 bool GeneralStateBufferSizeModifyEnable; 11049 uint32_t GeneralStateBufferSize; 11050 bool DynamicStateBufferSizeModifyEnable; 11051 uint32_t DynamicStateBufferSize; 11052 bool IndirectObjectBufferSizeModifyEnable; 11053 uint32_t IndirectObjectBufferSize; 11054 bool InstructionBuffersizeModifyEnable; 11055 uint32_t InstructionBufferSize; 11056 bool BindlessSurfaceStateBaseAddressModifyEnable; 11057 uint32_t BindlessSurfaceStateMOCS; 11058 __gen_address_type BindlessSurfaceStateBaseAddress; 11059 uint32_t BindlessSurfaceStateSize; 11060 bool BindlessSamplerStateBaseAddressModifyEnable; 11061 uint32_t BindlessSamplerStateMOCS; 11062 __gen_address_type BindlessSamplerStateBaseAddress; 11063 uint32_t BindlessSamplerStateBufferSize; 11064}; 11065 11066static inline __attribute__((always_inline)) void 11067GFX125_STATE_BASE_ADDRESS_pack(__attribute__((unused)) __gen_user_data *data, 11068 __attribute__((unused)) void * restrict dst, 11069 __attribute__((unused)) const struct GFX125_STATE_BASE_ADDRESS * restrict values) 11070{ 11071 uint32_t * restrict dw = (uint32_t * restrict) dst; 11072 11073 dw[0] = 11074 __gen_uint(values->DWordLength, 0, 7) | 11075 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 11076 __gen_uint(values->_3DCommandOpcode, 24, 26) | 11077 __gen_uint(values->CommandSubType, 27, 28) | 11078 __gen_uint(values->CommandType, 29, 31); 11079 11080 const uint64_t v1 = 11081 __gen_uint(values->GeneralStateBaseAddressModifyEnable, 0, 0) | 11082 __gen_uint(values->GeneralStateMOCS, 4, 10); 11083 const uint64_t v1_address = 11084 __gen_address(data, &dw[1], values->GeneralStateBaseAddress, v1, 12, 63); 11085 dw[1] = v1_address; 11086 dw[2] = (v1_address >> 32) | (v1 >> 32); 11087 11088 dw[3] = 11089 __gen_uint(values->StatelessDataPortAccessMOCS, 16, 22); 11090 11091 const uint64_t v4 = 11092 __gen_uint(values->SurfaceStateBaseAddressModifyEnable, 0, 0) | 11093 __gen_uint(values->SurfaceStateMOCS, 4, 10); 11094 const uint64_t v4_address = 11095 __gen_address(data, &dw[4], values->SurfaceStateBaseAddress, v4, 12, 63); 11096 dw[4] = v4_address; 11097 dw[5] = (v4_address >> 32) | (v4 >> 32); 11098 11099 const uint64_t v6 = 11100 __gen_uint(values->DynamicStateBaseAddressModifyEnable, 0, 0) | 11101 __gen_uint(values->DynamicStateMOCS, 4, 10); 11102 const uint64_t v6_address = 11103 __gen_address(data, &dw[6], values->DynamicStateBaseAddress, v6, 12, 63); 11104 dw[6] = v6_address; 11105 dw[7] = (v6_address >> 32) | (v6 >> 32); 11106 11107 const uint64_t v8 = 11108 __gen_uint(values->IndirectObjectBaseAddressModifyEnable, 0, 0) | 11109 __gen_uint(values->IndirectObjectMOCS, 4, 10); 11110 const uint64_t v8_address = 11111 __gen_address(data, &dw[8], values->IndirectObjectBaseAddress, v8, 12, 63); 11112 dw[8] = v8_address; 11113 dw[9] = (v8_address >> 32) | (v8 >> 32); 11114 11115 const uint64_t v10 = 11116 __gen_uint(values->InstructionBaseAddressModifyEnable, 0, 0) | 11117 __gen_uint(values->InstructionMOCS, 4, 10); 11118 const uint64_t v10_address = 11119 __gen_address(data, &dw[10], values->InstructionBaseAddress, v10, 12, 63); 11120 dw[10] = v10_address; 11121 dw[11] = (v10_address >> 32) | (v10 >> 32); 11122 11123 dw[12] = 11124 __gen_uint(values->GeneralStateBufferSizeModifyEnable, 0, 0) | 11125 __gen_uint(values->GeneralStateBufferSize, 12, 31); 11126 11127 dw[13] = 11128 __gen_uint(values->DynamicStateBufferSizeModifyEnable, 0, 0) | 11129 __gen_uint(values->DynamicStateBufferSize, 12, 31); 11130 11131 dw[14] = 11132 __gen_uint(values->IndirectObjectBufferSizeModifyEnable, 0, 0) | 11133 __gen_uint(values->IndirectObjectBufferSize, 12, 31); 11134 11135 dw[15] = 11136 __gen_uint(values->InstructionBuffersizeModifyEnable, 0, 0) | 11137 __gen_uint(values->InstructionBufferSize, 12, 31); 11138 11139 const uint64_t v16 = 11140 __gen_uint(values->BindlessSurfaceStateBaseAddressModifyEnable, 0, 0) | 11141 __gen_uint(values->BindlessSurfaceStateMOCS, 4, 10); 11142 const uint64_t v16_address = 11143 __gen_address(data, &dw[16], values->BindlessSurfaceStateBaseAddress, v16, 12, 63); 11144 dw[16] = v16_address; 11145 dw[17] = (v16_address >> 32) | (v16 >> 32); 11146 11147 dw[18] = 11148 __gen_uint(values->BindlessSurfaceStateSize, 12, 31); 11149 11150 const uint64_t v19 = 11151 __gen_uint(values->BindlessSamplerStateBaseAddressModifyEnable, 0, 0) | 11152 __gen_uint(values->BindlessSamplerStateMOCS, 4, 10); 11153 const uint64_t v19_address = 11154 __gen_address(data, &dw[19], values->BindlessSamplerStateBaseAddress, v19, 12, 63); 11155 dw[19] = v19_address; 11156 dw[20] = (v19_address >> 32) | (v19 >> 32); 11157 11158 dw[21] = 11159 __gen_uint(values->BindlessSamplerStateBufferSize, 12, 31); 11160} 11161 11162#define GFX125_STATE_SIP_length 3 11163#define GFX125_STATE_SIP_length_bias 2 11164#define GFX125_STATE_SIP_header \ 11165 .DWordLength = 1, \ 11166 ._3DCommandSubOpcode = 2, \ 11167 ._3DCommandOpcode = 1, \ 11168 .CommandSubType = 0, \ 11169 .CommandType = 3 11170 11171struct GFX125_STATE_SIP { 11172 uint32_t DWordLength; 11173 uint32_t _3DCommandSubOpcode; 11174 uint32_t _3DCommandOpcode; 11175 uint32_t CommandSubType; 11176 uint32_t CommandType; 11177 uint64_t SystemInstructionPointer; 11178}; 11179 11180static inline __attribute__((always_inline)) void 11181GFX125_STATE_SIP_pack(__attribute__((unused)) __gen_user_data *data, 11182 __attribute__((unused)) void * restrict dst, 11183 __attribute__((unused)) const struct GFX125_STATE_SIP * restrict values) 11184{ 11185 uint32_t * restrict dw = (uint32_t * restrict) dst; 11186 11187 dw[0] = 11188 __gen_uint(values->DWordLength, 0, 7) | 11189 __gen_uint(values->_3DCommandSubOpcode, 16, 23) | 11190 __gen_uint(values->_3DCommandOpcode, 24, 26) | 11191 __gen_uint(values->CommandSubType, 27, 28) | 11192 __gen_uint(values->CommandType, 29, 31); 11193 11194 const uint64_t v1 = 11195 __gen_offset(values->SystemInstructionPointer, 4, 63); 11196 dw[1] = v1; 11197 dw[2] = v1 >> 32; 11198} 11199 11200#define GFX125_BCS_INSTDONE_num 0x2206c 11201#define GFX125_BCS_INSTDONE_length 1 11202struct GFX125_BCS_INSTDONE { 11203 bool RingEnable; 11204 bool BlitterIDLE; 11205 bool GABIDLE; 11206 bool BCSDone; 11207}; 11208 11209static inline __attribute__((always_inline)) void 11210GFX125_BCS_INSTDONE_pack(__attribute__((unused)) __gen_user_data *data, 11211 __attribute__((unused)) void * restrict dst, 11212 __attribute__((unused)) const struct GFX125_BCS_INSTDONE * restrict values) 11213{ 11214 uint32_t * restrict dw = (uint32_t * restrict) dst; 11215 11216 dw[0] = 11217 __gen_uint(values->RingEnable, 0, 0) | 11218 __gen_uint(values->BlitterIDLE, 1, 1) | 11219 __gen_uint(values->GABIDLE, 2, 2) | 11220 __gen_uint(values->BCSDone, 3, 3); 11221} 11222 11223#define GFX125_CACHE_MODE_0_num 0x7000 11224#define GFX125_CACHE_MODE_0_length 1 11225struct GFX125_CACHE_MODE_0 { 11226 bool DisableBytesharingfor3DTYFLOD1surfacesfor3264128bpp; 11227 bool Disableclockgatinginthepixelbackend; 11228 bool HierarchicalZDisable; 11229 bool RCCEvictionPolicy; 11230 bool STCPMAOptimizationDisable; 11231 bool STCReadHitWonlyOptimizationDisable; 11232 bool DepthRelatedCachePipelinedFlushDisable; 11233 bool SamplerL2TLBPrefetchEnable; 11234 bool RCZPMANotPromotedAllocationstalloptimizationDisableduetochangeindepthparameters; 11235 uint32_t MSAACompressionPlaneNumberThresholdforeLLC; 11236 bool DisableRepackingforCompression; 11237 bool DisableBytesharingfor3DTYFLOD1surfacesfor3264128bppMask; 11238 bool DisableclockgatinginthepixelbackendMask; 11239 bool HierarchicalZDisableMask; 11240 bool RCCEvictionPolicyMask; 11241 bool STCPMAOptimizationDisableMask; 11242 bool STCReadHitWonlyOptimizationDisableMask; 11243 bool DepthRelatedCachePipelinedFlushDisableMask; 11244 bool SamplerL2TLBPrefetchEnableMask; 11245 bool RCZPMANotPromotedAllocationstalloptimizationDisableduetochangeindepthparametersMask; 11246 uint32_t MSAACompressionPlaneNumberThresholdforeLLCMask; 11247 bool DisableRepackingforCompressionMask; 11248}; 11249 11250static inline __attribute__((always_inline)) void 11251GFX125_CACHE_MODE_0_pack(__attribute__((unused)) __gen_user_data *data, 11252 __attribute__((unused)) void * restrict dst, 11253 __attribute__((unused)) const struct GFX125_CACHE_MODE_0 * restrict values) 11254{ 11255 uint32_t * restrict dw = (uint32_t * restrict) dst; 11256 11257 dw[0] = 11258 __gen_uint(values->DisableBytesharingfor3DTYFLOD1surfacesfor3264128bpp, 0, 0) | 11259 __gen_uint(values->Disableclockgatinginthepixelbackend, 1, 1) | 11260 __gen_uint(values->HierarchicalZDisable, 3, 3) | 11261 __gen_uint(values->RCCEvictionPolicy, 4, 4) | 11262 __gen_uint(values->STCPMAOptimizationDisable, 5, 5) | 11263 __gen_uint(values->STCReadHitWonlyOptimizationDisable, 6, 6) | 11264 __gen_uint(values->DepthRelatedCachePipelinedFlushDisable, 8, 8) | 11265 __gen_uint(values->SamplerL2TLBPrefetchEnable, 9, 9) | 11266 __gen_uint(values->RCZPMANotPromotedAllocationstalloptimizationDisableduetochangeindepthparameters, 10, 10) | 11267 __gen_uint(values->MSAACompressionPlaneNumberThresholdforeLLC, 12, 14) | 11268 __gen_uint(values->DisableRepackingforCompression, 15, 15) | 11269 __gen_uint(values->DisableBytesharingfor3DTYFLOD1surfacesfor3264128bppMask, 16, 16) | 11270 __gen_uint(values->DisableclockgatinginthepixelbackendMask, 17, 17) | 11271 __gen_uint(values->HierarchicalZDisableMask, 19, 19) | 11272 __gen_uint(values->RCCEvictionPolicyMask, 20, 20) | 11273 __gen_uint(values->STCPMAOptimizationDisableMask, 21, 21) | 11274 __gen_uint(values->STCReadHitWonlyOptimizationDisableMask, 22, 22) | 11275 __gen_uint(values->DepthRelatedCachePipelinedFlushDisableMask, 24, 24) | 11276 __gen_uint(values->SamplerL2TLBPrefetchEnableMask, 25, 25) | 11277 __gen_uint(values->RCZPMANotPromotedAllocationstalloptimizationDisableduetochangeindepthparametersMask, 26, 26) | 11278 __gen_uint(values->MSAACompressionPlaneNumberThresholdforeLLCMask, 28, 30) | 11279 __gen_uint(values->DisableRepackingforCompressionMask, 31, 31); 11280} 11281 11282#define GFX125_CACHE_MODE_1_num 0x7004 11283#define GFX125_CACHE_MODE_1_length 1 11284struct GFX125_CACHE_MODE_1 { 11285 bool PartialResolveDisableInVC; 11286 bool RCZPMAPromoted2NotPromotedAllocationstalloptimizationDisable; 11287 bool MCSCacheDisable; 11288 bool MSCRAWHazardAvoidanceBit; 11289 uint32_t NPEarlyZFailsDisable; 11290 bool BlendOptimizationFixDisable; 11291 bool ColorCompressionDisable; 11292 bool PartialResolveDisableInVCMask; 11293 bool RCZPMAPromoted2NotPromotedAllocationstalloptimizationDisableMask; 11294 bool MCSCacheDisableMask; 11295 bool MSCRAWHazardAvoidanceBitMask; 11296 bool NPEarlyZFailsDisableMask; 11297 bool BlendOptimizationFixDisableMask; 11298 bool ColorCompressionDisableMask; 11299}; 11300 11301static inline __attribute__((always_inline)) void 11302GFX125_CACHE_MODE_1_pack(__attribute__((unused)) __gen_user_data *data, 11303 __attribute__((unused)) void * restrict dst, 11304 __attribute__((unused)) const struct GFX125_CACHE_MODE_1 * restrict values) 11305{ 11306 uint32_t * restrict dw = (uint32_t * restrict) dst; 11307 11308 dw[0] = 11309 __gen_uint(values->PartialResolveDisableInVC, 1, 1) | 11310 __gen_uint(values->RCZPMAPromoted2NotPromotedAllocationstalloptimizationDisable, 3, 3) | 11311 __gen_uint(values->MCSCacheDisable, 5, 5) | 11312 __gen_uint(values->MSCRAWHazardAvoidanceBit, 9, 9) | 11313 __gen_uint(values->NPEarlyZFailsDisable, 13, 13) | 11314 __gen_uint(values->BlendOptimizationFixDisable, 14, 14) | 11315 __gen_uint(values->ColorCompressionDisable, 15, 15) | 11316 __gen_uint(values->PartialResolveDisableInVCMask, 17, 17) | 11317 __gen_uint(values->RCZPMAPromoted2NotPromotedAllocationstalloptimizationDisableMask, 19, 19) | 11318 __gen_uint(values->MCSCacheDisableMask, 21, 21) | 11319 __gen_uint(values->MSCRAWHazardAvoidanceBitMask, 25, 25) | 11320 __gen_uint(values->NPEarlyZFailsDisableMask, 29, 29) | 11321 __gen_uint(values->BlendOptimizationFixDisableMask, 30, 30) | 11322 __gen_uint(values->ColorCompressionDisableMask, 31, 31); 11323} 11324 11325#define GFX125_CACHE_MODE_SS_num 0xe420 11326#define GFX125_CACHE_MODE_SS_length 1 11327struct GFX125_CACHE_MODE_SS { 11328 bool InstructionLevel1CacheDisable; 11329 bool InstructionLevel1CacheandInFlightQueueDisable; 11330 bool FloatBlendOptimizationEnable; 11331 bool PerSampleBlendOptDisable; 11332 bool InstructionLevel1CacheDisableMask; 11333 bool InstructionLevel1CacheandInFlightQueueDisableMask; 11334 bool FloatBlendOptimizationEnableMask; 11335 bool PerSampleBlendOptDisableMask; 11336}; 11337 11338static inline __attribute__((always_inline)) void 11339GFX125_CACHE_MODE_SS_pack(__attribute__((unused)) __gen_user_data *data, 11340 __attribute__((unused)) void * restrict dst, 11341 __attribute__((unused)) const struct GFX125_CACHE_MODE_SS * restrict values) 11342{ 11343 uint32_t * restrict dw = (uint32_t * restrict) dst; 11344 11345 dw[0] = 11346 __gen_uint(values->InstructionLevel1CacheDisable, 0, 0) | 11347 __gen_uint(values->InstructionLevel1CacheandInFlightQueueDisable, 1, 1) | 11348 __gen_uint(values->FloatBlendOptimizationEnable, 4, 4) | 11349 __gen_uint(values->PerSampleBlendOptDisable, 11, 11) | 11350 __gen_uint(values->InstructionLevel1CacheDisableMask, 16, 16) | 11351 __gen_uint(values->InstructionLevel1CacheandInFlightQueueDisableMask, 17, 17) | 11352 __gen_uint(values->FloatBlendOptimizationEnableMask, 20, 20) | 11353 __gen_uint(values->PerSampleBlendOptDisableMask, 27, 27); 11354} 11355 11356#define GFX125_CHICKEN_RASTER_1_num 0x6204 11357#define GFX125_CHICKEN_RASTER_1_length 1 11358struct GFX125_CHICKEN_RASTER_1 { 11359 bool AALineQualityFix; 11360 bool AALineQualityFixMask; 11361}; 11362 11363static inline __attribute__((always_inline)) void 11364GFX125_CHICKEN_RASTER_1_pack(__attribute__((unused)) __gen_user_data *data, 11365 __attribute__((unused)) void * restrict dst, 11366 __attribute__((unused)) const struct GFX125_CHICKEN_RASTER_1 * restrict values) 11367{ 11368 uint32_t * restrict dw = (uint32_t * restrict) dst; 11369 11370 dw[0] = 11371 __gen_uint(values->AALineQualityFix, 5, 5) | 11372 __gen_uint(values->AALineQualityFixMask, 21, 21); 11373} 11374 11375#define GFX125_CL_INVOCATION_COUNT_num 0x2338 11376#define GFX125_CL_INVOCATION_COUNT_length 2 11377struct GFX125_CL_INVOCATION_COUNT { 11378 uint64_t CLInvocationCountReport; 11379}; 11380 11381static inline __attribute__((always_inline)) void 11382GFX125_CL_INVOCATION_COUNT_pack(__attribute__((unused)) __gen_user_data *data, 11383 __attribute__((unused)) void * restrict dst, 11384 __attribute__((unused)) const struct GFX125_CL_INVOCATION_COUNT * restrict values) 11385{ 11386 uint32_t * restrict dw = (uint32_t * restrict) dst; 11387 11388 const uint64_t v0 = 11389 __gen_uint(values->CLInvocationCountReport, 0, 63); 11390 dw[0] = v0; 11391 dw[1] = v0 >> 32; 11392} 11393 11394#define GFX125_CL_PRIMITIVES_COUNT_num 0x2340 11395#define GFX125_CL_PRIMITIVES_COUNT_length 2 11396struct GFX125_CL_PRIMITIVES_COUNT { 11397 uint64_t CLPrimitivesCountReport; 11398}; 11399 11400static inline __attribute__((always_inline)) void 11401GFX125_CL_PRIMITIVES_COUNT_pack(__attribute__((unused)) __gen_user_data *data, 11402 __attribute__((unused)) void * restrict dst, 11403 __attribute__((unused)) const struct GFX125_CL_PRIMITIVES_COUNT * restrict values) 11404{ 11405 uint32_t * restrict dw = (uint32_t * restrict) dst; 11406 11407 const uint64_t v0 = 11408 __gen_uint(values->CLPrimitivesCountReport, 0, 63); 11409 dw[0] = v0; 11410 dw[1] = v0 >> 32; 11411} 11412 11413#define GFX125_COMMON_SLICE_CHICKEN1_num 0x7010 11414#define GFX125_COMMON_SLICE_CHICKEN1_length 1 11415struct GFX125_COMMON_SLICE_CHICKEN1 { 11416 bool HIZPlaneOptimizationdisablebit; 11417 bool HIZPlaneOptimizationdisablebitMask; 11418}; 11419 11420static inline __attribute__((always_inline)) void 11421GFX125_COMMON_SLICE_CHICKEN1_pack(__attribute__((unused)) __gen_user_data *data, 11422 __attribute__((unused)) void * restrict dst, 11423 __attribute__((unused)) const struct GFX125_COMMON_SLICE_CHICKEN1 * restrict values) 11424{ 11425 uint32_t * restrict dw = (uint32_t * restrict) dst; 11426 11427 dw[0] = 11428 __gen_uint(values->HIZPlaneOptimizationdisablebit, 9, 9) | 11429 __gen_uint(values->HIZPlaneOptimizationdisablebitMask, 25, 25); 11430} 11431 11432#define GFX125_COMMON_SLICE_CHICKEN3_num 0x7304 11433#define GFX125_COMMON_SLICE_CHICKEN3_length 1 11434struct GFX125_COMMON_SLICE_CHICKEN3 { 11435 uint32_t PSThreadPanicDispatch; 11436 uint32_t PSThreadPanicDispatchMask; 11437}; 11438 11439static inline __attribute__((always_inline)) void 11440GFX125_COMMON_SLICE_CHICKEN3_pack(__attribute__((unused)) __gen_user_data *data, 11441 __attribute__((unused)) void * restrict dst, 11442 __attribute__((unused)) const struct GFX125_COMMON_SLICE_CHICKEN3 * restrict values) 11443{ 11444 uint32_t * restrict dw = (uint32_t * restrict) dst; 11445 11446 dw[0] = 11447 __gen_uint(values->PSThreadPanicDispatch, 6, 7) | 11448 __gen_uint(values->PSThreadPanicDispatchMask, 22, 23); 11449} 11450 11451#define GFX125_COMMON_SLICE_CHICKEN4_num 0x7300 11452#define GFX125_COMMON_SLICE_CHICKEN4_length 1 11453struct GFX125_COMMON_SLICE_CHICKEN4 { 11454 bool EnableHardwareFilteringinWM; 11455 bool EnableHardwareFilteringinWMMask; 11456}; 11457 11458static inline __attribute__((always_inline)) void 11459GFX125_COMMON_SLICE_CHICKEN4_pack(__attribute__((unused)) __gen_user_data *data, 11460 __attribute__((unused)) void * restrict dst, 11461 __attribute__((unused)) const struct GFX125_COMMON_SLICE_CHICKEN4 * restrict values) 11462{ 11463 uint32_t * restrict dw = (uint32_t * restrict) dst; 11464 11465 dw[0] = 11466 __gen_uint(values->EnableHardwareFilteringinWM, 5, 5) | 11467 __gen_uint(values->EnableHardwareFilteringinWMMask, 21, 21); 11468} 11469 11470#define GFX125_CS_CHICKEN1_num 0x2580 11471#define GFX125_CS_CHICKEN1_length 1 11472struct GFX125_CS_CHICKEN1 { 11473 uint32_t ReplayMode; 11474#define MidcmdbufferPreemption 0 11475#define ObjectLevelPreemption 1 11476 bool ReplayModeMask; 11477}; 11478 11479static inline __attribute__((always_inline)) void 11480GFX125_CS_CHICKEN1_pack(__attribute__((unused)) __gen_user_data *data, 11481 __attribute__((unused)) void * restrict dst, 11482 __attribute__((unused)) const struct GFX125_CS_CHICKEN1 * restrict values) 11483{ 11484 uint32_t * restrict dw = (uint32_t * restrict) dst; 11485 11486 dw[0] = 11487 __gen_uint(values->ReplayMode, 0, 0) | 11488 __gen_uint(values->ReplayModeMask, 16, 16); 11489} 11490 11491#define GFX125_CS_DEBUG_MODE2_num 0x20d8 11492#define GFX125_CS_DEBUG_MODE2_length 1 11493struct GFX125_CS_DEBUG_MODE2 { 11494 bool _3DRenderingInstructionDisable; 11495 bool MediaInstructionDisable; 11496 bool CONSTANT_BUFFERAddressOffsetDisable; 11497 bool _3DRenderingInstructionDisableMask; 11498 bool MediaInstructionDisableMask; 11499 bool CONSTANT_BUFFERAddressOffsetDisableMask; 11500}; 11501 11502static inline __attribute__((always_inline)) void 11503GFX125_CS_DEBUG_MODE2_pack(__attribute__((unused)) __gen_user_data *data, 11504 __attribute__((unused)) void * restrict dst, 11505 __attribute__((unused)) const struct GFX125_CS_DEBUG_MODE2 * restrict values) 11506{ 11507 uint32_t * restrict dw = (uint32_t * restrict) dst; 11508 11509 dw[0] = 11510 __gen_uint(values->_3DRenderingInstructionDisable, 0, 0) | 11511 __gen_uint(values->MediaInstructionDisable, 1, 1) | 11512 __gen_uint(values->CONSTANT_BUFFERAddressOffsetDisable, 4, 4) | 11513 __gen_uint(values->_3DRenderingInstructionDisableMask, 16, 16) | 11514 __gen_uint(values->MediaInstructionDisableMask, 17, 17) | 11515 __gen_uint(values->CONSTANT_BUFFERAddressOffsetDisableMask, 20, 20); 11516} 11517 11518#define GFX125_CS_INVOCATION_COUNT_num 0x2290 11519#define GFX125_CS_INVOCATION_COUNT_length 2 11520struct GFX125_CS_INVOCATION_COUNT { 11521 uint64_t CSInvocationCountReport; 11522}; 11523 11524static inline __attribute__((always_inline)) void 11525GFX125_CS_INVOCATION_COUNT_pack(__attribute__((unused)) __gen_user_data *data, 11526 __attribute__((unused)) void * restrict dst, 11527 __attribute__((unused)) const struct GFX125_CS_INVOCATION_COUNT * restrict values) 11528{ 11529 uint32_t * restrict dw = (uint32_t * restrict) dst; 11530 11531 const uint64_t v0 = 11532 __gen_uint(values->CSInvocationCountReport, 0, 63); 11533 dw[0] = v0; 11534 dw[1] = v0 >> 32; 11535} 11536 11537#define GFX125_DS_INVOCATION_COUNT_num 0x2308 11538#define GFX125_DS_INVOCATION_COUNT_length 2 11539struct GFX125_DS_INVOCATION_COUNT { 11540 uint64_t DSInvocationCountReport; 11541}; 11542 11543static inline __attribute__((always_inline)) void 11544GFX125_DS_INVOCATION_COUNT_pack(__attribute__((unused)) __gen_user_data *data, 11545 __attribute__((unused)) void * restrict dst, 11546 __attribute__((unused)) const struct GFX125_DS_INVOCATION_COUNT * restrict values) 11547{ 11548 uint32_t * restrict dw = (uint32_t * restrict) dst; 11549 11550 const uint64_t v0 = 11551 __gen_uint(values->DSInvocationCountReport, 0, 63); 11552 dw[0] = v0; 11553 dw[1] = v0 >> 32; 11554} 11555 11556#define GFX125_GFX_AUX_TABLE_BASE_ADDR_num 0x4200 11557#define GFX125_GFX_AUX_TABLE_BASE_ADDR_length 2 11558struct GFX125_GFX_AUX_TABLE_BASE_ADDR { 11559 uint64_t Address; 11560}; 11561 11562static inline __attribute__((always_inline)) void 11563GFX125_GFX_AUX_TABLE_BASE_ADDR_pack(__attribute__((unused)) __gen_user_data *data, 11564 __attribute__((unused)) void * restrict dst, 11565 __attribute__((unused)) const struct GFX125_GFX_AUX_TABLE_BASE_ADDR * restrict values) 11566{ 11567 uint32_t * restrict dw = (uint32_t * restrict) dst; 11568 11569 const uint64_t v0 = 11570 __gen_uint(values->Address, 0, 63); 11571 dw[0] = v0; 11572 dw[1] = v0 >> 32; 11573} 11574 11575#define GFX125_GFX_CCS_AUX_INV_num 0x4208 11576#define GFX125_GFX_CCS_AUX_INV_length 1 11577struct GFX125_GFX_CCS_AUX_INV { 11578 bool AuxInv; 11579}; 11580 11581static inline __attribute__((always_inline)) void 11582GFX125_GFX_CCS_AUX_INV_pack(__attribute__((unused)) __gen_user_data *data, 11583 __attribute__((unused)) void * restrict dst, 11584 __attribute__((unused)) const struct GFX125_GFX_CCS_AUX_INV * restrict values) 11585{ 11586 uint32_t * restrict dw = (uint32_t * restrict) dst; 11587 11588 dw[0] = 11589 __gen_uint(values->AuxInv, 0, 0); 11590} 11591 11592#define GFX125_GS_INVOCATION_COUNT_num 0x2328 11593#define GFX125_GS_INVOCATION_COUNT_length 2 11594struct GFX125_GS_INVOCATION_COUNT { 11595 uint64_t GSInvocationCountReport; 11596}; 11597 11598static inline __attribute__((always_inline)) void 11599GFX125_GS_INVOCATION_COUNT_pack(__attribute__((unused)) __gen_user_data *data, 11600 __attribute__((unused)) void * restrict dst, 11601 __attribute__((unused)) const struct GFX125_GS_INVOCATION_COUNT * restrict values) 11602{ 11603 uint32_t * restrict dw = (uint32_t * restrict) dst; 11604 11605 const uint64_t v0 = 11606 __gen_uint(values->GSInvocationCountReport, 0, 63); 11607 dw[0] = v0; 11608 dw[1] = v0 >> 32; 11609} 11610 11611#define GFX125_GS_PRIMITIVES_COUNT_num 0x2330 11612#define GFX125_GS_PRIMITIVES_COUNT_length 2 11613struct GFX125_GS_PRIMITIVES_COUNT { 11614 uint64_t GSPrimitivesCountReport; 11615}; 11616 11617static inline __attribute__((always_inline)) void 11618GFX125_GS_PRIMITIVES_COUNT_pack(__attribute__((unused)) __gen_user_data *data, 11619 __attribute__((unused)) void * restrict dst, 11620 __attribute__((unused)) const struct GFX125_GS_PRIMITIVES_COUNT * restrict values) 11621{ 11622 uint32_t * restrict dw = (uint32_t * restrict) dst; 11623 11624 const uint64_t v0 = 11625 __gen_uint(values->GSPrimitivesCountReport, 0, 63); 11626 dw[0] = v0; 11627 dw[1] = v0 >> 32; 11628} 11629 11630#define GFX125_HALF_SLICE_CHICKEN7_num 0xe194 11631#define GFX125_HALF_SLICE_CHICKEN7_length 1 11632struct GFX125_HALF_SLICE_CHICKEN7 { 11633 bool EnabledTexelOffsetPrecisionFix; 11634 bool EnabledTexelOffsetPrecisionFixMask; 11635}; 11636 11637static inline __attribute__((always_inline)) void 11638GFX125_HALF_SLICE_CHICKEN7_pack(__attribute__((unused)) __gen_user_data *data, 11639 __attribute__((unused)) void * restrict dst, 11640 __attribute__((unused)) const struct GFX125_HALF_SLICE_CHICKEN7 * restrict values) 11641{ 11642 uint32_t * restrict dw = (uint32_t * restrict) dst; 11643 11644 dw[0] = 11645 __gen_uint(values->EnabledTexelOffsetPrecisionFix, 1, 1) | 11646 __gen_uint(values->EnabledTexelOffsetPrecisionFixMask, 17, 17); 11647} 11648 11649#define GFX125_HIZ_CHICKEN_num 0x7018 11650#define GFX125_HIZ_CHICKEN_length 1 11651struct GFX125_HIZ_CHICKEN { 11652 bool HZDepthTestLEGEOptimizationDisable; 11653 bool HZDepthTestLEGEOptimizationDisableMask; 11654}; 11655 11656static inline __attribute__((always_inline)) void 11657GFX125_HIZ_CHICKEN_pack(__attribute__((unused)) __gen_user_data *data, 11658 __attribute__((unused)) void * restrict dst, 11659 __attribute__((unused)) const struct GFX125_HIZ_CHICKEN * restrict values) 11660{ 11661 uint32_t * restrict dw = (uint32_t * restrict) dst; 11662 11663 dw[0] = 11664 __gen_uint(values->HZDepthTestLEGEOptimizationDisable, 13, 13) | 11665 __gen_uint(values->HZDepthTestLEGEOptimizationDisableMask, 29, 29); 11666} 11667 11668#define GFX125_HS_INVOCATION_COUNT_num 0x2300 11669#define GFX125_HS_INVOCATION_COUNT_length 2 11670struct GFX125_HS_INVOCATION_COUNT { 11671 uint64_t HSInvocationCountReport; 11672}; 11673 11674static inline __attribute__((always_inline)) void 11675GFX125_HS_INVOCATION_COUNT_pack(__attribute__((unused)) __gen_user_data *data, 11676 __attribute__((unused)) void * restrict dst, 11677 __attribute__((unused)) const struct GFX125_HS_INVOCATION_COUNT * restrict values) 11678{ 11679 uint32_t * restrict dw = (uint32_t * restrict) dst; 11680 11681 const uint64_t v0 = 11682 __gen_uint(values->HSInvocationCountReport, 0, 63); 11683 dw[0] = v0; 11684 dw[1] = v0 >> 32; 11685} 11686 11687#define GFX125_IA_PRIMITIVES_COUNT_num 0x2318 11688#define GFX125_IA_PRIMITIVES_COUNT_length 2 11689struct GFX125_IA_PRIMITIVES_COUNT { 11690 uint64_t IAPrimitivesCountReport; 11691}; 11692 11693static inline __attribute__((always_inline)) void 11694GFX125_IA_PRIMITIVES_COUNT_pack(__attribute__((unused)) __gen_user_data *data, 11695 __attribute__((unused)) void * restrict dst, 11696 __attribute__((unused)) const struct GFX125_IA_PRIMITIVES_COUNT * restrict values) 11697{ 11698 uint32_t * restrict dw = (uint32_t * restrict) dst; 11699 11700 const uint64_t v0 = 11701 __gen_uint(values->IAPrimitivesCountReport, 0, 63); 11702 dw[0] = v0; 11703 dw[1] = v0 >> 32; 11704} 11705 11706#define GFX125_IA_VERTICES_COUNT_num 0x2310 11707#define GFX125_IA_VERTICES_COUNT_length 2 11708struct GFX125_IA_VERTICES_COUNT { 11709 uint64_t IAVerticesCountReport; 11710}; 11711 11712static inline __attribute__((always_inline)) void 11713GFX125_IA_VERTICES_COUNT_pack(__attribute__((unused)) __gen_user_data *data, 11714 __attribute__((unused)) void * restrict dst, 11715 __attribute__((unused)) const struct GFX125_IA_VERTICES_COUNT * restrict values) 11716{ 11717 uint32_t * restrict dw = (uint32_t * restrict) dst; 11718 11719 const uint64_t v0 = 11720 __gen_uint(values->IAVerticesCountReport, 0, 63); 11721 dw[0] = v0; 11722 dw[1] = v0 >> 32; 11723} 11724 11725#define GFX125_INSTDONE_1_num 0x206c 11726#define GFX125_INSTDONE_1_length 1 11727struct GFX125_INSTDONE_1 { 11728 bool PRB0RingEnable; 11729 bool VFGDone; 11730 bool VSDone; 11731 bool HSDone; 11732 bool TEDone; 11733 bool DSDone; 11734 bool GSDone; 11735 bool SOLDone; 11736 bool CLDone; 11737 bool SFDone; 11738 bool TDG1Done; 11739 bool TDG0Done; 11740 bool URBMDone; 11741 bool SVGDone; 11742 bool GAFSDone; 11743 bool VFEDone; 11744 bool TSG0Done; 11745 bool GAFMDone; 11746 bool GAMDone; 11747 bool RSDone; 11748 bool CSDone; 11749 bool SDEDone; 11750 bool RCCFBCCSDone; 11751 bool TSG1Done; 11752}; 11753 11754static inline __attribute__((always_inline)) void 11755GFX125_INSTDONE_1_pack(__attribute__((unused)) __gen_user_data *data, 11756 __attribute__((unused)) void * restrict dst, 11757 __attribute__((unused)) const struct GFX125_INSTDONE_1 * restrict values) 11758{ 11759 uint32_t * restrict dw = (uint32_t * restrict) dst; 11760 11761 dw[0] = 11762 __gen_uint(values->PRB0RingEnable, 0, 0) | 11763 __gen_uint(values->VFGDone, 1, 1) | 11764 __gen_uint(values->VSDone, 2, 2) | 11765 __gen_uint(values->HSDone, 3, 3) | 11766 __gen_uint(values->TEDone, 4, 4) | 11767 __gen_uint(values->DSDone, 5, 5) | 11768 __gen_uint(values->GSDone, 6, 6) | 11769 __gen_uint(values->SOLDone, 7, 7) | 11770 __gen_uint(values->CLDone, 8, 8) | 11771 __gen_uint(values->SFDone, 9, 9) | 11772 __gen_uint(values->TDG1Done, 11, 11) | 11773 __gen_uint(values->TDG0Done, 12, 12) | 11774 __gen_uint(values->URBMDone, 13, 13) | 11775 __gen_uint(values->SVGDone, 14, 14) | 11776 __gen_uint(values->GAFSDone, 15, 15) | 11777 __gen_uint(values->VFEDone, 16, 16) | 11778 __gen_uint(values->TSG0Done, 17, 17) | 11779 __gen_uint(values->GAFMDone, 18, 18) | 11780 __gen_uint(values->GAMDone, 19, 19) | 11781 __gen_uint(values->RSDone, 20, 20) | 11782 __gen_uint(values->CSDone, 21, 21) | 11783 __gen_uint(values->SDEDone, 22, 22) | 11784 __gen_uint(values->RCCFBCCSDone, 23, 23) | 11785 __gen_uint(values->TSG1Done, 24, 24); 11786} 11787 11788#define GFX125_L3ALLOC_num 0xb134 11789#define GFX125_L3ALLOC_length 1 11790struct GFX125_L3ALLOC { 11791 uint32_t AllocationError; 11792 uint32_t URBAllocation; 11793 bool L3FullWayAllocationEnable; 11794 uint32_t ROAllocation; 11795 uint32_t DCAllocation; 11796 uint32_t AllAllocation; 11797}; 11798 11799static inline __attribute__((always_inline)) void 11800GFX125_L3ALLOC_pack(__attribute__((unused)) __gen_user_data *data, 11801 __attribute__((unused)) void * restrict dst, 11802 __attribute__((unused)) const struct GFX125_L3ALLOC * restrict values) 11803{ 11804 uint32_t * restrict dw = (uint32_t * restrict) dst; 11805 11806 dw[0] = 11807 __gen_uint(values->AllocationError, 0, 0) | 11808 __gen_uint(values->URBAllocation, 1, 7) | 11809 __gen_uint(values->L3FullWayAllocationEnable, 9, 9) | 11810 __gen_uint(values->ROAllocation, 11, 17) | 11811 __gen_uint(values->DCAllocation, 18, 24) | 11812 __gen_uint(values->AllAllocation, 25, 31); 11813} 11814 11815#define GFX125_PS_INVOCATION_COUNT_num 0x2348 11816#define GFX125_PS_INVOCATION_COUNT_length 2 11817struct GFX125_PS_INVOCATION_COUNT { 11818 uint64_t PSInvocationCountReport; 11819}; 11820 11821static inline __attribute__((always_inline)) void 11822GFX125_PS_INVOCATION_COUNT_pack(__attribute__((unused)) __gen_user_data *data, 11823 __attribute__((unused)) void * restrict dst, 11824 __attribute__((unused)) const struct GFX125_PS_INVOCATION_COUNT * restrict values) 11825{ 11826 uint32_t * restrict dw = (uint32_t * restrict) dst; 11827 11828 const uint64_t v0 = 11829 __gen_uint(values->PSInvocationCountReport, 0, 63); 11830 dw[0] = v0; 11831 dw[1] = v0 >> 32; 11832} 11833 11834#define GFX125_ROW_INSTDONE_num 0xe164 11835#define GFX125_ROW_INSTDONE_length 1 11836struct GFX125_ROW_INSTDONE { 11837 bool BCDone; 11838 bool PSDDone; 11839 bool TDPDone; 11840 bool DAPRDone; 11841 bool CPSSDone; 11842 bool RTDONERENDER; 11843 bool TDLDone; 11844 bool EU00doneSS1; 11845 bool EU01doneSS1; 11846 bool EU02doneSS1; 11847 bool EU03doneSS1; 11848 bool MA0doneSS1; 11849 bool ICDone; 11850 bool BTDDONERENDER; 11851 bool RTDONECOMPUTE; 11852 bool MA0DoneSS0; 11853 bool EU00DoneSS0; 11854 bool EU01DoneSS0; 11855 bool EU02DoneSS0; 11856 bool EU03DoneSS0; 11857 bool BTDDONECOMPUTE; 11858 bool EU10DoneSS0; 11859 bool EU11DoneSS0; 11860 bool EU12DoneSS0; 11861 bool EU13DoneSS0; 11862 bool TSLDone; 11863 bool EU10DoneSS1; 11864 bool EU11DoneSS1; 11865 bool EU12DoneSS1; 11866 bool EU13DoneSS1; 11867}; 11868 11869static inline __attribute__((always_inline)) void 11870GFX125_ROW_INSTDONE_pack(__attribute__((unused)) __gen_user_data *data, 11871 __attribute__((unused)) void * restrict dst, 11872 __attribute__((unused)) const struct GFX125_ROW_INSTDONE * restrict values) 11873{ 11874 uint32_t * restrict dw = (uint32_t * restrict) dst; 11875 11876 dw[0] = 11877 __gen_uint(values->BCDone, 0, 0) | 11878 __gen_uint(values->PSDDone, 1, 1) | 11879 __gen_uint(values->TDPDone, 2, 2) | 11880 __gen_uint(values->DAPRDone, 3, 3) | 11881 __gen_uint(values->CPSSDone, 4, 4) | 11882 __gen_uint(values->RTDONERENDER, 5, 5) | 11883 __gen_uint(values->TDLDone, 6, 6) | 11884 __gen_uint(values->EU00doneSS1, 7, 7) | 11885 __gen_uint(values->EU01doneSS1, 8, 8) | 11886 __gen_uint(values->EU02doneSS1, 9, 9) | 11887 __gen_uint(values->EU03doneSS1, 10, 10) | 11888 __gen_uint(values->MA0doneSS1, 11, 11) | 11889 __gen_uint(values->ICDone, 12, 12) | 11890 __gen_uint(values->BTDDONERENDER, 13, 13) | 11891 __gen_uint(values->RTDONECOMPUTE, 14, 14) | 11892 __gen_uint(values->MA0DoneSS0, 15, 15) | 11893 __gen_uint(values->EU00DoneSS0, 16, 16) | 11894 __gen_uint(values->EU01DoneSS0, 17, 17) | 11895 __gen_uint(values->EU02DoneSS0, 18, 18) | 11896 __gen_uint(values->EU03DoneSS0, 19, 19) | 11897 __gen_uint(values->BTDDONECOMPUTE, 20, 20) | 11898 __gen_uint(values->EU10DoneSS0, 21, 21) | 11899 __gen_uint(values->EU11DoneSS0, 22, 22) | 11900 __gen_uint(values->EU12DoneSS0, 23, 23) | 11901 __gen_uint(values->EU13DoneSS0, 24, 24) | 11902 __gen_uint(values->TSLDone, 26, 26) | 11903 __gen_uint(values->EU10DoneSS1, 27, 27) | 11904 __gen_uint(values->EU11DoneSS1, 28, 28) | 11905 __gen_uint(values->EU12DoneSS1, 29, 29) | 11906 __gen_uint(values->EU13DoneSS1, 30, 30); 11907} 11908 11909#define GFX125_RPSTAT0_num 0xa01c 11910#define GFX125_RPSTAT0_length 1 11911struct GFX125_RPSTAT0 { 11912 uint32_t PreviousGTFrequency; 11913 uint32_t CurrentGTFrequency; 11914}; 11915 11916static inline __attribute__((always_inline)) void 11917GFX125_RPSTAT0_pack(__attribute__((unused)) __gen_user_data *data, 11918 __attribute__((unused)) void * restrict dst, 11919 __attribute__((unused)) const struct GFX125_RPSTAT0 * restrict values) 11920{ 11921 uint32_t * restrict dw = (uint32_t * restrict) dst; 11922 11923 dw[0] = 11924 __gen_uint(values->PreviousGTFrequency, 0, 8) | 11925 __gen_uint(values->CurrentGTFrequency, 23, 31); 11926} 11927 11928#define GFX125_SAMPLER_INSTDONE_num 0xe160 11929#define GFX125_SAMPLER_INSTDONE_length 1 11930struct GFX125_SAMPLER_INSTDONE { 11931 bool SIDone; 11932 bool SVSMADAPTERDone; 11933 bool SVSMARBDone; 11934 bool SVSMDone; 11935 bool PLDone; 11936 bool DGDone; 11937 bool SSLADone; 11938 bool STARBDone; 11939 bool STDone; 11940 bool FTDone; 11941 bool MTDone; 11942 bool DMDone; 11943 bool BDMDone; 11944 bool SCDone; 11945 bool FLDone; 11946 bool SODone; 11947 bool LSCL1BANK0Idle; 11948 bool LSCL1BANK1Idle; 11949 bool LSCL1BANK2Idle; 11950 bool LSCL1BANK3Idle; 11951 bool LSCSEQ0Idle; 11952 bool LSCSEQ1Idle; 11953 bool LSCSEQ2Idle; 11954 bool LSCSEQ3Idle; 11955 bool LSCSEQINTFIdle; 11956 bool LSCL3INTFIdle; 11957 bool VMEMSOARB0Done; 11958 bool VMEMSOARB1Done; 11959 bool VMEML3REQARB0Done; 11960 bool VMEML3REQARB1Done; 11961}; 11962 11963static inline __attribute__((always_inline)) void 11964GFX125_SAMPLER_INSTDONE_pack(__attribute__((unused)) __gen_user_data *data, 11965 __attribute__((unused)) void * restrict dst, 11966 __attribute__((unused)) const struct GFX125_SAMPLER_INSTDONE * restrict values) 11967{ 11968 uint32_t * restrict dw = (uint32_t * restrict) dst; 11969 11970 dw[0] = 11971 __gen_uint(values->SIDone, 0, 0) | 11972 __gen_uint(values->SVSMADAPTERDone, 1, 1) | 11973 __gen_uint(values->SVSMARBDone, 2, 2) | 11974 __gen_uint(values->SVSMDone, 3, 3) | 11975 __gen_uint(values->PLDone, 4, 4) | 11976 __gen_uint(values->DGDone, 5, 5) | 11977 __gen_uint(values->SSLADone, 6, 6) | 11978 __gen_uint(values->STARBDone, 7, 7) | 11979 __gen_uint(values->STDone, 8, 8) | 11980 __gen_uint(values->FTDone, 9, 9) | 11981 __gen_uint(values->MTDone, 11, 11) | 11982 __gen_uint(values->DMDone, 12, 12) | 11983 __gen_uint(values->BDMDone, 13, 13) | 11984 __gen_uint(values->SCDone, 14, 14) | 11985 __gen_uint(values->FLDone, 15, 15) | 11986 __gen_uint(values->SODone, 16, 16) | 11987 __gen_uint(values->LSCL1BANK0Idle, 18, 18) | 11988 __gen_uint(values->LSCL1BANK1Idle, 19, 19) | 11989 __gen_uint(values->LSCL1BANK2Idle, 20, 20) | 11990 __gen_uint(values->LSCL1BANK3Idle, 21, 21) | 11991 __gen_uint(values->LSCSEQ0Idle, 22, 22) | 11992 __gen_uint(values->LSCSEQ1Idle, 23, 23) | 11993 __gen_uint(values->LSCSEQ2Idle, 24, 24) | 11994 __gen_uint(values->LSCSEQ3Idle, 25, 25) | 11995 __gen_uint(values->LSCSEQINTFIdle, 26, 26) | 11996 __gen_uint(values->LSCL3INTFIdle, 27, 27) | 11997 __gen_uint(values->VMEMSOARB0Done, 28, 28) | 11998 __gen_uint(values->VMEMSOARB1Done, 29, 29) | 11999 __gen_uint(values->VMEML3REQARB0Done, 30, 30) | 12000 __gen_uint(values->VMEML3REQARB1Done, 31, 31); 12001} 12002 12003#define GFX125_SAMPLER_MODE_num 0xe18c 12004#define GFX125_SAMPLER_MODE_length 1 12005struct GFX125_SAMPLER_MODE { 12006 bool HeaderlessMessageforPreemptableContexts; 12007 bool HeaderlessMessageforPreemptableContextsMask; 12008}; 12009 12010static inline __attribute__((always_inline)) void 12011GFX125_SAMPLER_MODE_pack(__attribute__((unused)) __gen_user_data *data, 12012 __attribute__((unused)) void * restrict dst, 12013 __attribute__((unused)) const struct GFX125_SAMPLER_MODE * restrict values) 12014{ 12015 uint32_t * restrict dw = (uint32_t * restrict) dst; 12016 12017 dw[0] = 12018 __gen_uint(values->HeaderlessMessageforPreemptableContexts, 5, 5) | 12019 __gen_uint(values->HeaderlessMessageforPreemptableContextsMask, 21, 21); 12020} 12021 12022#define GFX125_SC_INSTDONE_num 0x7100 12023#define GFX125_SC_INSTDONE_length 1 12024struct GFX125_SC_INSTDONE { 12025 bool SVLDone; 12026 bool WMFEDone; 12027 bool WMBEDone; 12028 bool HIZDone; 12029 bool IZFEDone; 12030 bool SBEDone; 12031 bool RCCDone; 12032 bool RCPBEDone; 12033 bool RCPFEDone; 12034 bool DAPBDone; 12035 bool DAPRBEDone; 12036 bool SARBDone; 12037 bool DC0Done; 12038 bool DC1Done; 12039 bool DC2Done; 12040 bool DC3Done; 12041 bool GW0Done; 12042 bool GW1Done; 12043 bool GW2Done; 12044 bool GW3Done; 12045 bool TDCDone; 12046 bool SFBEDone; 12047 bool AMFSDone; 12048}; 12049 12050static inline __attribute__((always_inline)) void 12051GFX125_SC_INSTDONE_pack(__attribute__((unused)) __gen_user_data *data, 12052 __attribute__((unused)) void * restrict dst, 12053 __attribute__((unused)) const struct GFX125_SC_INSTDONE * restrict values) 12054{ 12055 uint32_t * restrict dw = (uint32_t * restrict) dst; 12056 12057 dw[0] = 12058 __gen_uint(values->SVLDone, 0, 0) | 12059 __gen_uint(values->WMFEDone, 1, 1) | 12060 __gen_uint(values->WMBEDone, 2, 2) | 12061 __gen_uint(values->HIZDone, 3, 3) | 12062 __gen_uint(values->IZFEDone, 5, 5) | 12063 __gen_uint(values->SBEDone, 6, 6) | 12064 __gen_uint(values->RCCDone, 9, 9) | 12065 __gen_uint(values->RCPBEDone, 10, 10) | 12066 __gen_uint(values->RCPFEDone, 11, 11) | 12067 __gen_uint(values->DAPBDone, 12, 12) | 12068 __gen_uint(values->DAPRBEDone, 13, 13) | 12069 __gen_uint(values->SARBDone, 15, 15) | 12070 __gen_uint(values->DC0Done, 16, 16) | 12071 __gen_uint(values->DC1Done, 17, 17) | 12072 __gen_uint(values->DC2Done, 18, 18) | 12073 __gen_uint(values->DC3Done, 19, 19) | 12074 __gen_uint(values->GW0Done, 20, 20) | 12075 __gen_uint(values->GW1Done, 21, 21) | 12076 __gen_uint(values->GW2Done, 22, 22) | 12077 __gen_uint(values->GW3Done, 23, 23) | 12078 __gen_uint(values->TDCDone, 24, 24) | 12079 __gen_uint(values->SFBEDone, 25, 25) | 12080 __gen_uint(values->AMFSDone, 27, 27); 12081} 12082 12083#define GFX125_SC_INSTDONE_EXTRA_num 0x7104 12084#define GFX125_SC_INSTDONE_EXTRA_length 1 12085struct GFX125_SC_INSTDONE_EXTRA { 12086 bool RCC1Done; 12087 bool RCPBE1Done; 12088 bool RCPFE1Done; 12089 bool DAPB1Done; 12090 bool DAPRBE1Done; 12091 bool DC4Done; 12092 bool DC5Done; 12093 bool DC6Done; 12094 bool DC7Done; 12095 bool GW4Done; 12096 bool GW5Done; 12097 bool GW6Done; 12098 bool GW7Done; 12099 bool TDC1Done; 12100}; 12101 12102static inline __attribute__((always_inline)) void 12103GFX125_SC_INSTDONE_EXTRA_pack(__attribute__((unused)) __gen_user_data *data, 12104 __attribute__((unused)) void * restrict dst, 12105 __attribute__((unused)) const struct GFX125_SC_INSTDONE_EXTRA * restrict values) 12106{ 12107 uint32_t * restrict dw = (uint32_t * restrict) dst; 12108 12109 dw[0] = 12110 __gen_uint(values->RCC1Done, 9, 9) | 12111 __gen_uint(values->RCPBE1Done, 10, 10) | 12112 __gen_uint(values->RCPFE1Done, 11, 11) | 12113 __gen_uint(values->DAPB1Done, 12, 12) | 12114 __gen_uint(values->DAPRBE1Done, 13, 13) | 12115 __gen_uint(values->DC4Done, 16, 16) | 12116 __gen_uint(values->DC5Done, 17, 17) | 12117 __gen_uint(values->DC6Done, 18, 18) | 12118 __gen_uint(values->DC7Done, 19, 19) | 12119 __gen_uint(values->GW4Done, 20, 20) | 12120 __gen_uint(values->GW5Done, 21, 21) | 12121 __gen_uint(values->GW6Done, 22, 22) | 12122 __gen_uint(values->GW7Done, 23, 23) | 12123 __gen_uint(values->TDC1Done, 24, 24); 12124} 12125 12126#define GFX125_SC_INSTDONE_EXTRA2_num 0x7108 12127#define GFX125_SC_INSTDONE_EXTRA2_length 1 12128struct GFX125_SC_INSTDONE_EXTRA2 { 12129 bool RCC2Done; 12130 bool RCPBE2Done; 12131 bool RCPFE2Done; 12132 bool DAPB2Done; 12133 bool DAPRBE2Done; 12134}; 12135 12136static inline __attribute__((always_inline)) void 12137GFX125_SC_INSTDONE_EXTRA2_pack(__attribute__((unused)) __gen_user_data *data, 12138 __attribute__((unused)) void * restrict dst, 12139 __attribute__((unused)) const struct GFX125_SC_INSTDONE_EXTRA2 * restrict values) 12140{ 12141 uint32_t * restrict dw = (uint32_t * restrict) dst; 12142 12143 dw[0] = 12144 __gen_uint(values->RCC2Done, 9, 9) | 12145 __gen_uint(values->RCPBE2Done, 10, 10) | 12146 __gen_uint(values->RCPFE2Done, 11, 11) | 12147 __gen_uint(values->DAPB2Done, 12, 12) | 12148 __gen_uint(values->DAPRBE2Done, 13, 13); 12149} 12150 12151#define GFX125_INSTDONE_GEOM_num 0x666c 12152#define GFX125_INSTDONE_GEOM_length 1 12153struct GFX125_INSTDONE_GEOM { 12154 bool VFLDone; 12155 bool VSDone; 12156 bool HSDone; 12157 bool TEDone; 12158 bool DSDone; 12159 bool GSDone; 12160 bool SOLDone; 12161 bool CLDone; 12162 bool SFDone; 12163 bool TDG1Done; 12164 bool URBMDone; 12165 bool SVGDone; 12166 bool TSG0Done; 12167 bool SDEDone; 12168}; 12169 12170static inline __attribute__((always_inline)) void 12171GFX125_INSTDONE_GEOM_pack(__attribute__((unused)) __gen_user_data *data, 12172 __attribute__((unused)) void * restrict dst, 12173 __attribute__((unused)) const struct GFX125_INSTDONE_GEOM * restrict values) 12174{ 12175 uint32_t * restrict dw = (uint32_t * restrict) dst; 12176 12177 dw[0] = 12178 __gen_uint(values->VFLDone, 1, 1) | 12179 __gen_uint(values->VSDone, 2, 2) | 12180 __gen_uint(values->HSDone, 3, 3) | 12181 __gen_uint(values->TEDone, 4, 4) | 12182 __gen_uint(values->DSDone, 5, 5) | 12183 __gen_uint(values->GSDone, 6, 6) | 12184 __gen_uint(values->SOLDone, 7, 7) | 12185 __gen_uint(values->CLDone, 8, 8) | 12186 __gen_uint(values->SFDone, 9, 9) | 12187 __gen_uint(values->TDG1Done, 11, 11) | 12188 __gen_uint(values->URBMDone, 13, 13) | 12189 __gen_uint(values->SVGDone, 14, 14) | 12190 __gen_uint(values->TSG0Done, 17, 17) | 12191 __gen_uint(values->SDEDone, 22, 22); 12192} 12193 12194#define GFX125_SLICE_COMMON_ECO_CHICKEN1_num 0x731c 12195#define GFX125_SLICE_COMMON_ECO_CHICKEN1_length 1 12196struct GFX125_SLICE_COMMON_ECO_CHICKEN1 { 12197 bool StateCacheRedirectToCSSectionEnable; 12198 bool StateCacheRedirectToCSSectionEnableMask; 12199}; 12200 12201static inline __attribute__((always_inline)) void 12202GFX125_SLICE_COMMON_ECO_CHICKEN1_pack(__attribute__((unused)) __gen_user_data *data, 12203 __attribute__((unused)) void * restrict dst, 12204 __attribute__((unused)) const struct GFX125_SLICE_COMMON_ECO_CHICKEN1 * restrict values) 12205{ 12206 uint32_t * restrict dw = (uint32_t * restrict) dst; 12207 12208 dw[0] = 12209 __gen_uint(values->StateCacheRedirectToCSSectionEnable, 11, 11) | 12210 __gen_uint(values->StateCacheRedirectToCSSectionEnableMask, 27, 27); 12211} 12212 12213#define GFX125_SO_NUM_PRIMS_WRITTEN0_num 0x5200 12214#define GFX125_SO_NUM_PRIMS_WRITTEN0_length 2 12215struct GFX125_SO_NUM_PRIMS_WRITTEN0 { 12216 uint64_t NumPrimsWrittenCount; 12217}; 12218 12219static inline __attribute__((always_inline)) void 12220GFX125_SO_NUM_PRIMS_WRITTEN0_pack(__attribute__((unused)) __gen_user_data *data, 12221 __attribute__((unused)) void * restrict dst, 12222 __attribute__((unused)) const struct GFX125_SO_NUM_PRIMS_WRITTEN0 * restrict values) 12223{ 12224 uint32_t * restrict dw = (uint32_t * restrict) dst; 12225 12226 const uint64_t v0 = 12227 __gen_uint(values->NumPrimsWrittenCount, 0, 63); 12228 dw[0] = v0; 12229 dw[1] = v0 >> 32; 12230} 12231 12232#define GFX125_SO_NUM_PRIMS_WRITTEN1_num 0x5208 12233#define GFX125_SO_NUM_PRIMS_WRITTEN1_length 2 12234struct GFX125_SO_NUM_PRIMS_WRITTEN1 { 12235 uint64_t NumPrimsWrittenCount; 12236}; 12237 12238static inline __attribute__((always_inline)) void 12239GFX125_SO_NUM_PRIMS_WRITTEN1_pack(__attribute__((unused)) __gen_user_data *data, 12240 __attribute__((unused)) void * restrict dst, 12241 __attribute__((unused)) const struct GFX125_SO_NUM_PRIMS_WRITTEN1 * restrict values) 12242{ 12243 uint32_t * restrict dw = (uint32_t * restrict) dst; 12244 12245 const uint64_t v0 = 12246 __gen_uint(values->NumPrimsWrittenCount, 0, 63); 12247 dw[0] = v0; 12248 dw[1] = v0 >> 32; 12249} 12250 12251#define GFX125_SO_NUM_PRIMS_WRITTEN2_num 0x5210 12252#define GFX125_SO_NUM_PRIMS_WRITTEN2_length 2 12253struct GFX125_SO_NUM_PRIMS_WRITTEN2 { 12254 uint64_t NumPrimsWrittenCount; 12255}; 12256 12257static inline __attribute__((always_inline)) void 12258GFX125_SO_NUM_PRIMS_WRITTEN2_pack(__attribute__((unused)) __gen_user_data *data, 12259 __attribute__((unused)) void * restrict dst, 12260 __attribute__((unused)) const struct GFX125_SO_NUM_PRIMS_WRITTEN2 * restrict values) 12261{ 12262 uint32_t * restrict dw = (uint32_t * restrict) dst; 12263 12264 const uint64_t v0 = 12265 __gen_uint(values->NumPrimsWrittenCount, 0, 63); 12266 dw[0] = v0; 12267 dw[1] = v0 >> 32; 12268} 12269 12270#define GFX125_SO_NUM_PRIMS_WRITTEN3_num 0x5218 12271#define GFX125_SO_NUM_PRIMS_WRITTEN3_length 2 12272struct GFX125_SO_NUM_PRIMS_WRITTEN3 { 12273 uint64_t NumPrimsWrittenCount; 12274}; 12275 12276static inline __attribute__((always_inline)) void 12277GFX125_SO_NUM_PRIMS_WRITTEN3_pack(__attribute__((unused)) __gen_user_data *data, 12278 __attribute__((unused)) void * restrict dst, 12279 __attribute__((unused)) const struct GFX125_SO_NUM_PRIMS_WRITTEN3 * restrict values) 12280{ 12281 uint32_t * restrict dw = (uint32_t * restrict) dst; 12282 12283 const uint64_t v0 = 12284 __gen_uint(values->NumPrimsWrittenCount, 0, 63); 12285 dw[0] = v0; 12286 dw[1] = v0 >> 32; 12287} 12288 12289#define GFX125_SO_PRIM_STORAGE_NEEDED0_num 0x5240 12290#define GFX125_SO_PRIM_STORAGE_NEEDED0_length 2 12291struct GFX125_SO_PRIM_STORAGE_NEEDED0 { 12292 uint64_t PrimStorageNeededCount; 12293}; 12294 12295static inline __attribute__((always_inline)) void 12296GFX125_SO_PRIM_STORAGE_NEEDED0_pack(__attribute__((unused)) __gen_user_data *data, 12297 __attribute__((unused)) void * restrict dst, 12298 __attribute__((unused)) const struct GFX125_SO_PRIM_STORAGE_NEEDED0 * restrict values) 12299{ 12300 uint32_t * restrict dw = (uint32_t * restrict) dst; 12301 12302 const uint64_t v0 = 12303 __gen_uint(values->PrimStorageNeededCount, 0, 63); 12304 dw[0] = v0; 12305 dw[1] = v0 >> 32; 12306} 12307 12308#define GFX125_SO_PRIM_STORAGE_NEEDED1_num 0x5248 12309#define GFX125_SO_PRIM_STORAGE_NEEDED1_length 2 12310struct GFX125_SO_PRIM_STORAGE_NEEDED1 { 12311 uint64_t PrimStorageNeededCount; 12312}; 12313 12314static inline __attribute__((always_inline)) void 12315GFX125_SO_PRIM_STORAGE_NEEDED1_pack(__attribute__((unused)) __gen_user_data *data, 12316 __attribute__((unused)) void * restrict dst, 12317 __attribute__((unused)) const struct GFX125_SO_PRIM_STORAGE_NEEDED1 * restrict values) 12318{ 12319 uint32_t * restrict dw = (uint32_t * restrict) dst; 12320 12321 const uint64_t v0 = 12322 __gen_uint(values->PrimStorageNeededCount, 0, 63); 12323 dw[0] = v0; 12324 dw[1] = v0 >> 32; 12325} 12326 12327#define GFX125_SO_PRIM_STORAGE_NEEDED2_num 0x5250 12328#define GFX125_SO_PRIM_STORAGE_NEEDED2_length 2 12329struct GFX125_SO_PRIM_STORAGE_NEEDED2 { 12330 uint64_t PrimStorageNeededCount; 12331}; 12332 12333static inline __attribute__((always_inline)) void 12334GFX125_SO_PRIM_STORAGE_NEEDED2_pack(__attribute__((unused)) __gen_user_data *data, 12335 __attribute__((unused)) void * restrict dst, 12336 __attribute__((unused)) const struct GFX125_SO_PRIM_STORAGE_NEEDED2 * restrict values) 12337{ 12338 uint32_t * restrict dw = (uint32_t * restrict) dst; 12339 12340 const uint64_t v0 = 12341 __gen_uint(values->PrimStorageNeededCount, 0, 63); 12342 dw[0] = v0; 12343 dw[1] = v0 >> 32; 12344} 12345 12346#define GFX125_SO_PRIM_STORAGE_NEEDED3_num 0x5258 12347#define GFX125_SO_PRIM_STORAGE_NEEDED3_length 2 12348struct GFX125_SO_PRIM_STORAGE_NEEDED3 { 12349 uint64_t PrimStorageNeededCount; 12350}; 12351 12352static inline __attribute__((always_inline)) void 12353GFX125_SO_PRIM_STORAGE_NEEDED3_pack(__attribute__((unused)) __gen_user_data *data, 12354 __attribute__((unused)) void * restrict dst, 12355 __attribute__((unused)) const struct GFX125_SO_PRIM_STORAGE_NEEDED3 * restrict values) 12356{ 12357 uint32_t * restrict dw = (uint32_t * restrict) dst; 12358 12359 const uint64_t v0 = 12360 __gen_uint(values->PrimStorageNeededCount, 0, 63); 12361 dw[0] = v0; 12362 dw[1] = v0 >> 32; 12363} 12364 12365#define GFX125_SO_WRITE_OFFSET0_num 0x5280 12366#define GFX125_SO_WRITE_OFFSET0_length 1 12367struct GFX125_SO_WRITE_OFFSET0 { 12368 uint64_t WriteOffset; 12369}; 12370 12371static inline __attribute__((always_inline)) void 12372GFX125_SO_WRITE_OFFSET0_pack(__attribute__((unused)) __gen_user_data *data, 12373 __attribute__((unused)) void * restrict dst, 12374 __attribute__((unused)) const struct GFX125_SO_WRITE_OFFSET0 * restrict values) 12375{ 12376 uint32_t * restrict dw = (uint32_t * restrict) dst; 12377 12378 dw[0] = 12379 __gen_offset(values->WriteOffset, 2, 31); 12380} 12381 12382#define GFX125_SO_WRITE_OFFSET1_num 0x5284 12383#define GFX125_SO_WRITE_OFFSET1_length 1 12384struct GFX125_SO_WRITE_OFFSET1 { 12385 uint64_t WriteOffset; 12386}; 12387 12388static inline __attribute__((always_inline)) void 12389GFX125_SO_WRITE_OFFSET1_pack(__attribute__((unused)) __gen_user_data *data, 12390 __attribute__((unused)) void * restrict dst, 12391 __attribute__((unused)) const struct GFX125_SO_WRITE_OFFSET1 * restrict values) 12392{ 12393 uint32_t * restrict dw = (uint32_t * restrict) dst; 12394 12395 dw[0] = 12396 __gen_offset(values->WriteOffset, 2, 31); 12397} 12398 12399#define GFX125_SO_WRITE_OFFSET2_num 0x5288 12400#define GFX125_SO_WRITE_OFFSET2_length 1 12401struct GFX125_SO_WRITE_OFFSET2 { 12402 uint64_t WriteOffset; 12403}; 12404 12405static inline __attribute__((always_inline)) void 12406GFX125_SO_WRITE_OFFSET2_pack(__attribute__((unused)) __gen_user_data *data, 12407 __attribute__((unused)) void * restrict dst, 12408 __attribute__((unused)) const struct GFX125_SO_WRITE_OFFSET2 * restrict values) 12409{ 12410 uint32_t * restrict dw = (uint32_t * restrict) dst; 12411 12412 dw[0] = 12413 __gen_offset(values->WriteOffset, 2, 31); 12414} 12415 12416#define GFX125_SO_WRITE_OFFSET3_num 0x528c 12417#define GFX125_SO_WRITE_OFFSET3_length 1 12418struct GFX125_SO_WRITE_OFFSET3 { 12419 uint64_t WriteOffset; 12420}; 12421 12422static inline __attribute__((always_inline)) void 12423GFX125_SO_WRITE_OFFSET3_pack(__attribute__((unused)) __gen_user_data *data, 12424 __attribute__((unused)) void * restrict dst, 12425 __attribute__((unused)) const struct GFX125_SO_WRITE_OFFSET3 * restrict values) 12426{ 12427 uint32_t * restrict dw = (uint32_t * restrict) dst; 12428 12429 dw[0] = 12430 __gen_offset(values->WriteOffset, 2, 31); 12431} 12432 12433#define GFX125_VCS_INSTDONE_num 0x1206c 12434#define GFX125_VCS_INSTDONE_length 1 12435struct GFX125_VCS_INSTDONE { 12436 bool RingEnable; 12437 bool USBDone; 12438 bool QRCDone; 12439 bool SECDone; 12440 bool MPCDone; 12441 bool VFTDone; 12442 bool BSPDone; 12443 bool VLFDone; 12444 bool VOPDone; 12445 bool VMCDone; 12446 bool VIPDone; 12447 bool VITDone; 12448 bool VDSDone; 12449 bool VMXDone; 12450 bool VCPDone; 12451 bool VCDDone; 12452 bool VADDone; 12453 bool VMDDone; 12454 bool VISDone; 12455 bool VACDone; 12456 bool VAMDone; 12457 bool JPGDone; 12458 bool VBPDone; 12459 bool VHRDone; 12460 bool VCIDone; 12461 bool VINDone; 12462 bool VPRDone; 12463 bool VTQDone; 12464 bool Reserved; 12465 bool VCSDone; 12466 bool GACDone; 12467}; 12468 12469static inline __attribute__((always_inline)) void 12470GFX125_VCS_INSTDONE_pack(__attribute__((unused)) __gen_user_data *data, 12471 __attribute__((unused)) void * restrict dst, 12472 __attribute__((unused)) const struct GFX125_VCS_INSTDONE * restrict values) 12473{ 12474 uint32_t * restrict dw = (uint32_t * restrict) dst; 12475 12476 dw[0] = 12477 __gen_uint(values->RingEnable, 0, 0) | 12478 __gen_uint(values->USBDone, 1, 1) | 12479 __gen_uint(values->QRCDone, 2, 2) | 12480 __gen_uint(values->SECDone, 3, 3) | 12481 __gen_uint(values->MPCDone, 4, 4) | 12482 __gen_uint(values->VFTDone, 5, 5) | 12483 __gen_uint(values->BSPDone, 6, 6) | 12484 __gen_uint(values->VLFDone, 7, 7) | 12485 __gen_uint(values->VOPDone, 8, 8) | 12486 __gen_uint(values->VMCDone, 9, 9) | 12487 __gen_uint(values->VIPDone, 10, 10) | 12488 __gen_uint(values->VITDone, 11, 11) | 12489 __gen_uint(values->VDSDone, 12, 12) | 12490 __gen_uint(values->VMXDone, 13, 13) | 12491 __gen_uint(values->VCPDone, 14, 14) | 12492 __gen_uint(values->VCDDone, 15, 15) | 12493 __gen_uint(values->VADDone, 16, 16) | 12494 __gen_uint(values->VMDDone, 17, 17) | 12495 __gen_uint(values->VISDone, 18, 18) | 12496 __gen_uint(values->VACDone, 19, 19) | 12497 __gen_uint(values->VAMDone, 20, 20) | 12498 __gen_uint(values->JPGDone, 21, 21) | 12499 __gen_uint(values->VBPDone, 22, 22) | 12500 __gen_uint(values->VHRDone, 23, 23) | 12501 __gen_uint(values->VCIDone, 24, 24) | 12502 __gen_uint(values->VINDone, 26, 26) | 12503 __gen_uint(values->VPRDone, 27, 27) | 12504 __gen_uint(values->VTQDone, 28, 28) | 12505 __gen_uint(values->Reserved, 29, 29) | 12506 __gen_uint(values->VCSDone, 30, 30) | 12507 __gen_uint(values->GACDone, 31, 31); 12508} 12509 12510#define GFX125_VS_INVOCATION_COUNT_num 0x2320 12511#define GFX125_VS_INVOCATION_COUNT_length 2 12512struct GFX125_VS_INVOCATION_COUNT { 12513 uint64_t VSInvocationCountReport; 12514}; 12515 12516static inline __attribute__((always_inline)) void 12517GFX125_VS_INVOCATION_COUNT_pack(__attribute__((unused)) __gen_user_data *data, 12518 __attribute__((unused)) void * restrict dst, 12519 __attribute__((unused)) const struct GFX125_VS_INVOCATION_COUNT * restrict values) 12520{ 12521 uint32_t * restrict dw = (uint32_t * restrict) dst; 12522 12523 const uint64_t v0 = 12524 __gen_uint(values->VSInvocationCountReport, 0, 63); 12525 dw[0] = v0; 12526 dw[1] = v0 >> 32; 12527} 12528 12529#endif /* GFX125_PACK_H */ 12530