[Mesa-dev] [PATCH 02/15] glsl: Add support for new fma built-in in ARB_gpu_shader5.

Matt Turner mattst88 at gmail.com
Fri Aug 23 10:14:19 PDT 2013


On Fri, Aug 23, 2013 at 8:02 AM, Ian Romanick <idr at freedesktop.org> wrote:
> Constant folding support?

Oh, looks like I forgot to rebase in my fixup:

+   case ir_triop_fma:
+      assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
+      assert(op[1]->type->base_type == GLSL_TYPE_FLOAT);
+      assert(op[2]->type->base_type == GLSL_TYPE_FLOAT);
+
+      for (unsigned c = 0; c < components; c++) {
+         data.f[c] = op[0]->value.f[c] * op[1]->value.f[c]
+                                       + op[2]->value.f[c];
+      }
+      break;


More information about the mesa-dev mailing list