Compute 0

This commit is contained in:
2026-06-15 20:07:42 -07:00
parent 3aac63d255
commit 96134404a2
13 changed files with 223 additions and 217 deletions

View File

@ -266,7 +266,6 @@ class Graphics implements kha.graphics4.Graphics {
}
public function beginFace(face: Int): Void {
// TODO: Hashlink conflict for shadowmap atlasing needs image and probes need cubemap
kinc_graphics_render_to_face((target is CubeMap) ? cast(target, CubeMap)._renderTarget : cast(target, Image)._renderTarget, face);
}

View File

@ -1,22 +1,25 @@
package kha.graphics4;
import haxe.io.Bytes;
import kha.Blob;
class ComputeShader {
public function new(sources: Array<Blob>, files: Array<String>) {
}
public function delete(): Void {
}
public function getConstantLocation(name: String): ConstantLocation {
return null;
}
public function getTextureUnit(name: String): TextureUnit {
return null;
}
}
package kha.graphics4;
import haxe.io.Bytes;
import kha.Blob;
class ComputeShader {
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);
}
}

View File

@ -261,10 +261,10 @@ class Graphics implements kha.graphics4.Graphics {
}
public function setComputeShader(shader: ComputeShader) {
Krom.setShaderCompute(shader.shader_);
}
public function compute(x: Int, y: Int, z: Int) {
Krom.compute(x, y, z);
}
}