lambdacube-compiler icon indicating copy to clipboard operation
lambdacube-compiler copied to clipboard

Request: Texture2D size from int uniform

Open NCrashed opened this issue 8 years ago • 2 comments

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

NCrashed avatar Feb 17 '16 23:02 NCrashed

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.

csabahruska avatar Feb 18 '16 09:02 csabahruska

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

NCrashed avatar Feb 18 '16 11:02 NCrashed