Mesa (master): tgsi: add simple tgsi_is_msaa_target() helper

2016-04-02 Thread Brian Paul
Module: Mesa
Branch: master
Commit: ef10b5427a1ac6e9899116d0e9f0eaa2d87e7957
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ef10b5427a1ac6e9899116d0e9f0eaa2d87e7957

Author: Brian Paul 
Date:   Thu Mar 31 14:17:26 2016 -0600

tgsi: add simple tgsi_is_msaa_target() helper

Reviewed-by: Jose Fonseca 

---

 src/gallium/auxiliary/tgsi/tgsi_util.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_util.h 
b/src/gallium/auxiliary/tgsi/tgsi_util.h
index 3a049ee..ca07bfd 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_util.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_util.h
@@ -88,6 +88,14 @@ tgsi_util_get_shadow_ref_src_index(unsigned tgsi_tex);
 boolean
 tgsi_is_shadow_target(unsigned target);
 
+
+static inline boolean
+tgsi_is_msaa_target(unsigned target)
+{
+   return (target == TGSI_TEXTURE_2D_MSAA ||
+   target == TGSI_TEXTURE_2D_ARRAY_MSAA);
+}
+
 #if defined __cplusplus
 }
 #endif

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


Mesa (master): svga: check TXF instruction's target to determine MSAA

2016-04-02 Thread Brian Paul
Module: Mesa
Branch: master
Commit: b283c763425983480f85ed5b92ac8a984b6aa942
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b283c763425983480f85ed5b92ac8a984b6aa942

Author: Brian Paul 
Date:   Thu Mar 31 14:19:17 2016 -0600

svga: check TXF instruction's target to determine MSAA

Rather than the currently bound texture.  This goes along with the
earlier patch to get away from examining bound textures and sampler
views during shader translation.

Fixes VMware bug 1632739.

Reviewed-by: Jose Fonseca 

---

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

diff --git a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c 
b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c
index 0d56282..f8f615e 100644
--- a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c
+++ b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c
@@ -5439,7 +5439,7 @@ emit_txf(struct svga_shader_emitter_v10 *emit,
  const struct tgsi_full_instruction *inst)
 {
const uint unit = inst->Src[1].Register.Index;
-   const unsigned msaa = emit->key.tex[unit].texture_msaa;
+   const boolean msaa = tgsi_is_msaa_target(inst->Texture.Texture);
int offsets[3];
struct tex_swizzle_info swz_info;
 

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


Mesa (master): svga: remove unused svga_compile_key::texture_msaa field

2016-04-02 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 36d8fed798c9c3f008e7bbd5b98d3ad37d47b0bd
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=36d8fed798c9c3f008e7bbd5b98d3ad37d47b0bd

Author: Brian Paul 
Date:   Thu Mar 31 14:23:34 2016 -0600

svga: remove unused svga_compile_key::texture_msaa field

Reviewed-by: Jose Fonseca 

---

 src/gallium/drivers/svga/svga_shader.c | 1 -
 src/gallium/drivers/svga/svga_shader.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_shader.c 
b/src/gallium/drivers/svga/svga_shader.c
index 78eb3f6..d56cce4 100644
--- a/src/gallium/drivers/svga/svga_shader.c
+++ b/src/gallium/drivers/svga/svga_shader.c
@@ -195,7 +195,6 @@ svga_init_shader_key_common(const struct svga_context 
*svga, unsigned shader,
 }
  }
 
- key->tex[i].texture_msaa = view->texture->nr_samples > 1;
  if (!svga->curr.sampler[shader][i]->normalized_coords) {
 assert(idx < (1 << 5));  /* width_height_idx:5 bitfield */
 key->tex[i].width_height_idx = idx++;
diff --git a/src/gallium/drivers/svga/svga_shader.h 
b/src/gallium/drivers/svga/svga_shader.h
index 3f91574..b53a4bf 100644
--- a/src/gallium/drivers/svga/svga_shader.h
+++ b/src/gallium/drivers/svga/svga_shader.h
@@ -99,7 +99,6 @@ struct svga_compile_key
   unsigned unnormalized:1;
   unsigned width_height_idx:5; /**< texture unit */
   unsigned is_array:1;
-  unsigned texture_msaa:1;/**< A multisample texture? */
   unsigned sprite_texgen:1;
   unsigned swizzle_r:3;
   unsigned swizzle_g:3;

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


Mesa (master): nv50/ir: fix envyas variants when building the code lib

2016-04-02 Thread Samuel Pitoiset
Module: Mesa
Branch: master
Commit: 0852c5703b57cb277b893e7e9db48c47712a0846
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0852c5703b57cb277b893e7e9db48c47712a0846

Author: Samuel Pitoiset 
Date:   Sat Apr  2 19:55:30 2016 +0200

nv50/ir: fix envyas variants when building the code lib

nvc0 and nve4 have been respectively replaced by gf100 and gk104.

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

---

 src/gallium/drivers/nouveau/codegen/lib/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nouveau/codegen/lib/Makefile 
b/src/gallium/drivers/nouveau/codegen/lib/Makefile
index 06d1979..115f6d0 100644
--- a/src/gallium/drivers/nouveau/codegen/lib/Makefile
+++ b/src/gallium/drivers/nouveau/codegen/lib/Makefile
@@ -3,9 +3,9 @@ ENVYAS ?= envyas
 all: gf100.asm.h gk104.asm.h gk110.asm.h gm107.asm.h
 
 gf100.asm.h: %.asm.h: %.asm
-   $(ENVYAS) -a -W -mnvc0 -Vnvc0 $< -o $@
+   $(ENVYAS) -a -W -mgf100 -Vgf100 $< -o $@
 gk104.asm.h: %.asm.h: %.asm
-   $(ENVYAS) -a -W -mnvc0 -Vnve4 $< -o $@
+   $(ENVYAS) -a -W -mgf100 -Vgk104 $< -o $@
 gk110.asm.h: %.asm.h: %.asm
$(ENVYAS) -a -W -mgk110 $< -o $@
 gm107.asm.h: %.asm.h: %.asm

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


Mesa (master): st/nine: specify WINAPI only for i386 and amd64

2016-04-02 Thread Axel Davy
Module: Mesa
Branch: master
Commit: 2a529a8ac810b3b40e7a9a071d9544b168928b94
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2a529a8ac810b3b40e7a9a071d9544b168928b94

Author: Christian Schmidbauer 
Date:   Sun Mar 13 22:50:31 2016 +0100

st/nine: specify WINAPI only for i386 and amd64

Currently mesa fails building with the x32 abi as ms_abi is not defined
in such a case.

The patch uses ms_abi only for amd64 targets and stdcall only for i386
targets to be sure that those are defined.

This patch additionally checks for __GNUC__ to guarantee that
__attribute__ is available.

CC: "11.1 11.2" 
Signed-off-by: Christian Schmidbauer 
Acked-by: Axel Davy 

---

 include/D3D9/d3d9types.h | 16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/include/D3D9/d3d9types.h b/include/D3D9/d3d9types.h
index d74ce80..e0b8652 100644
--- a/include/D3D9/d3d9types.h
+++ b/include/D3D9/d3d9types.h
@@ -178,11 +178,17 @@ typedef struct _RGNDATA {
 #undef WINAPI
 #endif /* WINAPI*/
 
-#if defined(__x86_64__) || defined(_M_X64)
-#define WINAPI __attribute__((ms_abi))
-#else /* x86_64 */
-#define WINAPI __attribute__((__stdcall__))
-#endif /* x86_64 */
+#ifdef __GNUC__
+  #if (defined(__x86_64__) && !defined(__ILP32__)) || defined(_M_X64)
+#define WINAPI __attribute__((ms_abi))
+  #elif defined(__i386) || defined(_M_IX86)
+#define WINAPI __attribute__((__stdcall__))
+  #else /* neither amd64 nor i386 */
+#define WINAPI
+  #endif
+#else /* __GNUC__ */
+  #define WINAPI
+#endif
 
 /* Implementation caps */
 #define D3DPRESENT_BACK_BUFFERS_MAX3

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


Mesa (master): nv50/ir: we can't load local memory directly into an output

2016-04-02 Thread Ilia Mirkin
Module: Mesa
Branch: master
Commit: 3610b1466d573983d80e3019e8e01ebb97d67d9c
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3610b1466d573983d80e3019e8e01ebb97d67d9c

Author: Ilia Mirkin 
Date:   Sat Apr  2 17:46:58 2016 -0400

nv50/ir: we can't load local memory directly into an output

This fixes piglit tests like

tests/spec/glsl-1.10/execution/variable-indexing/vs-output-array-float-index-wr.shader_test

and related ones.

Signed-off-by: Ilia Mirkin 
Cc: "11.1 11.2" 

---

 src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp 
b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp
index 02c4f1a..36ab837 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp
@@ -372,7 +372,8 @@ NV50LegalizeSSA::propagateWriteToOutput(Instruction *st)
   return;
 
for (int s = 0; di->srcExists(s); ++s)
-  if (di->src(s).getFile() == FILE_IMMEDIATE)
+  if (di->src(s).getFile() == FILE_IMMEDIATE ||
+  di->src(s).getFile() == FILE_MEMORY_LOCAL)
  return;
 
if (prog->getType() == Program::TYPE_GEOMETRY) {

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


Mesa (master): gm107/ir: add OP_SELP emission, used in DSQRT lowering

2016-04-02 Thread Ilia Mirkin
Module: Mesa
Branch: master
Commit: d64134ecaec46f95189e355de65f631b1b7f7007
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d64134ecaec46f95189e355de65f631b1b7f7007

Author: Ilia Mirkin 
Date:   Sat Apr  2 19:25:59 2016 -0400

gm107/ir: add OP_SELP emission, used in DSQRT lowering

The current DSQRT lowering code emits an OP_SELP, so we have to handle
its emission. This will eventually go away, but no harm supporting this
op.

Signed-off-by: Ilia Mirkin 

---

 .../drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp 
b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp
index e079a57..31ddb11 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp
@@ -126,6 +126,7 @@ private:
void emitF2I();
void emitI2F();
void emitI2I();
+   void emitSEL();
void emitSHFL();
 
void emitDADD();
@@ -894,6 +895,32 @@ CodeEmitterGM107::emitI2I()
 }
 
 void
+CodeEmitterGM107::emitSEL()
+{
+   switch (insn->src(1).getFile()) {
+   case FILE_GPR:
+  emitInsn(0x5ca0);
+  emitGPR (0x14, insn->src(1));
+  break;
+   case FILE_MEMORY_CONST:
+  emitInsn(0x4ca0);
+  emitCBUF(0x22, -1, 0x14, 16, 2, insn->src(1));
+  break;
+   case FILE_IMMEDIATE:
+  emitInsn(0x38a0);
+  emitIMMD(0x14, 19, insn->src(1));
+  break;
+   default:
+  assert(!"bad src1 file");
+  break;
+   }
+
+   emitPRED(0x27, insn->src(2));
+   emitGPR (0x08, insn->src(0));
+   emitGPR (0x00, insn->def(0));
+}
+
+void
 CodeEmitterGM107::emitSHFL()
 {
int type = 0;
@@ -2963,6 +2990,9 @@ CodeEmitterGM107::emitInstruction(Instruction *i)
 emitISETP();
   }
   break;
+   case OP_SELP:
+  emitSEL();
+  break;
case OP_PRESIN:
case OP_PREEX2:
   emitRRO();

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


Mesa (master): mesa: remove unrequired else

2016-04-02 Thread Timothy Arceri
Module: Mesa
Branch: master
Commit: 6d54096fa6cde0ebc7da29468071fe2c34aec0cf
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6d54096fa6cde0ebc7da29468071fe2c34aec0cf

Author: Timothy Arceri 
Date:   Sat Apr  2 21:07:50 2016 +1100

mesa: remove unrequired else

The if always returns so no need for an else.

Reviewed-by: Brian Paul 

---

 src/mesa/program/prog_parameter.c | 81 +++
 1 file changed, 39 insertions(+), 42 deletions(-)

diff --git a/src/mesa/program/prog_parameter.c 
b/src/mesa/program/prog_parameter.c
index 02d84f2..c294b00 100644
--- a/src/mesa/program/prog_parameter.c
+++ b/src/mesa/program/prog_parameter.c
@@ -248,54 +248,51 @@ _mesa_add_parameter(struct gl_program_parameter_list 
*paramList,
   paramList->Size = 0;
   return -1;
}
-   else {
-  GLuint i, j;
-
-  paramList->NumParameters = oldNum + sz4;
-
-  memset(¶mList->Parameters[oldNum], 0,
- sz4 * sizeof(struct gl_program_parameter));
-
-  for (i = 0; i < sz4; i++) {
- struct gl_program_parameter *p = paramList->Parameters + oldNum + i;
- p->Name = name ? strdup(name) : NULL;
- p->Type = type;
- p->Size = size;
- p->DataType = datatype;
- if (values) {
-if (size >= 4) {
-   COPY_4V(paramList->ParameterValues[oldNum + i], values);
+
+   GLuint i, j;
+
+   paramList->NumParameters = oldNum + sz4;
+
+   memset(¶mList->Parameters[oldNum], 0,
+  sz4 * sizeof(struct gl_program_parameter));
+
+   for (i = 0; i < sz4; i++) {
+  struct gl_program_parameter *p = paramList->Parameters + oldNum + i;
+  p->Name = name ? strdup(name) : NULL;
+  p->Type = type;
+  p->Size = size;
+  p->DataType = datatype;
+  if (values) {
+ if (size >= 4) {
+COPY_4V(paramList->ParameterValues[oldNum + i], values);
+ } else {
+/* copy 1, 2 or 3 values */
+GLuint remaining = size % 4;
+assert(remaining < 4);
+for (j = 0; j < remaining; j++) {
+   paramList->ParameterValues[oldNum + i][j].f = values[j].f;
 }
-else {
-   /* copy 1, 2 or 3 values */
-   GLuint remaining = size % 4;
-   assert(remaining < 4);
-   for (j = 0; j < remaining; j++) {
-  paramList->ParameterValues[oldNum + i][j].f = values[j].f;
-   }
-   /* fill in remaining positions with zeros */
-   for (; j < 4; j++) {
-  paramList->ParameterValues[oldNum + i][j].f = 0.0f;
-   }
+/* fill in remaining positions with zeros */
+for (; j < 4; j++) {
+   paramList->ParameterValues[oldNum + i][j].f = 0.0f;
 }
-values += 4;
-p->Initialized = GL_TRUE;
  }
- else {
-/* silence valgrind */
-for (j = 0; j < 4; j++)
-   paramList->ParameterValues[oldNum + i][j].f = 0;
- }
- size -= 4;
-  }
-
-  if (state) {
- for (i = 0; i < STATE_LENGTH; i++)
-paramList->Parameters[oldNum].StateIndexes[i] = state[i];
+ values += 4;
+ p->Initialized = GL_TRUE;
+  } else {
+ /* silence valgrind */
+ for (j = 0; j < 4; j++)
+paramList->ParameterValues[oldNum + i][j].f = 0;
   }
+  size -= 4;
+   }
 
-  return (GLint) oldNum;
+   if (state) {
+  for (i = 0; i < STATE_LENGTH; i++)
+ paramList->Parameters[oldNum].StateIndexes[i] = state[i];
}
+
+   return (GLint) oldNum;
 }
 
 

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