2 Replies Latest reply on Apr 13, 2009 5:30 PM by ryta1203

    CAL Kernel Question

    ryta1203

      I have a cstring (ILKernel) I am creating that looks exactly (and I mean EXACTLY) like:

      "il_ps_2_0\n""dcl_input_position_interp(linear_noperspective) v0.x\n""dcl_output_generic o0\n""dcl_resource_id(0)_type(2d,unnorm)_fmtx(float)_fmty(float)_fmtz(float)_fmtw(float)\n""dcl_resource_id(1)_type(2d,unnorm)_fmtx(float)_fmty(float)_fmtz(float)_fmtw(float)\n""dcl_resource_id(2)_type(2d,unnorm)_fmtx(float)_fmty(float)_fmtz(float)_fmtw(float)\n""dcl_resource_id(3)_type(2d,unnorm)_fmtx(float)_fmty(float)_fmtz(float)_fmtw(float)\n""sample_resource(0)_sampler(0) r0, v0.x\n""sample_resource(1)_sampler(1) r1, v0.x\n""sample_resource(2)_sampler(2) r2, v0.x\n""sample_resource(3)_sampler(3) r3, v0.x\n""add r4, r1, r0\n""add r5, r4, r2\n""add r6, r5, r3\n""add r7, r6, r5\n""add r8, r7, r6\n""add r9, r8, r7\n""add r10, r9, r8\n""add r11, r10, r9\n""add r12, r11, r10\n""add r13, r12, r11\n""add r14, r13, r12\n""add r15, r14, r13\n""add r16, r15, r14\n""add r17, r16, r15\n""add r18, r17, r16\n""add r19, r18, r17\n""mov o0, r19\n""ret_dyn\n""end\n";

      Then I call CalclCompile like this:

       

       

       

       

      if

      (calclCompile(&obj, CAL_LANGUAGE_IL, ILKernel.c_str(), info.target) != CAL_RESULT_OK)

      {

      fprintf(stderr,



      "Error compiling, string is %s\n", calclGetErrorString());

      exit(1);

      }

      The OUPUT is:

      Error compiling, string is No Error". The program exits at "exit(1)".

      This may be more of a "cstring" question; HOWEVER, I just want to verify that if the above was a const char[] the kernel would compile fine also.

      The thing here is that I want to change the kernel at runtime.