            inputs)))
 
 
-(defn shader [shader]
+(defn shader [shader opts]
   (let [ast (ast shader)
         ir (gamma.compiler.core/compile ast)
         v (gamma.compiler.core/variables ir)

            [gamma.api :as g]))





(defn glsl [shader]
  (with-out-str
    (fipp.printer/pprint-document
      (emit/emit (:ir shader) shader)
      {:width 80})))

(defn ast [inputs]
  (apply g/block

    (filter #(= :uniform (:storage %))
            (:inputs fs))))

(defn program
  ([x] (program x {}))
  ([x opts]
   (let [{:keys [vertex-shader fragment-shader]} x
         vs (shader vertex-shader opts) fs (shader fragment-shader opts)]
     {:tag             :program
      :vertex-shader   vs
      :fragment-shader fs
      :inputs          (program-inputs vs fs)})))



