Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-mesa: Commit

external/mesa


Commit MetaInfo

Revisióncecfe9b844f8f6ee6f4e26f41aad32f36d8e083f (tree)
Tiempo2020-03-07 06:59:45
AutorJason Ekstrand <jason@jlek...>
CommiterEric Engestrom

Log Message

isl: Set 3DSTATE_DEPTH_BUFFER::Depth correctly for 3D surfaces

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3717>
(cherry picked from commit 9f5f4269a66eebfcaa3ae5cd7bdf91d88a7fc69c)

Cambiar Resumen

Diferencia incremental

--- a/.pick_status.json
+++ b/.pick_status.json
@@ -652,7 +652,7 @@
652652 "description": "isl: Set 3DSTATE_DEPTH_BUFFER::Depth correctly for 3D surfaces",
653653 "nominated": true,
654654 "nomination_type": 0,
655- "resolution": 0,
655+ "resolution": 1,
656656 "master_sha": null,
657657 "because_sha": null
658658 },
--- a/src/intel/isl/isl_emit_depth_stencil.c
+++ b/src/intel/isl/isl_emit_depth_stencil.c
@@ -71,11 +71,15 @@ isl_genX(emit_depth_stencil_hiz_s)(const struct isl_device *dev, void *batch,
7171 db.SurfaceFormat = isl_surf_get_depth_format(dev, info->depth_surf);
7272 db.Width = info->depth_surf->logical_level0_px.width - 1;
7373 db.Height = info->depth_surf->logical_level0_px.height - 1;
74+ if (db.SurfaceType == SURFTYPE_3D)
75+ db.Depth = info->depth_surf->logical_level0_px.depth - 1;
7476 } else if (info->stencil_surf) {
7577 db.SurfaceType = isl_to_gen_ds_surftype[info->stencil_surf->dim];
7678 db.SurfaceFormat = D32_FLOAT;
7779 db.Width = info->stencil_surf->logical_level0_px.width - 1;
7880 db.Height = info->stencil_surf->logical_level0_px.height - 1;
81+ if (db.SurfaceType == SURFTYPE_3D)
82+ db.Depth = info->stencil_surf->logical_level0_px.depth - 1;
7983 } else {
8084 db.SurfaceType = SURFTYPE_NULL;
8185 db.SurfaceFormat = D32_FLOAT;
@@ -83,9 +87,23 @@ isl_genX(emit_depth_stencil_hiz_s)(const struct isl_device *dev, void *batch,
8387
8488 if (info->depth_surf || info->stencil_surf) {
8589 /* These are based entirely on the view */
86- db.Depth = db.RenderTargetViewExtent = info->view->array_len - 1;
90+ db.RenderTargetViewExtent = info->view->array_len - 1;
8791 db.LOD = info->view->base_level;
8892 db.MinimumArrayElement = info->view->base_array_layer;
93+
94+ /* From the Haswell PRM docs for 3DSTATE_DEPTH_BUFFER::Depth
95+ *
96+ * "This field specifies the total number of levels for a volume
97+ * texture or the number of array elements allowed to be accessed
98+ * starting at the Minimum Array Element for arrayed surfaces. If the
99+ * volume texture is MIP-mapped, this field specifies the depth of
100+ * the base MIP level."
101+ *
102+ * For 3D surfaces, we set it to the correct depth above. For non-3D
103+ * surfaces, this is the same as RenderTargetViewExtent.
104+ */
105+ if (db.SurfaceType != SURFTYPE_3D)
106+ db.Depth = db.RenderTargetViewExtent;
89107 }
90108
91109 if (info->depth_surf) {
Show on old repository browser