[Mesa-dev] [PATCH 3/5] nvc0: remove unused data in driver CB at 0x0 for Kepler

Samuel Pitoiset samuel.pitoiset at gmail.com
Tue Mar 15 20:55:50 UTC 2016


This weird thing is there since 2013 and doesn't seem to be used
(according to the codegent part). I have carefully read the code to
make sure this is really unused but I will double-check with piglit.

This frees the first 32 bytes of the driver constant buffer.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
index 3c5b1da..d316235 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
@@ -917,22 +917,16 @@ nvc0_screen_create(struct nouveau_device *dev)
 
    PUSH_REFN (push, screen->uniform_bo, NV_VRAM_DOMAIN(&screen->base) | NOUVEAU_BO_WR);
 
+   /* Bind driver constant buffer for all 3d-related shaders and set texture
+    * limits for Fermi. */
    for (i = 0; i < 5; ++i) {
-      /* TIC and TSC entries for each unit (nve4+ only) */
-      /* auxiliary constants (6 user clip planes, base instance id) */
       BEGIN_NVC0(push, NVC0_3D(CB_SIZE), 3);
       PUSH_DATA (push, 1024);
       PUSH_DATAh(push, screen->uniform_bo->offset + (6 << 16) + (i << 10));
       PUSH_DATA (push, screen->uniform_bo->offset + (6 << 16) + (i << 10));
       BEGIN_NVC0(push, NVC0_3D(CB_BIND(i)), 1);
       PUSH_DATA (push, (15 << 4) | 1);
-      if (screen->eng3d->oclass >= NVE4_3D_CLASS) {
-         unsigned j;
-         BEGIN_1IC0(push, NVC0_3D(CB_POS), 9);
-         PUSH_DATA (push, 0);
-         for (j = 0; j < 8; ++j)
-            PUSH_DATA(push, j);
-      } else {
+      if (screen->eng3d->oclass < NVE4_3D_CLASS) {
          BEGIN_NVC0(push, NVC0_3D(TEX_LIMITS(i)), 1);
          PUSH_DATA (push, 0x54);
       }
-- 
2.7.3



More information about the mesa-dev mailing list