lambdacube3d / lambdacube-compiler

LambdaCube 3D is a Haskell-like purely functional language for GPU. Try it out:
http://lambdacube3d.com
Other
85 stars 9 forks source link

Request: Texture2D size from int uniform #5

Open NCrashed opened 8 years ago

NCrashed commented 8 years ago

Tried to implement deffered rendering, hit the following:

windowSize = V2 (Uniform "windowWidth") (Uniform "windowHeight") :: Vec 2 Int

renderFrame $ let
   texture = Texture2D windowSize . PrjImageColor $ makeDiffuseBuffer
   in ...

Fails with:

src/LambdaCube/Compiler/CoreToIR.hs:(624,18)-(631,25): Non-exhaustive patterns in case

I think, the following line is causing this: https://github.com/lambdacube3d/lambdacube-compiler/blob/master/src/LambdaCube/Compiler/CoreToIR.hs#L628

csabahruska commented 8 years ago

This is related to dynamic pipelines what we don't support yet, but it is on the roadmap. I think you have to stick to a specific texture size for now. The problem source is that the system can not reallocate resources at runtime, therefore the the pipeline structure and resource parameters can not depend on user input. So the pipeline is static.

NCrashed commented 8 years ago

Thank you, I will disable resizing of window for now. Amazing project, shadow mapping with deffered passes in 30 minutes and 100 clocs.

screenshot from 2016-02-18 01-02-14