Skip to content

Commit

Permalink
Fix HTML5
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Jan 20, 2024
1 parent 51d954c commit d951192
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Backends/HTML5/kha/graphics4/ComputeShader.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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;
}
}
24 changes: 24 additions & 0 deletions Backends/HTML5/kha/graphics4/ShaderStorageBuffer.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package kha.graphics4;

class ShaderStorageBuffer {
var data: Array<Int>;
var myCount: Int;

public function new(indexCount: Int, type: VertexData) {
myCount = indexCount;
data = new Array<Int>();
data[myCount - 1] = 0;
}

public function delete(): Void {}

public function lock(): Array<Int> {
return data;
}

public function unlock(): Void {}

public function count(): Int {
return myCount;
}
}
14 changes: 14 additions & 0 deletions Backends/HTML5/kha/js/graphics4/Graphics.hx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ import js.html.webgl.GL;
import kha.graphics4.BlendingFactor;
import kha.graphics4.BlendingOperation;
import kha.graphics4.CompareMode;
import kha.graphics4.ComputeShader;
import kha.graphics4.CubeMap;
import kha.graphics4.CullMode;
import kha.graphics4.IndexBuffer;
import kha.graphics4.MipMapFilter;
import kha.graphics4.PipelineState;
import kha.graphics4.ShaderStorageBuffer;
import kha.graphics4.StencilAction;
import kha.graphics4.TextureAddressing;
import kha.graphics4.TextureFilter;
Expand Down Expand Up @@ -735,4 +737,16 @@ class Graphics implements kha.graphics4.Graphics {
public function instancedRenderingAvailable(): Bool {
return instancedExtension;
}

public function setShaderStorageBuffer(buffer: ShaderStorageBuffer, index: Int) {

}

public function setComputeShader(shader: ComputeShader) {

}

public function compute(x: Int, y: Int, z: Int) {

}
}

0 comments on commit d951192

Please sign in to comment.