Skip to content

Commit

Permalink
workaround nim-lang/Nim#12670
Browse files Browse the repository at this point in the history
  • Loading branch information
krux02 committed Nov 16, 2019
1 parent e1bb70e commit 80f35c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions experiment/renderMacro.nim
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ macro render_inner(debug: static[bool], mesh, arg: typed): untyped =
################################ shared code ###############################
############################################################################

var sharedCode = ""
var sharedCode: string

# generate types
sharedCode.add "// types section\n"
Expand Down Expand Up @@ -341,7 +341,8 @@ macro render_inner(debug: static[bool], mesh, arg: typed): untyped =
########################## generate vertex shader ##########################
############################################################################

var vertexShader = "#version 450\n"
var vertexShader: string
vertexShader.add "#version 450\n"

vertexShader.add sharedCode

Expand Down Expand Up @@ -393,8 +394,8 @@ macro render_inner(debug: static[bool], mesh, arg: typed): untyped =
############################################################################

# TODO uniform locations are incorrect, use uniform buffer.

var fragmentShader = "#version 450\n"
var fragmentShader: string
fragmentShader.add "#version 450\n"

fragmentShader.add sharedCode

Expand Down
8 changes: 4 additions & 4 deletions fancygl/typeinfo.nim
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ proc glslType*(arg: NimNode): string {.compileTime.} =

Tsym.matchAst:
of ident"float32":
result = "mat"
result.add "mat"
of ident"float64":
result = "dmat"
result.add "dmat"
of ident"int32":
result = "imat"
result.add "imat"
of ident"bool":
result = "bmat"
result.add "bmat"

sizeLit1.expectIntIn 2..4
sizeLit2.expectIntIn 2..4
Expand Down

0 comments on commit 80f35c9

Please sign in to comment.