Skip to content

Instantly share code, notes, and snippets.

@aras-p
Last active December 22, 2015 10:49
Show Gist options
  • Save aras-p/6461328 to your computer and use it in GitHub Desktop.
Save aras-p/6461328 to your computer and use it in GitHub Desktop.
Cg error reporting, wonderful!

Cg error reporting fun (Cg 3.1.0013). The actual error in both cases is on line 4.

This file:

  float4 vert () : POSITION
  {
    float4 v = 0;
    error_line_4;
    return 0;
  }

produces: (3) : error C1008: undefined variable "error_line_4". Cg thinks error is on line 3.

This file:

  float4 vert () : POSITION
  {
    float4 v;
    error_line_4;
    return 0;
  }

produces: (5) : error C1008: undefined variable "error_line_4". Cg thinks error is on line 5.

THIS IS WHY WE CAN'T HAVE NICE THINGS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment