diff options
| author | andromeda <andromeda@lenovo> | 2026-08-19 17:40:02 +0200 |
|---|---|---|
| committer | andromeda <andromeda@lenovo> | 2026-08-19 17:40:02 +0200 |
| commit | 9e5edbfe61a64bf40e0395a7310a1feca92b3cb6 (patch) | |
| tree | f738166a78984b02a8419f1a82ba63b9f736f6b3 /Shaders.hs | |
| parent | f94cca6abc7bc5bd4165165d3b615879d93ce22d (diff) | |
test shader
Diffstat (limited to 'Shaders.hs')
| -rw-r--r-- | Shaders.hs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Shaders.hs b/Shaders.hs new file mode 100644 index 0000000..f94bc43 --- /dev/null +++ b/Shaders.hs @@ -0,0 +1,23 @@ +{-# LANGUAGE BlockArguments #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE RebindableSyntax #-} +{-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} + +-- from the FIR docs +module Shaders where + +import FIR +import Math.Linear + +type FragmentDefs = '[ "in_pos" ':-> Input '[ Location 0 ] (V 2 Float) + , "out_col" ':-> Output '[ Location 0 ] (V 4 Float) + , "image" ':-> Texture2D '[ DescriptorSet 0, Binding 0 ] (RGBA8 UNorm) + , "main" ':-> EntryPoint '[ OriginLowerLeft ] Fragment + ] + +fragment :: Module FragmentDefs +fragment = Module $ entryPoint @"main" @Fragment do + pos <- get @"in_pos" + col <- use @(ImageTexel "image") NilOps pos + put @"out_col" col
\ No newline at end of file |
