forked from LeenkxTeam/LNXSDK
Update Files
This commit is contained in:
25
Kha/Backends/Krom/kha/compute/Shader.hx
Normal file
25
Kha/Backends/Krom/kha/compute/Shader.hx
Normal file
@ -0,0 +1,25 @@
|
||||
package kha.compute;
|
||||
|
||||
import haxe.io.Bytes;
|
||||
import kha.Blob;
|
||||
|
||||
class Shader {
|
||||
public var shader_: Dynamic;
|
||||
|
||||
public function new(sources: Array<Blob>, files: Array<String>) {
|
||||
shader_ = Krom.createShaderCompute(sources[0].toBytes().getData());
|
||||
}
|
||||
|
||||
public function delete(): Void {
|
||||
Krom.deleteShaderCompute(shader_);
|
||||
shader_ = null;
|
||||
}
|
||||
|
||||
public function getConstantLocation(name: String): ConstantLocation {
|
||||
return Krom.getConstantLocationCompute(shader_, name);
|
||||
}
|
||||
|
||||
public function getTextureUnit(name: String): TextureUnit {
|
||||
return Krom.getTextureUnitCompute(shader_, name);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user