Results 1 to 6 of 6

Thread: finding out what call caused the INVALID_ENUM?

  1. #1

    finding out what call caused the INVALID_ENUM?

    Ive run into this issue + cant use gl.getError(); to narrow down my search of where its occuring, since it doesnt work correctly. hmm perhaps I can use glFinish();
    Are there any debuggers for webGL like there is with opengl?

    Code :
    setup() {
     
      // error is happening here somewhere
     
      gl.getError(); // BUT no error gets reported here
      setInterval(loop, 1000.0/60.0 );
      gl.getError(); // no error
    // no code after this
    }
     
     
    loop() {
     gl.getError(); // error gets reported here
    }

    cheers zed

  2. #2
    Junior Member
    Join Date
    Aug 2010
    Posts
    17

    Re: finding out what call caused the INVALID_ENUM?

    Having getError directly after setInterval makes no sense, because loop() will be called asyncchronously after 1000.0/60.0 miliseconds.
    For debugging javascript - you can use webinspector (for webkit) or firebug (for firefox - but I'm not sure if it's available for ff beta) - you can create breakpoint by writing
    Code :
    debugger;
    in js code

  3. #3

    Re: finding out what call caused the INVALID_ENUM?

    thanks wglb for the reply, though i dont need to debug javascript but the actual gl commands i want to find out which one is causing the error
    Having getError directly after setInterval makes no sense
    yes i realize this, i was trying to make it clearer that the error is happening before this in the code

    perhaps this is more easy to understand
    Code :
    init()
    {
     
    // lotsa stuff
     
    gl.getError(); // no error gets reported here
    loop();
    }
     
    loop() {
    gl.getError(); // error gets reported here
    }
    ive tried inserting a few glfinish() commands but still the same thing.

    ive also tried the standard method of commenting out stuff to narrow down the command but no luck

  4. #4
    Junior Member
    Join Date
    Aug 2010
    Posts
    17

    Re: finding out what call caused the INVALID_ENUM?

    There is also complex debugging tool for webgl, but it doesn't work for me: viewtopic.php?f=43&t=3173

  5. #5

    Re: finding out what call caused the INVALID_ENUM?

    thanks mate, Ill try that out, nice and small piece of code as well

  6. #6

    Re: finding out what call caused the INVALID_ENUM?

    I cant edit my last post?
    anyways, got it working which may help u get it working for you wglb

    Code :
    gl = WebGLDebugUtils.makeDebugContext(canvas.getContext("experimental-webgl"));
     // gl = canvas.getContext("experimental-webgl", { antialias: true });

    stick an error in eg
    gl.frontFace( 33 );

    and in the console window u should see
    WebGL error INVALID_ENUM in frontFace(*UNKNOWN WebGL ENUM (0x21))

    unifortunately it does specify where in the code that call was made, but does narrow down the options lots

Similar Threads

  1. Is this caused by memory contention?
    By tmp in forum OpenCL
    Replies: 3
    Last Post: 03-16-2010, 10:07 AM
  2. Why does EGL call glGetIntegerv when I call wglSwapBuffer?
    By teriba in forum Cross API and window system integration
    Replies: 0
    Last Post: 07-23-2009, 04:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •