cbaggers / varjo

Lisp to GLSL Language Translator
BSD 2-Clause "Simplified" License
223 stars 23 forks source link

missing mod/vec3/vec3 #222

Closed azimut closed 5 years ago

azimut commented 5 years ago

Easy to workaround, filling just for completeness.

Signature is gentype/gentype https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/mod.xhtml

Test code:

> (funcall-g (lambda-g () (mod (v! 0 10 0) (v! 5 1 10))))

Error:

Varjo: There is no applicable method for the glsl function 'MOD'
when called with argument types:
(:VEC3 :VEC3)

Form: (MOD (V! 0 10 0) (V! 5 1 10))
   [Condition of type VARJO-CONDITIONS:NO-VALID-FUNCTION]

Restarts:
 0: [RETEST-ASSUMING-STAGE] VARJO.INTERNALS::RETEST-ASSUMING-STAGE
 1: [RETEST-ASSUMING-VERTEX-STAGE] VARJO.INTERNALS::RETEST-ASSUMING-VERTEX-STAGE
 2: [RETEST-ASSUMING-TESSELLATION-CONTROL-STAGE] VARJO.INTERNALS::RETEST-ASSUMING-TESSELLATION-CONTROL-STAGE
 3: [RETEST-ASSUMING-TESSELLATION-EVALUATION-STAGE] VARJO.INTERNALS::RETEST-ASSUMING-TESSELLATION-EVALUATION-STAGE
 4: [RETEST-ASSUMING-GEOMETRY-STAGE] VARJO.INTERNALS::RETEST-ASSUMING-GEOMETRY-STAGE
 5: [RETEST-ASSUMING-FRAGMENT-STAGE] VARJO.INTERNALS::RETEST-ASSUMING-FRAGMENT-STAGE
 --more--

Backtrace:
  0: (VARJO.INTERNALS::RAISE-TEST-TRANSLATE-ERROR (#<VARJO-CONDITIONS:NO-VALID-FUNCTION {1009B795D3}> #<VARJO-CONDITIONS:NO-VALID-FUNCTION {1009D8B293}> #<VARJO-CONDITIONS:NO-VALID-FUNCTION {1009DE3153}> #..
      Locals:
        ERRORS = (#<VARJO-CONDITIONS:NO-VALID-FUNCTION {1009B795D3}> #<VARJO-CONDITIONS:NO-VALID-FUNCTION {1009D8B293}> #<VARJO-CONDITIONS:NO-VALID-FUNCTION {1009DE3153}> ..)
        STAGE-TYPES = (:VERTEX :TESSELLATION-CONTROL :TESSELLATION-EVALUATION :GEOMETRY :FRAGMENT :COMPUTE)
  1: (VARJO.INTERNALS::%TEST-TRANSLATE-RAISING #<CLOSURE (LABELS VARJO.INTERNALS::GET-STAGE :IN VARJO.INTERNALS:TEST-TRANSLATE-FUNCTION-SPLIT-DETAILS) {1009B077AB}> (:VERTEX :TESSELLATION-CONTROL :TESSELLA..
      Locals:
        REQUEST-STAGE-FUNC = #<CLOSURE (LABELS VARJO.INTERNALS::GET-STAGE :IN VARJO.INTERNALS:TEST-TRANSLATE-FUNCTION-SPLIT-DETAILS) {1009B077AB}>
        STAGE-KINDS = (:VERTEX :TESSELLATION-CONTROL :TESSELLATION-EVALUATION :GEOMETRY :FRAGMENT :COMPUTE)
  2: (CEPL.PIPELINES::%TEST-&-PROCESS-SPEC #<CEPL.PIPELINES::GPU-FUNC-SPEC {1009B076B3}> :CACHE-SPEC T)
      Locals:
        CACHE-SPEC = T
        SPEC = #<CEPL.PIPELINES::GPU-FUNC-SPEC {1009B076B3}>
  3: ((:METHOD INITIALIZE-INSTANCE :AFTER (CEPL.PIPELINES::GPU-LAMBDA-STATE)) #<CEPL.PIPELINES::GPU-LAMBDA-STATE {1009B07563}>) [fast-method]
      Locals:
        LAMBDA-G = #<CEPL.PIPELINES::GPU-LAMBDA-STATE {1009B07563}>
  4: ((LAMBDA (SB-PCL::|.P0.| SB-PCL::|.P1.| SB-PCL::|.P2.| SB-PCL::|.P3.| SB-PCL::|.P4.| SB-PCL::|.P6.|) :IN "/home/sendai/quicklisp/local-projects/incandescent/cubemap/cubemap.lisp") #<unavailable argume..
  5: (CEPL.PIPELINES::MAKE-GPU-LAMBDA NIL ((MOD (V! 0 10 0) (V! 5 1 10))))
      Locals:
        ARGS = NIL
        BODY = ((MOD (V! 0 10 0) (V! 5 1 10)))
  6: ((MACRO-FUNCTION LAMBDA-G) (LAMBDA-G NIL (MOD (V! 0 10 0) (V! 5 1 10))) #<unused argument>)
      Locals:
        #:EXPR = (LAMBDA-G NIL ..)
  7: ((FLET SB-IMPL::PERFORM-EXPANSION :IN MACROEXPAND-1) #<FUNCTION (MACRO-FUNCTION LAMBDA-G) {532DCEBB}> NIL)
  8: (MACROEXPAND (LAMBDA-G NIL (MOD (V! 0 10 0) (V! 5 1 10))) #<NULL-LEXENV>)
  9: (SB-INT:SIMPLE-EVAL-IN-LEXENV (LAMBDA-G NIL (MOD (V! 0 10 0) (V! 5 1 10))) #<NULL-LEXENV>)
 10: (SB-INT:SIMPLE-EVAL-IN-LEXENV (FUNCALL-G (LAMBDA-G NIL (MOD # #))) #<NULL-LEXENV>)
 11: (EVAL (FUNCALL-G (LAMBDA-G NIL (MOD # #))))
cbaggers commented 5 years ago

Great catch, please pull the latest version of glsl-spec which should now have those definitions

cbaggers commented 5 years ago

If that looks good the feel free to close this :)

azimut commented 5 years ago

like magic! thx