Skip to content

glsl code getting interpreted as a format directive #246

@Piroshky

Description

@Piroshky

The glsl code emitted for lognand is return (~(A & B));. Unfortunately "~(" has semantic meaning to #'format so this causes an error when glsl-chunk-from-compiled calls glsl-line, which in turn calls format.
I fixed this by changing #'glsl-line to the following:

(defun glsl-line (control-string &rest args)
  (declare (type string control-string))
  (%make-glsl-line :string-part (if args (apply #'format nil control-string args) control-string)))

All I did was wrap the format call in an if statement that checks if there are args to pass to format.
If there isn't then format isn't needed anyways. I didn't make this a pull request as it seems like a
bit of a bodge and doesn't address the underlying issue. But I figure'd I'd document it in case
someone needs it short term.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions