Mesa (master): glapi: Move PrimitiveBoundingBox and BlendBarrier definitions into ES3.2 category.

2016-10-20 Thread Francisco Jerez
Module: Mesa
Branch: master
Commit: 15a084a03998c5c86206137fdaf6f43b5f98485a
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=15a084a03998c5c86206137fdaf6f43b5f98485a

Author: Francisco Jerez 
Date:   Tue Oct 18 14:53:20 2016 -0700

glapi: Move PrimitiveBoundingBox and BlendBarrier definitions into ES3.2 
category.

These two GLES 3.2 entry points were being defined in the category of
the ARB_ES3_2_compatibility and KHR_blend_equation_advanced extensions
respectively instead of in the ES3.2 category.  Defining them in the
ES3.2 category makes sure that the gl_procs.py generator emits
declarations in the glprocs.h header file for the unsuffixed GLES-only
entry points that PrimitiveBoundingBoxARB and BlendBarrierKHR
respectively alias.  This should avoid a compilation failure during
scons builds in combination with "mapi: export all GLES 3.2 functions
in libGLESv2.so".

Cc: mesa-sta...@lists.freedesktop.org
Reviewed-by: Dylan Baker 

---

 src/mapi/glapi/gen/gl_API.xml | 30 +-
 1 file changed, 17 insertions(+), 13 deletions(-)

diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index 5998ccf..00c9bb7 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -8296,6 +8296,23 @@
 
 http://www.w3.org/2001/XInclude"/>
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 
 
@@ -8316,7 +8333,6 @@
 
 
 
-
 
 
 
@@ -8332,18 +8348,6 @@
 
 
 
-
-
-
-
-
-
-
-
-
-
-
 
 
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): Revert "Revert "mapi: export all GLES 3.2 functions in libGLESv2.so""

2016-10-20 Thread Francisco Jerez
Module: Mesa
Branch: master
Commit: 811eb7f178b8b85ac299121ac09a3180b9b55da2
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=811eb7f178b8b85ac299121ac09a3180b9b55da2

Author: Francisco Jerez 
Date:   Tue Oct 18 20:44:10 2016 -0700

Revert "Revert "mapi: export all GLES 3.2 functions in libGLESv2.so""

This reverts commit 85e9bbc14d93fa7166c9ae075ee7ae29a8313e3f.  The
previous commit should help with the scons build failure caused by the
original commit.

Cc: mesa-sta...@lists.freedesktop.org
Reviewed-by: Dylan Baker 

---

 src/mapi/glapi/gen/static_data.py | 12 
 1 file changed, 12 insertions(+)

diff --git a/src/mapi/glapi/gen/static_data.py 
b/src/mapi/glapi/gen/static_data.py
index 2f403e9..25e78bf 100644
--- a/src/mapi/glapi/gen/static_data.py
+++ b/src/mapi/glapi/gen/static_data.py
@@ -484,17 +484,22 @@ functions = [
 "BindVertexBuffer",
 "BindVertexBuffers",
 "Bitmap",
+"BlendBarrier",
 "BlendColor",
 "BlendColorEXT",
 "BlendEquation",
 "BlendEquationEXT",
+"BlendEquationi",
 "BlendEquationiARB",
 "BlendEquationSeparate",
+"BlendEquationSeparatei",
 "BlendEquationSeparateiARB",
 "BlendFunc",
+"BlendFunci",
 "BlendFunciARB",
 "BlendFuncSeparate",
 "BlendFuncSeparateEXT",
+"BlendFuncSeparatei",
 "BlendFuncSeparateiARB",
 "BlitFramebuffer",
 "BufferData",
@@ -825,6 +830,7 @@ functions = [
 "GetFramebufferAttachmentParameteriv",
 "GetFramebufferAttachmentParameterivEXT",
 "GetFramebufferParameteriv",
+"GetGraphicsResetStatus",
 "GetGraphicsResetStatusARB",
 "GetHandleARB",
 "GetHistogram",
@@ -864,8 +870,11 @@ functions = [
 "GetnSeparableFilterARB",
 "GetnTexImageARB",
 "GetnUniformdvARB",
+"GetnUniformfv",
 "GetnUniformfvARB",
+"GetnUniformiv",
 "GetnUniformivARB",
+"GetnUniformuiv",
 "GetnUniformuivARB",
 "GetObjectLabel",
 "GetObjectParameterfvARB",
@@ -1160,6 +1169,7 @@ functions = [
 "Orthof",
 "Orthox",
 "PassThrough",
+"PatchParameteri",
 "PauseTransformFeedback",
 "PixelMapfv",
 "PixelMapuiv",
@@ -1191,6 +1201,7 @@ functions = [
 "PopDebugGroup",
 "PopMatrix",
 "PopName",
+"PrimitiveBoundingBox",
 "PrimitiveRestartIndex",
 "PrimitiveRestartIndexNV",
 "PrimitiveRestartNV",
@@ -1273,6 +1284,7 @@ functions = [
 "RasterPos4s",
 "RasterPos4sv",
 "ReadBuffer",
+"ReadnPixels",
 "ReadnPixelsARB",
 "ReadPixels",
 "Rectd",

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): util: Include string.h in bitscan.h.

2016-10-20 Thread Vinson Lee
Module: Mesa
Branch: master
Commit: 889ee4da05400687a6c5296a7632dc26f1d61924
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=889ee4da05400687a6c5296a7632dc26f1d61924

Author: Vinson Lee 
Date:   Wed Oct 19 18:03:12 2016 -0700

util: Include string.h in bitscan.h.

Fix build error with clang.

  Compiling src/compiler/glsl/link_varyings.cpp ...
In file included from src/compiler/glsl/link_varyings.cpp:33:
In file included from src/compiler/glsl/glsl_symbol_table.h:34:
In file included from src/compiler/glsl/ir.h:33:
In file included from src/compiler/glsl_types.h:29:
/usr/include/string.h:518:12: error: exception specification in declaration 
does not match previous declaration
extern int ffs (int __i) __THROW __attribute__ ((__const__));
   ^
src/util/bitscan.h:51:13: note: expanded from macro 'ffs'
^
src/util/bitscan.h:96:18: note: previous declaration is here
   const int i = ffs(*mask) - 1;
 ^
src/util/bitscan.h:51:13: note: expanded from macro 'ffs'
^

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97952
Signed-off-by: Vinson Lee 
Reviewed-by: Timothy Arceri 

---

 src/util/bitscan.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/util/bitscan.h b/src/util/bitscan.h
index 8afef81..a5dfa1f 100644
--- a/src/util/bitscan.h
+++ b/src/util/bitscan.h
@@ -31,6 +31,7 @@
 
 #include 
 #include 
+#include 
 
 #if defined(_MSC_VER)
 #include 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): nvc0: do not break 3D state by pushing MS coordinates on Fermi

2016-10-20 Thread Samuel Pitoiset
Module: Mesa
Branch: master
Commit: 42273edf79c2500957f51690499aa3405cc689db
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=42273edf79c2500957f51690499aa3405cc689db

Author: Samuel Pitoiset 
Date:   Thu Oct 20 00:41:00 2016 +0200

nvc0: do not break 3D state by pushing MS coordinates on Fermi

Long story short, 3D and CP are aliased on Fermi and initializing
compute after pushing the MS sample coordinate offsets seems to
corrupt 3D state for weird reasons.

I still don't have the faintest clue what is going on, but
this seems to only affect Fermi generation. A possible fix
could be to use two different channels, one for 3D and one
for CP.

This fixes a bunch of regressions pinpointed by piglit.

Fixes: "nvc0: fix up image support for allowing multiple samples"
Cc: "13.0" 
Signed-off-by: Samuel Pitoiset 
Reviewed-by: Ilia Mirkin 

---

 src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 87 +-
 1 file changed, 44 insertions(+), 43 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c 
b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
index cfa2f76..2cac3c7 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
@@ -1002,49 +1002,6 @@ nvc0_screen_create(struct nouveau_device *dev)
 
PUSH_REFN (push, screen->uniform_bo, NV_VRAM_DOMAIN(>base) | 
NOUVEAU_BO_WR);
 
-   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, NVC0_CB_AUX_SIZE);
-  PUSH_DATAh(push, screen->uniform_bo->offset + NVC0_CB_AUX_INFO(i));
-  PUSH_DATA (push, screen->uniform_bo->offset + NVC0_CB_AUX_INFO(i));
-  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, NVC0_CB_AUX_UNK_INFO);
- for (j = 0; j < 8; ++j)
-PUSH_DATA(push, j);
-  } else {
- BEGIN_NVC0(push, NVC0_3D(TEX_LIMITS(i)), 1);
- PUSH_DATA (push, 0x54);
-  }
-
-  /* MS sample coordinate offsets: these do not work with _ALT modes ! */
-  BEGIN_1IC0(push, NVC0_3D(CB_POS), 1 + 2 * 8);
-  PUSH_DATA (push, NVC0_CB_AUX_MS_INFO);
-  PUSH_DATA (push, 0); /* 0 */
-  PUSH_DATA (push, 0);
-  PUSH_DATA (push, 1); /* 1 */
-  PUSH_DATA (push, 0);
-  PUSH_DATA (push, 0); /* 2 */
-  PUSH_DATA (push, 1);
-  PUSH_DATA (push, 1); /* 3 */
-  PUSH_DATA (push, 1);
-  PUSH_DATA (push, 2); /* 4 */
-  PUSH_DATA (push, 0);
-  PUSH_DATA (push, 3); /* 5 */
-  PUSH_DATA (push, 0);
-  PUSH_DATA (push, 2); /* 6 */
-  PUSH_DATA (push, 1);
-  PUSH_DATA (push, 3); /* 7 */
-  PUSH_DATA (push, 1);
-   }
-   BEGIN_NVC0(push, NVC0_3D(LINKED_TSC), 1);
-   PUSH_DATA (push, 0);
-
/* return { 0.0, 0.0, 0.0, 0.0 } for out-of-bounds vtxbuf access */
BEGIN_NVC0(push, NVC0_3D(CB_SIZE), 3);
PUSH_DATA (push, 256);
@@ -1214,6 +1171,50 @@ nvc0_screen_create(struct nouveau_device *dev)
if (nvc0_screen_init_compute(screen))
   goto fail;
 
+   /* XXX: Compute and 3D are somehow aliased on 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, NVC0_CB_AUX_SIZE);
+  PUSH_DATAh(push, screen->uniform_bo->offset + NVC0_CB_AUX_INFO(i));
+  PUSH_DATA (push, screen->uniform_bo->offset + NVC0_CB_AUX_INFO(i));
+  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, NVC0_CB_AUX_UNK_INFO);
+ for (j = 0; j < 8; ++j)
+PUSH_DATA(push, j);
+  } else {
+ BEGIN_NVC0(push, NVC0_3D(TEX_LIMITS(i)), 1);
+ PUSH_DATA (push, 0x54);
+  }
+
+  /* MS sample coordinate offsets: these do not work with _ALT modes ! */
+  BEGIN_1IC0(push, NVC0_3D(CB_POS), 1 + 2 * 8);
+  PUSH_DATA (push, NVC0_CB_AUX_MS_INFO);
+  PUSH_DATA (push, 0); /* 0 */
+  PUSH_DATA (push, 0);
+  PUSH_DATA (push, 1); /* 1 */
+  PUSH_DATA (push, 0);
+  PUSH_DATA (push, 0); /* 2 */
+  PUSH_DATA (push, 1);
+  PUSH_DATA (push, 1); /* 3 */
+  PUSH_DATA (push, 1);
+  PUSH_DATA (push, 2); /* 4 */
+  PUSH_DATA (push, 0);
+  PUSH_DATA (push, 3); /* 5 */
+  PUSH_DATA (push, 0);
+  PUSH_DATA (push, 2); /* 6 */
+  PUSH_DATA (push, 1);
+  PUSH_DATA (push, 3); /* 7 */
+  PUSH_DATA (push, 1);
+   }
+   

Mesa (master): nvc0: translate compute shaders at program creation

2016-10-20 Thread Samuel Pitoiset
Module: Mesa
Branch: master
Commit: 24e15aa198401d5e8d937d6f8a24757e08820d79
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=24e15aa198401d5e8d937d6f8a24757e08820d79

Author: Samuel Pitoiset 
Date:   Thu Oct 20 18:08:44 2016 +0200

nvc0: translate compute shaders at program creation

This makes shader-db reports results for compute shaders.

Signed-off-by: Samuel Pitoiset 
Reviewed-by: Ilia Mirkin 

---

 src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c 
b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
index aac296c..928b785 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
@@ -685,6 +685,10 @@ nvc0_cp_state_create(struct pipe_context *pipe,
 
prog->pipe.tokens = tgsi_dup_tokens((const struct tgsi_token *)cso->prog);
 
+   prog->translated = nvc0_program_translate(
+  prog, nvc0_context(pipe)->screen->base.device->chipset,
+  _context(pipe)->debug);
+
return (void *)prog;
 }
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): i965: Reorder PCI ID list to match release order

2016-10-20 Thread Ben Widawsky
Module: Mesa
Branch: master
Commit: ffd9060b2388dcb4bc4d4e564dab23541f641830
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ffd9060b2388dcb4bc4d4e564dab23541f641830

Author: Ben Widawsky 
Date:   Tue Oct 18 13:50:08 2016 -0700

i965: Reorder PCI ID list to match release order

I have some OCD...

Signed-off-by: Ben Widawsky 
Reviewed-by: Dylan Baker 

---

 include/pci_ids/i965_pci_ids.h | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/pci_ids/i965_pci_ids.h b/include/pci_ids/i965_pci_ids.h
index a93228d..e482007 100644
--- a/include/pci_ids/i965_pci_ids.h
+++ b/include/pci_ids/i965_pci_ids.h
@@ -109,6 +109,10 @@ CHIPSET(0x162A, bdw_gt3, "Intel(R) Iris Pro P6300 
(Broadwell GT3e)")
 CHIPSET(0x162B, bdw_gt3, "Intel(R) Iris 6100 (Broadwell GT3)")
 CHIPSET(0x162D, bdw_gt3, "Intel(R) Broadwell GT3")
 CHIPSET(0x162E, bdw_gt3, "Intel(R) Broadwell GT3")
+CHIPSET(0x22B0, chv, "Intel(R) HD Graphics (Cherrytrail)")
+CHIPSET(0x22B1, chv, "Intel(R) HD Graphics XXX (Braswell)") /* Overridden 
in brw_get_renderer_string */
+CHIPSET(0x22B2, chv, "Intel(R) HD Graphics (Cherryview)")
+CHIPSET(0x22B3, chv, "Intel(R) HD Graphics (Cherryview)")
 CHIPSET(0x1902, skl_gt1, "Intel(R) HD Graphics 510 (Skylake GT1)")
 CHIPSET(0x1906, skl_gt1, "Intel(R) HD Graphics 510 (Skylake GT1)")
 CHIPSET(0x190A, skl_gt1, "Intel(R) Skylake GT1")
@@ -134,6 +138,11 @@ CHIPSET(0x1932, skl_gt4, "Intel(R) Iris Pro Graphics 580 
(Skylake GT4e)")
 CHIPSET(0x193A, skl_gt4, "Intel(R) Iris Pro Graphics P580 (Skylake GT4e)")
 CHIPSET(0x193B, skl_gt4, "Intel(R) Iris Pro Graphics 580 (Skylake GT4e)")
 CHIPSET(0x193D, skl_gt4, "Intel(R) Iris Pro Graphics P580 (Skylake GT4e)")
+CHIPSET(0x0A84, bxt, "Intel(R) HD Graphics (Broxton)")
+CHIPSET(0x1A84, bxt, "Intel(R) HD Graphics (Broxton)")
+CHIPSET(0x1A85, bxt_2x6, "Intel(R) HD Graphics (Broxton 2x6)")
+CHIPSET(0x5A84, bxt, "Intel(R) HD Graphics 505 (Broxton)")
+CHIPSET(0x5A85, bxt_2x6, "Intel(R) HD Graphics 500 (Broxton 2x6)")
 CHIPSET(0x5902, kbl_gt1, "Intel(R) Kabylake GT1")
 CHIPSET(0x5906, kbl_gt1, "Intel(R) Kabylake GT1")
 CHIPSET(0x590A, kbl_gt1, "Intel(R) Kabylake GT1")
@@ -154,12 +163,3 @@ CHIPSET(0x5923, kbl_gt3, "Intel(R) Kabylake GT3")
 CHIPSET(0x5926, kbl_gt3, "Intel(R) Kabylake GT3")
 CHIPSET(0x5927, kbl_gt3, "Intel(R) Kabylake GT3")
 CHIPSET(0x593B, kbl_gt4, "Intel(R) Kabylake GT4")
-CHIPSET(0x22B0, chv, "Intel(R) HD Graphics (Cherrytrail)")
-CHIPSET(0x22B1, chv, "Intel(R) HD Graphics XXX (Braswell)") /* Overridden 
in brw_get_renderer_string */
-CHIPSET(0x22B2, chv, "Intel(R) HD Graphics (Cherryview)")
-CHIPSET(0x22B3, chv, "Intel(R) HD Graphics (Cherryview)")
-CHIPSET(0x0A84, bxt, "Intel(R) HD Graphics (Broxton)")
-CHIPSET(0x1A84, bxt, "Intel(R) HD Graphics (Broxton)")
-CHIPSET(0x1A85, bxt_2x6, "Intel(R) HD Graphics (Broxton 2x6)")
-CHIPSET(0x5A84, bxt, "Intel(R) HD Graphics 505 (Broxton)")
-CHIPSET(0x5A85, bxt_2x6, "Intel(R) HD Graphics 500 (Broxton 2x6)")

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): i965: Add some APL and KBL SKU strings

2016-10-20 Thread Ben Widawsky
Module: Mesa
Branch: master
Commit: b8509c8936bdb3deaeac86e2ee9716c06d4e0865
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b8509c8936bdb3deaeac86e2ee9716c06d4e0865

Author: Ben Widawsky 
Date:   Tue Oct 18 13:32:08 2016 -0700

i965: Add some APL and KBL SKU strings

We got a couple for products that exist on ark.intel.com, so let's just
put them in now.

Signed-off-by: Ben Widawsky 

---

 include/pci_ids/i965_pci_ids.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/pci_ids/i965_pci_ids.h b/include/pci_ids/i965_pci_ids.h
index 1566afd..a93228d 100644
--- a/include/pci_ids/i965_pci_ids.h
+++ b/include/pci_ids/i965_pci_ids.h
@@ -144,11 +144,11 @@ CHIPSET(0x5913, kbl_gt1_5, "Intel(R) Kabylake GT1.5")
 CHIPSET(0x5915, kbl_gt1_5, "Intel(R) Kabylake GT1.5")
 CHIPSET(0x5917, kbl_gt1_5, "Intel(R) Kabylake GT1.5")
 CHIPSET(0x5912, kbl_gt2, "Intel(R) Kabylake GT2")
-CHIPSET(0x5916, kbl_gt2, "Intel(R) Kabylake GT2")
+CHIPSET(0x5916, kbl_gt2, "Intel(R) HD Graphics 620 (Intel(R) Kabylake GT2)")
 CHIPSET(0x591A, kbl_gt2, "Intel(R) Kabylake GT2")
 CHIPSET(0x591B, kbl_gt2, "Intel(R) Kabylake GT2")
 CHIPSET(0x591D, kbl_gt2, "Intel(R) Kabylake GT2")
-CHIPSET(0x591E, kbl_gt2, "Intel(R) Kabylake GT2")
+CHIPSET(0x591E, kbl_gt2, "Intel(R) HD Graphics 615 (Kabylake GT2)")
 CHIPSET(0x5921, kbl_gt2, "Intel(R) Kabylake GT2F")
 CHIPSET(0x5923, kbl_gt3, "Intel(R) Kabylake GT3")
 CHIPSET(0x5926, kbl_gt3, "Intel(R) Kabylake GT3")
@@ -161,5 +161,5 @@ CHIPSET(0x22B3, chv, "Intel(R) HD Graphics 
(Cherryview)")
 CHIPSET(0x0A84, bxt, "Intel(R) HD Graphics (Broxton)")
 CHIPSET(0x1A84, bxt, "Intel(R) HD Graphics (Broxton)")
 CHIPSET(0x1A85, bxt_2x6, "Intel(R) HD Graphics (Broxton 2x6)")
-CHIPSET(0x5A84, bxt, "Intel(R) HD Graphics (Broxton)")
-CHIPSET(0x5A85, bxt_2x6, "Intel(R) HD Graphics (Broxton 2x6)")
+CHIPSET(0x5A84, bxt, "Intel(R) HD Graphics 505 (Broxton)")
+CHIPSET(0x5A85, bxt_2x6, "Intel(R) HD Graphics 500 (Broxton 2x6)")

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): vbo: move attribute type assignment

2016-10-20 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 1098e6957c2e740afc2a471223aae2fec46a2582
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1098e6957c2e740afc2a471223aae2fec46a2582

Author: Brian Paul 
Date:   Thu Oct 13 14:43:36 2016 -0600

vbo: move attribute type assignment

If the attribute type is changing, we would have found that earlier in
the ATTR_UNION() macro and would have called vbo_exec_fixup_vertex().
So move the assignment into that function so we don't do it every time.

No Piglit regressions.

Reviewed-by: Charmaine Lee 

---

 src/mesa/vbo/vbo_exec_api.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index c0a5bc0..b191a94 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -423,6 +423,7 @@ vbo_exec_fixup_vertex(struct gl_context *ctx, GLuint attr,
}
 
exec->vtx.active_sz[attr] = newSize;
+   exec->vtx.attrtype[attr] = newType;
 
/* Does setting NeedFlush belong here?  Necessitates resetting
 * vtxfmt on each flush (otherwise flags won't get reset
@@ -479,7 +480,7 @@ do {
\
   if (N>1) dest[1] = V1;   \
   if (N>2) dest[2] = V2;   \
   if (N>3) dest[3] = V3;   \
-  exec->vtx.attrtype[A] = T;   \
+  assert(exec->vtx.attrtype[A] == T);   \
}   \
\
if ((A) == 0) { \

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): vbo: clean up with 'indent', whitespace fixes, etc in vbo_exec_array.c

2016-10-20 Thread Brian Paul
Module: Mesa
Branch: master
Commit: bd60fb49ba0761d4094c08777f7a46c42b2d73d8
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=bd60fb49ba0761d4094c08777f7a46c42b2d73d8

Author: Brian Paul 
Date:   Fri Oct 14 09:35:43 2016 -0600

vbo: clean up with 'indent', whitespace fixes, etc in vbo_exec_array.c

Reviewed-by: Charmaine Lee 

---

 src/mesa/vbo/vbo_exec_array.c | 528 ++
 1 file changed, 276 insertions(+), 252 deletions(-)

Diff:   
http://cgit.freedesktop.org/mesa/mesa/diff/?id=bd60fb49ba0761d4094c08777f7a46c42b2d73d8
___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): vbo: make vbo_reset_attr() static

2016-10-20 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 7693bcde2802f2b7772eaf35506cabaae62cbe45
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7693bcde2802f2b7772eaf35506cabaae62cbe45

Author: Brian Paul 
Date:   Thu Oct 13 14:20:25 2016 -0600

vbo: make vbo_reset_attr() static

Not called from any other file.

Reviewed-by: Charmaine Lee 

---

 src/mesa/vbo/vbo_exec.h | 2 --
 src/mesa/vbo/vbo_exec_api.c | 6 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/mesa/vbo/vbo_exec.h b/src/mesa/vbo/vbo_exec.h
index 4f11f17..b150883 100644
--- a/src/mesa/vbo/vbo_exec.h
+++ b/src/mesa/vbo/vbo_exec.h
@@ -152,8 +152,6 @@ void vbo_exec_invalidate_state( struct gl_context *ctx, 
GLbitfield new_state );
 
 /* Internal functions:
  */
-void vbo_reset_attr(struct vbo_exec_context *exec, GLuint attr);
-
 void vbo_exec_vtx_init( struct vbo_exec_context *exec );
 void vbo_exec_vtx_destroy( struct vbo_exec_context *exec );
 
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 4c8b927..6df8d88 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -1275,7 +1275,11 @@ void vbo_exec_FlushVertices( struct gl_context *ctx, 
GLuint flags )
 #endif
 }
 
-void vbo_reset_attr(struct vbo_exec_context *exec, GLuint attr)
+/**
+ * Reset the vertex attribute by setting its size to zero.
+ */
+static void
+vbo_reset_attr(struct vbo_exec_context *exec, GLuint attr)
 {
exec->vtx.attrsz[attr] = 0;
exec->vtx.attrtype[attr] = GL_FLOAT;

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): vbo: rename reset_attrfv() to vbo_reset_all_attr()

2016-10-20 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 4c3c9f1441a3034a4f9eb7d85ee25b4199e49146
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4c3c9f1441a3034a4f9eb7d85ee25b4199e49146

Author: Brian Paul 
Date:   Thu Oct 13 14:21:46 2016 -0600

vbo: rename reset_attrfv() to vbo_reset_all_attr()

Use a better name.

Reviewed-by: Charmaine Lee 

---

 src/mesa/vbo/vbo_exec_api.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 6df8d88..c0a5bc0 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -57,7 +57,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define IMM_BUFFER_NAME 0xaabbccdd
 
 
-static void reset_attrfv( struct vbo_exec_context *exec );
+static void
+vbo_reset_all_attr(struct vbo_exec_context *exec);
 
 
 /**
@@ -304,7 +305,7 @@ vbo_exec_wrap_upgrade_vertex(struct vbo_exec_context *exec,
if (!_mesa_inside_begin_end(ctx) &&
!oldSize && lastcount > 8 && exec->vtx.vertex_size) {
   vbo_exec_copy_to_current( exec );
-  reset_attrfv( exec );
+  vbo_reset_all_attr(exec);
}
 
/* Fix up sizes:
@@ -630,7 +631,7 @@ vbo_exec_FlushVertices_internal(struct vbo_exec_context 
*exec, GLboolean unmap)
 
if (exec->vtx.vertex_size) {
   vbo_exec_copy_to_current( exec );
-  reset_attrfv( exec );
+  vbo_reset_all_attr(exec);
}
 }
 
@@ -1286,7 +1287,8 @@ vbo_reset_attr(struct vbo_exec_context *exec, GLuint attr)
exec->vtx.active_sz[attr] = 0;
 }
 
-static void reset_attrfv( struct vbo_exec_context *exec )
+static void
+vbo_reset_all_attr(struct vbo_exec_context *exec)
 {
while (exec->vtx.enabled) {
   const int i = u_bit_scan64(>vtx.enabled);

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): vbo: whitespace fixes and reformatting in vbo_exec_api.c

2016-10-20 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 8b9965442a9ed026349576423b1169eb1d770faf
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8b9965442a9ed026349576423b1169eb1d770faf

Author: Brian Paul 
Date:   Fri Oct 14 09:23:37 2016 -0600

vbo: whitespace fixes and reformatting in vbo_exec_api.c

Reviewed-by: Charmaine Lee 

---

 src/mesa/vbo/vbo_exec_api.c | 106 ++--
 1 file changed, 64 insertions(+), 42 deletions(-)

diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 895f197..cbf78b4 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -61,7 +61,8 @@ vbo_reset_all_attr(struct vbo_exec_context *exec);
  * primitive.  This is called when we fill a vertex buffer before
  * hitting glEnd.
  */
-static void vbo_exec_wrap_buffers( struct vbo_exec_context *exec )
+static void
+vbo_exec_wrap_buffers(struct vbo_exec_context *exec)
 {
if (exec->vtx.prim_count == 0) {
   exec->vtx.copied.nr = 0;
@@ -115,7 +116,7 @@ static void vbo_exec_wrap_buffers( struct vbo_exec_context 
*exec )
 exec->vtx.prim[0].start = 0;
 exec->vtx.prim[0].count = 0;
 exec->vtx.prim_count++;
-  
+
 if (exec->vtx.copied.nr == last_count)
exec->vtx.prim[0].begin = last_begin;
   }
@@ -136,13 +137,13 @@ vbo_exec_vtx_wrap(struct vbo_exec_context *exec)
 * to exec->vtx.copied.
 */
vbo_exec_wrap_buffers( exec );
-   
+
if (!exec->vtx.buffer_ptr) {
   /* probably ran out of memory earlier when allocating the VBO */
   return;
}
 
-   /* Copy stored stored vertices to start of new list. 
+   /* Copy stored stored vertices to start of new list.
 */
assert(exec->vtx.max_vert - exec->vtx.vert_count > exec->vtx.copied.nr);
 
@@ -160,7 +161,8 @@ vbo_exec_vtx_wrap(struct vbo_exec_context *exec)
 /**
  * Copy the active vertex's values to the ctx->Current fields.
  */
-static void vbo_exec_copy_to_current( struct vbo_exec_context *exec )
+static void
+vbo_exec_copy_to_current(struct vbo_exec_context *exec)
 {
struct gl_context *ctx = exec->ctx;
struct vbo_context *vbo = vbo_context(ctx);
@@ -191,7 +193,7 @@ static void vbo_exec_copy_to_current( struct 
vbo_exec_context *exec )
   if (exec->vtx.attrtype[i] != vbo->currval[i].Type ||
   memcmp(current, tmp, 4 * sizeof(GLfloat) * dmul) != 0) {
  memcpy(current, tmp, 4 * sizeof(GLfloat) * dmul);
-
+
  /* Given that we explicitly state size here, there is no need
   * for the COPY_CLEAN above, could just copy 16 bytes and be
   * done.  The only problem is when Mesa accesses ctx->Current
@@ -199,7 +201,8 @@ static void vbo_exec_copy_to_current( struct 
vbo_exec_context *exec )
   */
  /* Size here is in components - not bytes */
  vbo->currval[i].Size = exec->vtx.attrsz[i] / dmul;
- vbo->currval[i]._ElementSize = vbo->currval[i].Size * sizeof(GLfloat) 
* dmul;
+ vbo->currval[i]._ElementSize =
+vbo->currval[i].Size * sizeof(GLfloat) * dmul;
  vbo->currval[i].Type = exec->vtx.attrtype[i];
  vbo->currval[i].Integer =
 vbo_attrtype_to_integer_flag(exec->vtx.attrtype[i]);
@@ -221,7 +224,7 @@ static void vbo_exec_copy_to_current( struct 
vbo_exec_context *exec )
 */
if (ctx->Light.ColorMaterialEnabled &&
exec->vtx.attrsz[VBO_ATTRIB_COLOR0]) {
-  _mesa_update_color_material(ctx, 
+  _mesa_update_color_material(ctx,
  ctx->Current.Attrib[VBO_ATTRIB_COLOR0]);
}
 }
@@ -239,7 +242,8 @@ vbo_exec_copy_from_current(struct vbo_exec_context *exec)
 
for (i = VBO_ATTRIB_POS + 1; i < VBO_ATTRIB_MAX; i++) {
   if (exec->vtx.attrtype[i] == GL_DOUBLE) {
- memcpy(exec->vtx.attrptr[i], vbo->currval[i].Ptr, exec->vtx.attrsz[i] 
* sizeof(GLfloat));
+ memcpy(exec->vtx.attrptr[i], vbo->currval[i].Ptr,
+exec->vtx.attrsz[i] * sizeof(GLfloat));
   } else {
  const fi_type *current = (fi_type *) vbo->currval[i].Ptr;
  switch (exec->vtx.attrsz[i]) {
@@ -260,7 +264,7 @@ vbo_exec_copy_from_current(struct vbo_exec_context *exec)
  * to a larger one.  Ex: glTexCoord2f -> glTexCoord4f.
  * We need to go back over the previous 2-component texcoords and insert
  * zero and one values.
- */ 
+ */
 static void
 vbo_exec_wrap_upgrade_vertex(struct vbo_exec_context *exec,
  GLuint attr, GLuint newSize )
@@ -424,7 +428,7 @@ vbo_exec_fixup_vertex(struct gl_context *ctx, GLuint attr,
 * vtxfmt on each flush (otherwise flags won't get reset
 * afterwards).
 */
-   if (attr == 0) 
+   if (attr == 0)
   ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES;
 }
 
@@ -634,25 +638,26 @@ vbo_exec_FlushVertices_internal(struct vbo_exec_context 
*exec, GLboolean unmap)
 }
 
 
-static void GLAPIENTRY vbo_exec_EvalCoord1f( GLfloat u )
+static void 

Mesa (master): vbo: minor clean-up in vbo_exec_api.c

2016-10-20 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 8320bf1a7e6b41550a8f5160d9d74f628aa9d82f
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8320bf1a7e6b41550a8f5160d9d74f628aa9d82f

Author: Brian Paul 
Date:   Fri Oct 14 09:18:18 2016 -0600

vbo: minor clean-up in vbo_exec_api.c

Reviewed-by: Charmaine Lee 

---

 src/mesa/vbo/vbo_exec_api.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index b191a94..895f197 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -48,11 +48,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "vbo_noop.h"
 
 
-#ifdef ERROR
-#undef ERROR
-#endif
-
-
 /** ID/name for immediate-mode VBO */
 #define IMM_BUFFER_NAME 0xaabbccdd
 
@@ -514,6 +509,8 @@ do {
\
}\
 } while (0)
 
+
+#undef ERROR
 #define ERROR(err) _mesa_error( ctx, err, __func__ )
 #define TAG(x) vbo_##x
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): vbo: trivial indentation fix in vbo_exec_api.c

2016-10-20 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 9d6d9b28f74780ee181cf434bd914aba8dd8d908
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9d6d9b28f74780ee181cf434bd914aba8dd8d908

Author: Brian Paul 
Date:   Thu Oct 13 14:11:06 2016 -0600

vbo: trivial indentation fix in vbo_exec_api.c

---

 src/mesa/vbo/vbo_exec_api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 32f15db..4c8b927 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -418,7 +418,7 @@ vbo_exec_fixup_vertex(struct gl_context *ctx, GLuint attr,
* zeros.  Don't need to flush or wrap.
*/
   for (i = newSize; i <= exec->vtx.attrsz[attr]; i++)
-exec->vtx.attrptr[attr][i-1] = id[i-1];
+ exec->vtx.attrptr[attr][i-1] = id[i-1];
}
 
exec->vtx.active_sz[attr] = newSize;

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallivm: try to fix build with LLVM <= 3.4 due to missing CallSite.h

2016-10-20 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: c2a602d21a4dd7da9d3226a70cb83ab85ceb446a
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c2a602d21a4dd7da9d3226a70cb83ab85ceb446a

Author: Marek Olšák 
Date:   Thu Oct 20 11:21:26 2016 +0200

gallivm: try to fix build with LLVM <= 3.4 due to missing CallSite.h

Reviewed-by: Brian Paul 
Tested-by: Brian Paul 

---

 src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp 
b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index f4045ad..bd4d4d3 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -77,7 +77,9 @@
 
 #include 
 
+#if HAVE_LLVM >= 0x0305
 #include 
+#endif
 #include 
 #include 
 #include 
@@ -715,8 +717,10 @@ lp_get_called_value(LLVMValueRef call)
 {
 #if HAVE_LLVM >= 0x0309
return LLVMGetCalledValue(call);
-#else
+#elif HAVE_LLVM >= 0x0305
return 
llvm::wrap(llvm::CallSite(llvm::unwrap(call)).getCalledValue());
+#else
+   return NULL; /* radeonsi doesn't support so old LLVM. */
 #endif
 }
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): radeonsi: fix build of si_eliminate_const_vs_outputs on LLVM <= 3.8

2016-10-20 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: f19f71830bb342ff10019fca30dc5f1fd5755202
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f19f71830bb342ff10019fca30dc5f1fd5755202

Author: Marek Olšák 
Date:   Thu Oct 20 00:11:48 2016 +0200

radeonsi: fix build of si_eliminate_const_vs_outputs on LLVM <= 3.8

Reviewed-by: Nicolai Hähnle 

---

 src/gallium/drivers/radeonsi/si_shader.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader.c 
b/src/gallium/drivers/radeonsi/si_shader.c
index 3a84253..25449ec 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -6609,10 +6609,9 @@ static void si_eliminate_const_vs_outputs(struct 
si_shader_context *ctx)
if (LLVMGetInstructionOpcode(cur) != LLVMCall)
continue;
 
-   LLVMValueRef callee = LLVMGetCalledValue(cur);
-   LLVMValueKind kind = LLVMGetValueKind(callee);
+   LLVMValueRef callee = lp_get_called_value(cur);
 
-   if (kind != LLVMFunctionValueKind)
+   if (!lp_is_function(callee))
continue;
 
const char *name = LLVMGetValueName(callee);

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallivm: add wrappers for missing functions in LLVM <= 3.8

2016-10-20 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: 2db56434d4a275b5b24445dcaeaa024eca6fa7f9
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2db56434d4a275b5b24445dcaeaa024eca6fa7f9

Author: Marek Olšák 
Date:   Thu Oct 20 00:09:44 2016 +0200

gallivm: add wrappers for missing functions in LLVM <= 3.8

radeonsi needs these.

Reviewed-by: Nicolai Hähnle 

---

 src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 21 +
 src/gallium/auxiliary/gallivm/lp_bld_misc.h   |  6 ++
 2 files changed, 27 insertions(+)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp 
b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index 791a470..f4045ad 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -77,6 +77,7 @@
 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -708,3 +709,23 @@ lp_add_attr_dereferenceable(LLVMValueRef val, uint64_t 
bytes)
A->addAttr(llvm::AttributeSet::get(A->getContext(), A->getArgNo() + 1,  B));
 #endif
 }
+
+extern "C" LLVMValueRef
+lp_get_called_value(LLVMValueRef call)
+{
+#if HAVE_LLVM >= 0x0309
+   return LLVMGetCalledValue(call);
+#else
+   return 
llvm::wrap(llvm::CallSite(llvm::unwrap(call)).getCalledValue());
+#endif
+}
+
+extern "C" bool
+lp_is_function(LLVMValueRef v)
+{
+#if HAVE_LLVM >= 0x0309
+   return LLVMGetValueKind(v) == LLVMFunctionValueKind;
+#else
+   return llvm::isa(llvm::unwrap(v));
+#endif
+}
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.h 
b/src/gallium/auxiliary/gallivm/lp_bld_misc.h
index c127c48..a55c6bd 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.h
@@ -76,6 +76,12 @@ lp_free_memory_manager(LLVMMCJITMemoryManagerRef memorymgr);
 extern void
 lp_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes);
 
+extern LLVMValueRef
+lp_get_called_value(LLVMValueRef call);
+
+extern bool
+lp_is_function(LLVMValueRef v);
+
 #ifdef __cplusplus
 }
 #endif

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): st/glsl_to_tgsi: fix block copies of arrays of structs

2016-10-20 Thread Nicolai Hähnle
Module: Mesa
Branch: master
Commit: a1895685f8f341e7facf3c5705bdee99860e3082
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a1895685f8f341e7facf3c5705bdee99860e3082

Author: Nicolai Hähnle 
Date:   Sun Oct 16 17:34:33 2016 +0200

st/glsl_to_tgsi: fix block copies of arrays of structs

Use a full writemask in this case. This is relevant e.g. when a function
has an inout argument which is an array of structs.

v2: use C-style comment (Timothy Arceri)

Reviewed-by: Marek Olšák  (v1)
Cc: 13.0 

---

 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 562587e..854decc 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -2941,10 +2941,12 @@ glsl_to_tgsi_visitor::visit(ir_assignment *ir)
   } else if (ir->write_mask == 0) {
  assert(!ir->lhs->type->is_scalar() && !ir->lhs->type->is_vector());
 
- if (ir->lhs->type->is_array() || ir->lhs->type->is_matrix()) {
-unsigned num_elements = 
ir->lhs->type->without_array()->vector_elements;
+ unsigned num_elements = 
ir->lhs->type->without_array()->vector_elements;
+
+ if (num_elements) {
 l.writemask = u_bit_consecutive(0, num_elements);
  } else {
+/* The type is a struct or an array of (array of) structs. */
 l.writemask = WRITEMASK_XYZW;
  }
   } else {

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): st/glsl_to_tgsi: fix block copies of arrays of doubles

2016-10-20 Thread Nicolai Hähnle
Module: Mesa
Branch: master
Commit: ca592af880b71feb8ebbf79f704380d0deb47b33
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ca592af880b71feb8ebbf79f704380d0deb47b33

Author: Nicolai Hähnle 
Date:   Sun Oct 16 17:33:51 2016 +0200

st/glsl_to_tgsi: fix block copies of arrays of doubles

Set the type of the left-hand side to the same as the right-hand side,
so that when the base type is double, the writemask of the MOV instruction
is properly fixed up.

Reviewed-by: Marek Olšák 
Cc: 13.0 

---

 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 98ebe54..562587e 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -2880,6 +2880,7 @@ glsl_to_tgsi_visitor::emit_block_mov(ir_assignment *ir, 
const struct glsl_type *
 
assert(type->is_scalar() || type->is_vector());
 
+   l->type = type->base_type;
r->type = type->base_type;
if (cond) {
   st_src_reg l_src = st_src_reg(*l);

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): st/glsl_to_tgsi: sort input and output decls by TGSI index

2016-10-20 Thread Nicolai Hähnle
Module: Mesa
Branch: master
Commit: 3d9b57e49304f9690c4a2b50afb8cdd4d253a1df
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3d9b57e49304f9690c4a2b50afb8cdd4d253a1df

Author: Nicolai Hähnle 
Date:   Tue Oct 18 17:35:45 2016 +0200

st/glsl_to_tgsi: sort input and output decls by TGSI index

Fixes a regression introduced by commit 777dcf81b.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98307
Reviewed-by: Marek Olšák 
Cc: 13.0 

---

 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 28 
 1 file changed, 28 insertions(+)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 854decc..f376462 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -55,6 +55,7 @@
 #include "st_glsl_types.h"
 #include "st_nir.h"
 
+#include 
 
 #define PROGRAM_ANY_CONST ((1 << PROGRAM_STATE_VAR) |\
(1 << PROGRAM_CONSTANT) | \
@@ -5873,6 +5874,29 @@ emit_compute_block_size(const struct gl_program *program,
cp->LocalSize[2]);
 }
 
+struct sort_inout_decls {
+   bool operator()(const struct inout_decl , const struct inout_decl ) 
const {
+  return mapping[a.mesa_index] < mapping[b.mesa_index];
+   }
+
+   const GLuint *mapping;
+};
+
+/* Sort the given array of decls by the corresponding slot (TGSI file index).
+ *
+ * This is for the benefit of older drivers which are broken when the
+ * declarations aren't sorted in this way.
+ */
+static void
+sort_inout_decls_by_slot(struct inout_decl *decls,
+ unsigned count,
+ const GLuint mapping[])
+{
+   sort_inout_decls sorter;
+   sorter.mapping = mapping;
+   std::sort(decls, decls + count, sorter);
+}
+
 /**
  * Translate intermediate IR (glsl_to_tgsi_instruction) to TGSI format.
  * \param program  the program to translate
@@ -5945,6 +5969,8 @@ st_translate_program(
case PIPE_SHADER_GEOMETRY:
case PIPE_SHADER_TESS_EVAL:
case PIPE_SHADER_TESS_CTRL:
+  sort_inout_decls_by_slot(program->inputs, program->num_inputs, 
inputMapping);
+
   for (i = 0; i < program->num_inputs; ++i) {
  struct inout_decl *decl = >inputs[i];
  unsigned slot = inputMapping[decl->mesa_index];
@@ -5997,6 +6023,8 @@ st_translate_program(
case PIPE_SHADER_TESS_EVAL:
case PIPE_SHADER_TESS_CTRL:
case PIPE_SHADER_VERTEX:
+  sort_inout_decls_by_slot(program->outputs, program->num_outputs, 
outputMapping);
+
   for (i = 0; i < program->num_outputs; ++i) {
  struct inout_decl *decl = >outputs[i];
  unsigned slot = outputMapping[decl->mesa_index];

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): radeonsi: fix 64-bit loads from LDS

2016-10-20 Thread Nicolai Hähnle
Module: Mesa
Branch: master
Commit: 4a2dbfff05f7be271c2aa72e783e24b31906db51
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4a2dbfff05f7be271c2aa72e783e24b31906db51

Author: Nicolai Hähnle 
Date:   Tue Oct 18 18:40:38 2016 +0200

radeonsi: fix 64-bit loads from LDS

Fixes spec/arb_tessellation_shader/execution/dvec[23]-vs-tcs-tes, among
others.

Cc: "12.0 13.0" 
Reviewed-by: Bas Nieuwenhuizen 
Reviewed-by: Marek Olšák 

---

 src/gallium/drivers/radeonsi/si_shader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader.c 
b/src/gallium/drivers/radeonsi/si_shader.c
index a810d9a..3a84253 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -911,7 +911,7 @@ static LLVMValueRef lds_load(struct lp_build_tgsi_context 
*bld_base,
if (tgsi_type_is_64bit(type)) {
LLVMValueRef value2;
dw_addr = lp_build_add(_base->uint_bld, dw_addr,
-  lp_build_const_int32(gallivm, swizzle + 
1));
+  lp_build_const_int32(gallivm, 1));
value2 = build_indexed_load(ctx, ctx->lds, dw_addr, false);
return si_llvm_emit_fetch_64bit(bld_base, type, value, value2);
}

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): st/mesa: only set primitive_restart when the restart index is in range

2016-10-20 Thread Nicolai Hähnle
Module: Mesa
Branch: master
Commit: bfa50f88cea2ba9f4dc4b825828d2c8f02866fc3
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=bfa50f88cea2ba9f4dc4b825828d2c8f02866fc3

Author: Nicolai Hähnle 
Date:   Wed Oct 19 18:14:48 2016 +0200

st/mesa: only set primitive_restart when the restart index is in range

Even when enabled, primitive restart has no effect when the restart index
is larger than the representable values in the index buffer.

Fixes GL45-CTS.gtf31.GL3Tests.primitive_restart.primitive_restart_upconvert
for radeonsi VI.

v2: add an explanatory comment

Cc: "12.0 13.0" 
Reviewed-by: Marek Olšák  (v1)

---

 src/mesa/state_tracker/st_draw.c | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index f4af23d..5dcaff0 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -205,8 +205,19 @@ st_draw_vbo(struct gl_context *ctx,
   /* The VBO module handles restart for the non-indexed GLDrawArrays
* so we only set these fields for indexed drawing:
*/
-  info.primitive_restart = ctx->Array._PrimitiveRestart;
-  info.restart_index = _mesa_primitive_restart_index(ctx, ib->type);
+  if (ctx->Array._PrimitiveRestart) {
+ info.restart_index = _mesa_primitive_restart_index(ctx, ib->type);
+
+ /* Enable primitive restart only when the restart index can have an
+  * effect. This is required for correctness in radeonsi VI support,
+  * though other hardware may also benefit from taking a faster,
+  * non-restart path when possible.
+  */
+ if ((ibuffer.index_size >= 4) ||
+ (ibuffer.index_size >= 2 && info.restart_index <= 0x) ||
+ (info.restart_index <= 0xff))
+info.primitive_restart = true;
+  }
}
else {
   /* Transform feedback drawing is always non-indexed. */

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): glsl: Indirect array indexing on non-last SSBO member must fail compilation

2016-10-20 Thread Iago Toral Quiroga
Module: Mesa
Branch: master
Commit: 3da08e166415a745139c1127040a24e8a45dc553
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3da08e166415a745139c1127040a24e8a45dc553

Author: Iago Toral Quiroga 
Date:   Tue Oct 18 14:15:36 2016 +0200

glsl: Indirect array indexing on non-last SSBO member must fail compilation

After the changes in comit 5b2675093e863a52, we moved this check to the
linker, but the spec expects this to be checked at compile-time. There are
dEQP tests that expect an error at compile time and the spec seems to confirm
that expectation:

"Except for the last declared member of a shader storage block (section 4.3.9
 “Interface Blocks”), the size of an array must be declared (explicitly sized)
 before it is indexed with anything other than an integral constant expression.
 The size of any array must be declared before passing it as an argument to a
 function. Violation of any of these rules result in compile-time errors. It
 is legal to declare an array without a size (unsized) and then later
 redeclare the same name as an array of the same type and specify a size, or
 index it only with integral constant expressions (implicitly sized)."

Commit 5b2675093e863a52 tries to take care of the case where we have implicitly
sized arrays in SSBOs and it does so by checking the max_array_access field
in ir_variable during linking. In this patch we change the approach: we look
for indirect access on SSBO arrays, and when we find one, we emit a
compile-time error if the accessed member is not the last in the SSBO
definition.

There is a corner case that the specs do not address directly though and that
dEQP checks for: the case of an unsized array in an SSBO definition that is
not defined last but is never used in the shader code either. The following
dEQP tests expect a compile-time error in this scenario:

dEQP-GLES31.functional.debug.negative_coverage.callbacks.shader.compile_compute_shader
dEQP-GLES31.functional.debug.negative_coverage.get_error.shader.compile_compute_shader
dEQP-GLES31.functional.debug.negative_coverage.log.shader.compile_compute_shader

However, since the unsized array is never used it is never indexed with a
non-constant expression, so by the spec quotation above, it should be valid and
the tests are probably incorrect.

Reviewed-by: Nicolai Hähnle 

---

 src/compiler/glsl/ast_array_index.cpp | 14 ++
 src/compiler/glsl/link_uniform_blocks.cpp |  8 +---
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/src/compiler/glsl/ast_array_index.cpp 
b/src/compiler/glsl/ast_array_index.cpp
index e29dafb..dfa44b7 100644
--- a/src/compiler/glsl/ast_array_index.cpp
+++ b/src/compiler/glsl/ast_array_index.cpp
@@ -233,6 +233,20 @@ _mesa_ast_array_index_to_hir(void *mem_ctx,
  else if (array->variable_referenced()->data.mode !=
   ir_var_shader_storage) {
 _mesa_glsl_error(, state, "unsized array index must be 
constant");
+ } else {
+/* Unsized array non-constant indexing on SSBO is allowed only for
+ * the last member of the SSBO definition.
+ */
+ir_variable *var = array->variable_referenced();
+const glsl_type *iface_type = var->get_interface_type();
+int field_index = iface_type->field_index(var->name);
+/* Field index can be < 0 for instance arrays */
+if (field_index >= 0 &&
+field_index != (int) iface_type->length - 1) {
+   _mesa_glsl_error(, state, "Indirect access on unsized "
+"array is limited to the last member of "
+"SSBO.");
+}
  }
   } else if (array->type->without_array()->is_interface()
  && ((array->variable_referenced()->data.mode == ir_var_uniform
diff --git a/src/compiler/glsl/link_uniform_blocks.cpp 
b/src/compiler/glsl/link_uniform_blocks.cpp
index 5b0dff6..bb423c5 100644
--- a/src/compiler/glsl/link_uniform_blocks.cpp
+++ b/src/compiler/glsl/link_uniform_blocks.cpp
@@ -150,13 +150,7 @@ private:
*/
   const glsl_type *type_for_size = type;
   if (type->is_unsized_array()) {
- if (!last_field) {
-linker_error(prog, "unsized array `%s' definition: "
- "only last member of a shader storage block "
- "can be defined as unsized array",
- name);
- }
-
+ assert(last_field);
  type_for_size = type->without_array();
   }
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit