Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f3438e1
Added Window system and example usage
rudrabeniwal Jun 15, 2025
b2029b7
convert to new Scala 3 syntax, fix warnings, restructure test directo…
spamegg1 Jun 16, 2025
524557b
Github Actions should check if code compiles
spamegg1 Jun 16, 2025
0096f76
change job name
spamegg1 Jun 16, 2025
4146222
Merge pull request #49 from ComputeNode/fix-warnings
szymon-rd Jun 16, 2025
903f629
Refactor DSL
szymon-rd Jun 16, 2025
7ddd112
Formatting of refactor
szymon-rd Jun 16, 2025
41267ce
SpirvTools integration (#39)
Soleod Jun 16, 2025
6392ce7
Syntax modernization and cleanup (#52)
Soleod Jun 20, 2025
f9eff8a
Vulkan surface integration and refactor window management
rudrabeniwal Jun 22, 2025
7ae654f
adapting to new code style and made custom exceptions
rudrabeniwal Jun 30, 2025
5a6aadc
smol refactor
rudrabeniwal Jun 30, 2025
fded0a8
actual resolve for code style and custom exceptions
rudrabeniwal Jun 30, 2025
3a12340
🧹{}
rudrabeniwal Jun 30, 2025
5d3ed13
Merge origin/cyfra-rtrp into cyfra-rtrp-surface
rudrabeniwal Jul 3, 2025
ded1a92
typo causing errors fixed
rudrabeniwal Jul 9, 2025
9f5e6a1
new code style refactor
rudrabeniwal Jul 10, 2025
8b7038b
Refactor logging in surface module
rudrabeniwal Jul 22, 2025
132edd1
swapchainManager
rudrabeniwal Aug 2, 2025
99d012b
Refactor SwapchainManager to implement Swapchain class and image view…
rudrabeniwal Aug 6, 2025
4cfe36a
small refactor
rudrabeniwal Aug 8, 2025
c94cc03
incomplete graphics pipeline implementation
rudrabeniwal Aug 13, 2025
5773117
moving graphics part to rtrp module
rudrabeniwal Aug 13, 2025
d871c75
Implement framebuffer creation and refactor graphics pipeline and ren…
rudrabeniwal Aug 14, 2025
f835f85
implemented recordCommandBuffer, minor refactors
rudrabeniwal Aug 17, 2025
5ae558a
not wroking rtrp implemantation and example rn
rudrabeniwal Aug 17, 2025
ef9c9e4
Add Vulkan validation and cleanup methods; refactor shader loading
rudrabeniwal Aug 20, 2025
53d2de2
smol working rtrp example
rudrabeniwal Aug 22, 2025
ade2c69
unify queue variable naming
rudrabeniwal Aug 23, 2025
56e90a2
Added frames in flight
rudrabeniwal Aug 23, 2025
08d29bc
Implement swapchain recreation, resource management fixes
rudrabeniwal Sep 3, 2025
f40d613
Refactor vertex handling and buffer management in graphics pipeline
rudrabeniwal Sep 21, 2025
88aaad1
rectangle :)
rudrabeniwal Sep 22, 2025
071e6de
rendering square with a 4x4 grid of colors that it reads from the `da…
rudrabeniwal Sep 23, 2025
03808b3
using compute shaders to fill dataBuffer example
rudrabeniwal Sep 24, 2025
7fa555e
gpu-gpu
rudrabeniwal Sep 25, 2025
9d15d2b
syntax 🧹
rudrabeniwal Sep 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:

jobs:
format:
format_and_compile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -19,4 +19,4 @@ jobs:
with:
jvm: graalvm-java21
apps: sbt
- run: sbt "formatCheckAll"
- run: sbt "formatCheckAll; compile"
1 change: 1 addition & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ optIn.configStyleArguments = false
rewrite.rules = [RedundantBraces, RedundantParens, SortModifiers, PreferCurlyFors, Imports]
rewrite.sortModifiers.preset = styleGuide
rewrite.trailingCommas.style = always
rewrite.scala3.convertToNewSyntax = true

indent.defnSite = 2
newlines.inInterpolation = "avoid"
Expand Down
27 changes: 23 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ lazy val vulkanNatives =
else Seq.empty

lazy val commonSettings = Seq(
scalacOptions ++= Seq("-feature", "-deprecation", "-unchecked", "-language:implicitConversions"),
libraryDependencies ++= Seq(
"dev.zio" % "izumi-reflect_3" % "2.3.10",
"com.lihaoyi" % "pprint_3" % "0.9.0",
Expand All @@ -47,11 +48,10 @@ lazy val commonSettings = Seq(
"org.lwjgl" % "lwjgl-vma" % lwjglVersion classifier lwjglNatives,
"org.joml" % "joml" % jomlVersion,
"commons-io" % "commons-io" % "2.16.1",
"org.slf4j" % "slf4j-api" % "1.7.30",
"org.slf4j" % "slf4j-simple" % "1.7.30" % Test,
"org.scalameta" % "munit_3" % "1.0.0" % Test,
"com.lihaoyi" %% "sourcecode" % "0.4.3-M5",
"org.slf4j" % "slf4j-api" % "2.0.17",
"org.apache.logging.log4j" % "log4j-slf4j2-impl" % "2.24.3",
) ++ vulkanNatives,
)

Expand All @@ -60,9 +60,14 @@ lazy val runnerSettings = Seq(libraryDependencies += "org.apache.logging.log4j"
lazy val utility = (project in file("cyfra-utility"))
.settings(commonSettings)

lazy val spirvTools = (project in file("cyfra-spirv-tools"))
.settings(commonSettings)
.dependsOn(utility)

lazy val vulkan = (project in file("cyfra-vulkan"))
.settings(commonSettings)
.dependsOn(utility)
.settings(libraryDependencies ++= Seq("org.lwjgl" % "lwjgl-glfw" % lwjglVersion, "org.lwjgl" % "lwjgl-glfw" % lwjglVersion classifier lwjglNatives))

lazy val dsl = (project in file("cyfra-dsl"))
.settings(commonSettings)
Expand All @@ -74,7 +79,7 @@ lazy val compiler = (project in file("cyfra-compiler"))

lazy val runtime = (project in file("cyfra-runtime"))
.settings(commonSettings)
.dependsOn(compiler, dsl, vulkan, utility)
.dependsOn(compiler, dsl, vulkan, utility, spirvTools)

lazy val foton = (project in file("cyfra-foton"))
.settings(commonSettings)
Expand All @@ -92,9 +97,23 @@ lazy val e2eTest = (project in file("cyfra-e2e-test"))
.settings(commonSettings, runnerSettings)
.dependsOn(runtime)

lazy val rtrp = (project in file("cyfra-rtrp"))
.settings(commonSettings)
.dependsOn(utility, vulkan, runtime, dsl)
.settings(
libraryDependencies ++= Seq(
"org.lwjgl" % "lwjgl-glfw" % lwjglVersion,
"org.lwjgl" % "lwjgl-glfw" % lwjglVersion classifier lwjglNatives,
"org.scalatest" %% "scalatest" % "3.2.15" % Test,
),
run / fork := true,
run / javaOptions ++= Seq("-Dio.computenode.cyfra.vulkan.validation=true") ++
sys.env.get("VULKAN_SDK").map(sdk => s"-Djava.library.path=$sdk\\Lib").toSeq,
)

lazy val root = (project in file("."))
.settings(name := "Cyfra")
.aggregate(compiler, dsl, foton, runtime, vulkan, examples)
.aggregate(compiler, dsl, foton, runtime, vulkan, examples, rtrp)

e2eTest / Test / javaOptions ++= Seq("-Dorg.lwjgl.system.stackSize=1024", "-DuniqueLibraryNames=true")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
package io.computenode.cyfra.spirv

import io.computenode.cyfra.dsl.Control.Scope
import io.computenode.cyfra.dsl.Expression.{E, FunctionCall}
import io.computenode.cyfra.dsl.Value
import io.computenode.cyfra.dsl.macros.Source
import izumi.reflect.Tag
import io.computenode.cyfra.dsl.Expression.E

import scala.collection.mutable
import scala.quoted.Expr

private[cyfra] object BlockBuilder:

def buildBlock(tree: E[_], providedExprIds: Set[Int] = Set.empty): List[E[_]] =
val allVisited = mutable.Map[Int, E[_]]()
def buildBlock(tree: E[?], providedExprIds: Set[Int] = Set.empty): List[E[?]] =
val allVisited = mutable.Map[Int, E[?]]()
val inDegrees = mutable.Map[Int, Int]().withDefaultValue(0)
val q = mutable.Queue[E[_]]()
val q = mutable.Queue[E[?]]()
q.enqueue(tree)
allVisited(tree.treeid) = tree

Expand All @@ -28,8 +23,8 @@ private[cyfra] object BlockBuilder:
allVisited(childId) = child
q.enqueue(child)

val l = mutable.ListBuffer[E[_]]()
val roots = mutable.Queue[E[_]]()
val l = mutable.ListBuffer[E[?]]()
val roots = mutable.Queue[E[?]]()
allVisited.values.foreach: node =>
if inDegrees(node.treeid) == 0 then roots.enqueue(node)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package io.computenode.cyfra.spirv

import io.computenode.cyfra.dsl.macros.FnCall.FnIdentifier
import io.computenode.cyfra.dsl.macros.Source
import io.computenode.cyfra.spirv.compilers.FunctionCompiler.SprivFunction
import io.computenode.cyfra.spirv.SpirvConstants.HEADER_REFS_TOP
import io.computenode.cyfra.spirv.compilers.FunctionCompiler.SprivFunction
import io.computenode.cyfra.spirv.compilers.SpirvProgramCompiler.ArrayBufferBlock
import izumi.reflect.Tag
import izumi.reflect.macrortti.LightTypeTag
Expand All @@ -18,7 +17,7 @@ private[cyfra] case class Context(
voidFuncTypeRef: Int = -1,
workerIndexRef: Int = -1,
uniformVarRef: Int = -1,
constRefs: Map[(Tag[_], Any), Int] = Map(),
constRefs: Map[(Tag[?], Any), Int] = Map(),
exprRefs: Map[Int, Int] = Map(),
inBufferBlocks: List[ArrayBufferBlock] = List(),
outBufferBlocks: List[ArrayBufferBlock] = List(),
Expand Down
Loading