Skip to content

Commit bf68100

Browse files
committed
TEMP function
1 parent d4d07a7 commit bf68100

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

korge-core/src/korlibs/graphics/shader/shaders.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,12 @@ data class Program(val vertex: VertexShader, val fragment: FragmentShader, val n
759759

760760
fun TEMP(type: VarType): Temp = Temp(context.tempLastId++, type)
761761

762+
fun TEMP(initialValue: Operand): Temp {
763+
val temp = TEMP(initialValue.type)
764+
SET(temp, initialValue)
765+
return temp
766+
}
767+
762768
class FuncDeclGetter<T : FuncRef>(val decl: FuncDecl) {
763769
operator fun getValue(thisRef: Any?, property: KProperty<*>): T = decl as T
764770
}

0 commit comments

Comments
 (0)