~mmach/netext73/mesa-ryzen

« back to all changes in this revision

Viewing changes to src/intel/isl/isl_surface_state.c

  • Committer: mmach
  • Date: 2023-11-02 21:31:35 UTC
  • Revision ID: netbit73@gmail.com-20231102213135-18d4tzh7tj0uz752
2023-11-02 22:11:57

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
   [ISL_AUX_USAGE_NONE] = AUX_NONE,
72
72
   [ISL_AUX_USAGE_MC] = AUX_NONE,
73
73
   [ISL_AUX_USAGE_MCS] = AUX_CCS_E,
74
 
   [ISL_AUX_USAGE_GFX12_CCS_E] = AUX_CCS_E,
 
74
   [ISL_AUX_USAGE_FCV_CCS_E] = AUX_CCS_E,
75
75
   [ISL_AUX_USAGE_CCS_E] = AUX_CCS_E,
76
76
   [ISL_AUX_USAGE_HIZ_CCS_WT] = AUX_CCS_E,
77
77
   [ISL_AUX_USAGE_MCS_CCS] = AUX_MCS_LCE,
336
336
         s.RenderTargetViewExtent = s.Depth;
337
337
      break;
338
338
   case SURFTYPE_3D:
339
 
      assert(info->view->base_array_layer + info->view->array_len <=
340
 
             isl_minify(info->surf->logical_level0_px.depth,
341
 
                        info->view->base_level));
342
 
 
343
339
      /* From the Broadwell PRM >> RENDER_SURFACE_STATE::Depth:
344
340
       *
345
341
       *    If the volume texture is MIP-mapped, this field specifies the
346
342
       *    depth of the base MIP level.
347
343
       */
348
 
      if (GFX_VER >= 9 && info->view->usage & ISL_SURF_USAGE_STORAGE_BIT) {
349
 
         /* From the Kaby Lake docs for the RESINFO message:
350
 
          *
351
 
          *    "Surface Type | ... | Blue
352
 
          *    --------------+-----+----------------
353
 
          *     SURFTYPE_3D  | ... | (Depth+1)»LOD"
354
 
          *
355
 
          * which isn't actually what the Vulkan or D3D specs want for storage
356
 
          * images.  We want the requested array size.  The good news is that,
357
 
          * thanks to Skylake and later using the same image layout for 3D
358
 
          * images as 2D array images, we should be able to adjust the depth
359
 
          * without affecting the layout.
360
 
          */
361
 
         s.Depth = (info->view->array_len << info->view->base_level) - 1;
362
 
      } else {
363
 
         s.Depth = info->surf->logical_level0_px.depth - 1;
364
 
      }
 
344
      s.Depth = info->surf->logical_level0_px.depth - 1;
365
345
 
366
346
      /* From the Broadwell PRM >> RENDER_SURFACE_STATE::RenderTargetViewExtent:
367
347
       *
388
368
      unreachable("bad SurfaceType");
389
369
   }
390
370
 
391
 
#if GFX_VER >= 12
392
 
   /* Wa_1806565034:
393
 
    *
394
 
    *    "Only set SurfaceArray if arrayed surface is > 1."
395
 
    *
396
 
    * Since this is a performance workaround, we only enable it when robust
397
 
    * image access is disabled. Otherwise layered robust access is not
398
 
    * specification compliant.
399
 
    */
400
 
   s.SurfaceArray = info->surf->dim != ISL_SURF_DIM_3D &&
401
 
      (info->robust_image_access || info->view->array_len > 1);
402
 
#elif GFX_VER >= 7
403
 
   s.SurfaceArray = info->surf->dim != ISL_SURF_DIM_3D;
 
371
#if GFX_VER >= 7
 
372
   if (INTEL_NEEDS_WA_1806565034) {
 
373
      /* Wa_1806565034:
 
374
       *
 
375
       *    "Only set SurfaceArray if arrayed surface is > 1."
 
376
       *
 
377
       * Since this is a performance workaround, we only enable it when robust
 
378
       * image access is disabled. Otherwise layered robust access is not
 
379
       * specification compliant.
 
380
       */
 
381
      s.SurfaceArray = info->surf->dim != ISL_SURF_DIM_3D &&
 
382
         (info->robust_image_access || info->view->array_len > 1);
 
383
   } else {
 
384
      s.SurfaceArray = info->surf->dim != ISL_SURF_DIM_3D;
 
385
   }
404
386
#endif
405
387
 
406
388
   if (info->view->usage & ISL_SURF_USAGE_RENDER_TARGET_BIT) {
425
407
   /* We don't use miptails yet.  The PRM recommends that you set "Mip Tail
426
408
    * Start LOD" to 15 to prevent the hardware from trying to use them.
427
409
    */
428
 
   s.TiledResourceMode = NONE;
429
410
   s.MipTailStartLOD = 15;
430
411
#endif
431
412
 
480
461
   s.RenderCacheReadWriteMode = 0;
481
462
#endif
482
463
 
483
 
#if GFX_VER >= 11
 
464
#if GFX_VER >= 11 && GFX_VERx10 < 125
484
465
   /* We've seen dEQP failures when enabling this bit with UINT formats,
485
466
    * which particularly affects blorp_copy() operations.  It shouldn't
486
467
    * have any effect on UINT textures anyway, so disable it for them.
585
566
      if (GFX_VER >= 12) {
586
567
         assert(info->aux_usage == ISL_AUX_USAGE_MCS ||
587
568
                info->aux_usage == ISL_AUX_USAGE_CCS_E ||
588
 
                info->aux_usage == ISL_AUX_USAGE_GFX12_CCS_E ||
 
569
                info->aux_usage == ISL_AUX_USAGE_FCV_CCS_E ||
589
570
                info->aux_usage == ISL_AUX_USAGE_MC ||
590
571
                info->aux_usage == ISL_AUX_USAGE_HIZ_CCS_WT ||
591
572
                info->aux_usage == ISL_AUX_USAGE_MCS_CCS ||
695
676
       *
696
677
       * If CCS_E is in use, the format must support it.
697
678
       */
698
 
      if (info->aux_usage == ISL_AUX_USAGE_CCS_E ||
699
 
          info->aux_usage == ISL_AUX_USAGE_GFX12_CCS_E)
 
679
      if (isl_aux_usage_has_ccs_e(info->aux_usage))
700
680
         assert(isl_format_supports_ccs_e(dev->info, info->view->format));
701
681
 
702
682
      /* It also says: