ntoronto / pict3d

3-dimensional picts
GNU Lesser General Public License v3.0
114 stars 23 forks source link

DrRacket Internal Error #33

Open lehitoskin opened 9 years ago

lehitoskin commented 9 years ago

Running (sphere origin 1) in Racket version 6.1.1 creates the following error:

make-gl-shader: 0(10) : error C1101: ambiguous overloaded function reference "mix(float, float, int)"
    (0) : gp5 float64_t mix(float64_t, float64_t, float64_t)
    (0) : vec4 mix(vec4, vec4, float)
    (0) : vec3 mix(vec3, vec3, float)
    (0) : vec2 mix(vec2, vec2, float)
    (0) : float mix(float, float, float)
0(11) : error C1101: ambiguous overloaded function reference "mix(float, float, int)"
    (0) : gp5 float64_t mix(float64_t, float64_t, float64_t)
    (0) : vec4 mix(vec4, vec4, float)
    (0) : vec3 mix(vec3, vec3, float)
    (0) : vec2 mix(vec2, vec2, float)
    (0) : float mix(float, float, float)
0(12) : error C1101: ambiguous overloaded function reference "mix(float, float, int)"
    (0) : gp5 float64_t mix(float64_t, float64_t, float64_t)
    (0) : vec4 mix(vec4, vec4, float)
    (0) : vec3 mix(vec3, vec3, float)
    (0) : vec2 mix(vec2, vec2, float)
    (0) : float mix(float, float, float)

The box that's supposed to contain the sphere contains what appears to be everything but the sphere: position coordinates and several icons/buttons at the top that I can click.

lduguid commented 9 years ago

Same error, running clean install of DrRacket 6.2.1 - 64 bit

#lang racket
(require pict3d)
(sphere origin 1/2)
jeapostrophe commented 8 years ago

Can you say what graphics card and OpenGL versions you have?

lehitoskin commented 8 years ago

I'm using a gtx 560 ti and glxinfo says this:

OpenGL core profile version string: 4.4.0 NVIDIA 358.09

OpenGL core profile shading language version string: 4.40 NVIDIA via Cg compiler

OpenGL version string: 4.5.0 NVIDIA 358.09
jeapostrophe commented 8 years ago

This is the same error as https://github.com/oflatt/space-orbs/issues/8 and the root cause is that the shader isn't casting a value to a float. Some OpenGL implementations like Intel and AMD's don't seem to enforce this GLSL rule. I will shortly update pict3d and I'll let you know so you can re-test.

lehitoskin commented 8 years ago

Excellent work!

lduguid commented 8 years ago

Nvidia GeForce GTX 650 - latest drivers. (Windows 8.1). Cannot recall any other OpenGL or DirectX applications having issues of this nature. Let me know if you require various subsystem version numbers etc.

OpenGL vendor string: NVIDIA Corporation OpenGL renderer string: GeForce GTX 650/PCIe/SSE2 OpenGL version string: 4.5.0 NVIDIA 358.91

jeapostrophe commented 8 years ago

I believe this is fixed now on https://github.com/jeapostrophe/pict3d (you should be able to raco pkg update pict3d and get the new version)

If it is not working for you, can you send me the output of racket -l pict3d/tests/shaders please

lehitoskin commented 8 years ago

Running the same command as before (this time with Racket 6.3) makes DrRacket freeze.

racket -l pict3d/tests/shaders opens up a window that promptly closes with this terminal output:

XSetErrorHandler: given value does not fit primitive C type
  C type: _fpointer
  given value: #<procedure:flag-x-error-handler>
  context...:
   /usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt:292:5
   /usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt:276:0: glx-create-context-attribs
   /usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt:319:4: for-loop
   /usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt:318:2
   /usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt:344:0: make-gtk-drawable-gl-context
   /usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt:469:0: create-widget-gl-context
   /usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/dc.rkt:189:4: get-gl-context method in dc%
   /home/lehi/.racket/6.3/pkgs/pict3d/pict3d/tests/shaders.rkt:24:6
XSetErrorHandler: given value does not fit primitive C type
  C type: _fpointer
  given value: #<procedure:flag-x-error-handler>
  context...:
   /usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt:292:5
   /usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt:276:0: glx-create-context-attribs
   /usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt:319:4: for-loop
   /usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt:318:2
   /usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt:344:0: make-gtk-drawable-gl-context
   /usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt:469:0: create-widget-gl-context
   /usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/dc.rkt:189:4: get-gl-context method in dc%
   /home/lehi/.racket/6.3/pkgs/pict3d/pict3d/tests/shaders.rkt:24:6
   /usr/share/racket/collects/racket/private/more-scheme.rkt:148:2: call-with-break-parameterization
   /usr/share/racket/collects/racket/private/more-scheme.rkt:265:2: call-with-exception-handler
XSetErrorHandler: given value does not fit primitive C type
  C type: _fpointer
  given value: #<procedure:flag-x-error-handler>
  context...:
   /usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt:292:5
   /usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt:276:0: glx-create-context-attribs
   /usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt:319:4: for-loop
   /usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt:318:2
   /usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt:344:0: make-gtk-drawable-gl-context
   /usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt:469:0: create-widget-gl-context
   /usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/dc.rkt:189:4: get-gl-context method in dc%
   /home/lehi/.racket/6.3/pkgs/pict3d/pict3d/tests/shaders.rkt:24:6
   /usr/share/racket/collects/racket/private/more-scheme.rkt:148:2: call-with-break-parameterization
   /usr/share/racket/collects/racket/private/more-scheme.rkt:265:2: call-with-exception-handler
about to suspend in atomic mode
fish: Job 1, “racket -l pict3d/tests/shaders” terminated by signal SIGABRT (Abort)
jeapostrophe commented 8 years ago

Ah yes, Lehi, I found the same problem when I tried Linux debugging this problem. I pushed a fix to gui-lib for that (https://github.com/racket/gui/commit/c1cddc538caa7089510b3c0512bb80f3d4bf7860) You could try with a snapshot build, unless you are already using the git release

lehitoskin commented 8 years ago

I'll have to check it out once 6.3.1 comes around.