bubu

Calling a function with pointer param

Discussion created by bubu on May 29, 2010
Latest reply on May 29, 2010 by bubu

Can I do this in OpenCL's shaders?

 

struct MyType

{

    float4 a, b;

};

 

static inline Func1 ( MyType *t )

{

    t->a.x += 1.0f;

    t->b.x += t->a.x;

}

 

__kernel MyKernel ()

{

   MyType t;

   t.a = 10.0f;

   t.b = 20.0f;

   Func1(&t);

}

 

thx

Outcomes