From 6a5fc9cf18b96ab4866669aad39c65f578bf0de2 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Fri, 19 Jan 2024 23:12:03 +0100 Subject: [PATCH] Fix compute for hxcpp --- Backends/Kinc-hxcpp/kha/compute/Compute.hx | 176 ------------------ .../kha/compute/ConstantLocation.hx | 9 - Backends/Kinc-hxcpp/kha/compute/Shader.hx | 45 ----- .../Kinc-hxcpp/kha/compute/TextureUnit.hx | 9 - .../Kinc-hxcpp/kha/graphics4/ComputeShader.hx | 45 +++++ .../ShaderStorageBuffer.hx | 6 +- .../Kinc-hxcpp/kha/kore/graphics4/Graphics.hx | 18 ++ Sources/kha/compute/Access.hx | 7 - Sources/kha/compute/Compute.hx | 41 ---- Sources/kha/compute/ConstantLocation.hx | 3 - Sources/kha/compute/TextureUnit.hx | 3 - .../Shader.hx => graphics4/ComputeShader.hx} | 2 +- Sources/kha/graphics4/Graphics.hx | 4 + .../ShaderStorageBuffer.hx | 4 +- Sources/kha/internal/ShadersBuilder.hx | 4 +- 15 files changed, 73 insertions(+), 303 deletions(-) delete mode 100644 Backends/Kinc-hxcpp/kha/compute/Compute.hx delete mode 100644 Backends/Kinc-hxcpp/kha/compute/ConstantLocation.hx delete mode 100644 Backends/Kinc-hxcpp/kha/compute/Shader.hx delete mode 100644 Backends/Kinc-hxcpp/kha/compute/TextureUnit.hx create mode 100644 Backends/Kinc-hxcpp/kha/graphics4/ComputeShader.hx rename Backends/Kinc-hxcpp/kha/{compute => graphics4}/ShaderStorageBuffer.hx (94%) delete mode 100644 Sources/kha/compute/Access.hx delete mode 100644 Sources/kha/compute/Compute.hx delete mode 100644 Sources/kha/compute/ConstantLocation.hx delete mode 100644 Sources/kha/compute/TextureUnit.hx rename Sources/kha/{compute/Shader.hx => graphics4/ComputeShader.hx} (89%) rename Sources/kha/{compute => graphics4}/ShaderStorageBuffer.hx (82%) diff --git a/Backends/Kinc-hxcpp/kha/compute/Compute.hx b/Backends/Kinc-hxcpp/kha/compute/Compute.hx deleted file mode 100644 index d090dca24..000000000 --- a/Backends/Kinc-hxcpp/kha/compute/Compute.hx +++ /dev/null @@ -1,176 +0,0 @@ -package kha.compute; - -import kha.arrays.Float32Array; -import kha.Image; -import kha.FastFloat; -import kha.math.FastMatrix3; -import kha.math.FastMatrix4; -import kha.math.FastVector2; -import kha.math.FastVector3; -import kha.math.FastVector4; -import kha.graphics4.CubeMap; -import kha.graphics4.TextureAddressing; -import kha.graphics4.TextureFilter; -import kha.graphics4.MipMapFilter; - -@:headerCode(" -#include -") -class Compute { - public static function setBool(location: ConstantLocation, value: Bool) { - untyped __cpp__("kinc_compute_set_bool(location->location, value);"); - } - - public static function setInt(location: ConstantLocation, value: Int) { - untyped __cpp__("kinc_compute_set_int(location->location, value);"); - } - - public static function setFloat(location: ConstantLocation, value: FastFloat) { - untyped __cpp__("kinc_compute_set_float(location->location, value);"); - } - - public static function setFloat2(location: ConstantLocation, value1: FastFloat, value2: FastFloat) { - untyped __cpp__("kinc_compute_set_float2(location->location, value1, value2);"); - } - - public static function setFloat3(location: ConstantLocation, value1: FastFloat, value2: FastFloat, value3: FastFloat) { - untyped __cpp__("kinc_compute_set_float3(location->location, value1, value2, value3);"); - } - - public static function setFloat4(location: ConstantLocation, value1: FastFloat, value2: FastFloat, value3: FastFloat, value4: FastFloat) { - untyped __cpp__("kinc_compute_set_float4(location->location, value1, value2, value3, value4);"); - } - - public static function setFloats(location: ConstantLocation, values: Float32Array) { - untyped __cpp__("kinc_compute_set_floats(location->location, (float *)&values->self.data[values->byteArrayOffset], values->byteArrayLength);"); - } - - public static function setVector2(location: ConstantLocation, value: FastVector2): Void { - Compute.setFloat2(location, value.x, value.y); - } - - public static function setVector3(location: ConstantLocation, value: FastVector3): Void { - Compute.setFloat3(location, value.x, value.y, value.z); - } - - public static function setVector4(location: ConstantLocation, value: FastVector4): Void { - Compute.setFloat4(location, value.x, value.y, value.z, value.w); - } - - public static function setMatrix(location: ConstantLocation, value: FastMatrix4): Void { - setMatrixPrivate(location, value); - } - - public static function setMatrix3(location: ConstantLocation, value: FastMatrix3): Void { - setMatrix3Private(location, value); - } - - @:functionCode(" - kinc_matrix4x4_t value; - kinc_matrix4x4_set(&value, 0, 0, matrix->_00); kinc_matrix4x4_set(&value, 0, 1, matrix->_10); kinc_matrix4x4_set(&value, 0, 2, matrix->_20); kinc_matrix4x4_set(&value, 0, 3, matrix->_30); - kinc_matrix4x4_set(&value, 1, 0, matrix->_01); kinc_matrix4x4_set(&value, 1, 1, matrix->_11); kinc_matrix4x4_set(&value, 1, 2, matrix->_21); kinc_matrix4x4_set(&value, 1, 3, matrix->_31); - kinc_matrix4x4_set(&value, 2, 0, matrix->_02); kinc_matrix4x4_set(&value, 2, 1, matrix->_12); kinc_matrix4x4_set(&value, 2, 2, matrix->_22); kinc_matrix4x4_set(&value, 2, 3, matrix->_32); - kinc_matrix4x4_set(&value, 3, 0, matrix->_03); kinc_matrix4x4_set(&value, 3, 1, matrix->_13); kinc_matrix4x4_set(&value, 3, 2, matrix->_23); kinc_matrix4x4_set(&value, 3, 3, matrix->_33); - kinc_compute_set_matrix4(location->location, &value); - ") - static function setMatrixPrivate(location: ConstantLocation, matrix: FastMatrix4): Void {} - - @:functionCode(" - kinc_matrix3x3_t value; - kinc_matrix3x3_set(&value, 0, 0, matrix->_00); kinc_matrix3x3_set(&value, 0, 1, matrix->_10); kinc_matrix3x3_set(&value, 0, 2, matrix->_20); - kinc_matrix3x3_set(&value, 1, 0, matrix->_01); kinc_matrix3x3_set(&value, 1, 1, matrix->_11); kinc_matrix3x3_set(&value, 1, 2, matrix->_21); - kinc_matrix3x3_set(&value, 2, 0, matrix->_02); kinc_matrix3x3_set(&value, 2, 1, matrix->_12); kinc_matrix3x3_set(&value, 2, 2, matrix->_22); - kinc_compute_set_matrix3(location->location, &value); - ") - static function setMatrix3Private(location: ConstantLocation, matrix: FastMatrix3): Void {} - - public static function setBuffer(buffer: ShaderStorageBuffer, index: Int) { - untyped __cpp__(" - #ifdef KORE_OPENGL - kinc_compute_set_buffer(&buffer->buffer, index); - #endif - "); - } - - public static function setTexture(unit: TextureUnit, texture: Image, access: Access) { - setTexturePrivate(unit, texture, access); - } - - @:functionCode(" - if (texture->imageType == KhaImageTypeTexture) kinc_compute_set_texture(unit->unit, &texture->texture, (kinc_compute_access_t)access); - else if (texture->imageType == KhaImageTypeRenderTarget) kinc_compute_set_render_target(unit->unit, &texture->renderTarget, (kinc_compute_access_t)access); - ") - static function setTexturePrivate(unit: TextureUnit, texture: Image, access: Int): Void {} - - public static function setSampledTexture(unit: TextureUnit, texture: Image) { - setSampledTexturePrivate(unit, texture); - } - - @:functionCode(" - if (texture->imageType == KhaImageTypeTexture) kinc_compute_set_sampled_texture(unit->unit, &texture->texture); - else if (texture->imageType == KhaImageTypeRenderTarget) kinc_compute_set_sampled_render_target(unit->unit, &texture->renderTarget); - ") - static function setSampledTexturePrivate(unit: TextureUnit, texture: Image): Void {} - - public static function setSampledDepthTexture(unit: TextureUnit, texture: Image) { - untyped __cpp__("if (texture->imageType == KhaImageTypeRenderTarget) kinc_compute_set_sampled_depth_from_render_target(unit->unit, &texture->renderTarget);"); - } - - public static function setSampledCubeMap(unit: TextureUnit, cubeMap: CubeMap) { - setSampledCubeMapPrivate(unit, cubeMap); - } - - @:functionCode("kinc_compute_set_sampled_render_target(unit->unit, &cubeMap->renderTarget);") - static function setSampledCubeMapPrivate(unit: TextureUnit, cubeMap: CubeMap): Void {} - - public static function setSampledDepthCubeMap(unit: TextureUnit, cubeMap: CubeMap) { - untyped __cpp__("kinc_compute_set_sampled_depth_from_render_target(unit->unit, &cubeMap->renderTarget);"); - } - - @:functionCode(" - kinc_compute_set_texture_addressing(unit->unit, KINC_G4_TEXTURE_DIRECTION_U, (kinc_g4_texture_addressing_t)uWrap); - kinc_compute_set_texture_addressing(unit->unit, KINC_G4_TEXTURE_DIRECTION_V, (kinc_g4_texture_addressing_t)vWrap); - ") - static function setTextureWrapNative(unit: TextureUnit, uWrap: Int, vWrap: Int): Void {} - - @:functionCode(" - kinc_compute_set_texture3d_addressing(unit->unit, KINC_G4_TEXTURE_DIRECTION_U, (kinc_g4_texture_addressing_t)uWrap); - kinc_compute_set_texture3d_addressing(unit->unit, KINC_G4_TEXTURE_DIRECTION_V, (kinc_g4_texture_addressing_t)vWrap); - kinc_compute_set_texture3d_addressing(unit->unit, KINC_G4_TEXTURE_DIRECTION_W, (kinc_g4_texture_addressing_t)wWrap); - ") - static function setTexture3DWrapNative(unit: TextureUnit, uWrap: Int, vWrap: Int, wWrap: Int): Void {} - - @:functionCode(" - kinc_compute_set_texture_minification_filter(unit->unit, (kinc_g4_texture_filter_t)minificationFilter); - kinc_compute_set_texture_magnification_filter(unit->unit, (kinc_g4_texture_filter_t)magnificationFilter); - kinc_compute_set_texture_mipmap_filter(unit->unit, (kinc_g4_mipmap_filter_t)mipMapFilter); - ") - static function setTextureFiltersNative(unit: TextureUnit, minificationFilter: Int, magnificationFilter: Int, mipMapFilter: Int): Void {} - - @:functionCode(" - kinc_compute_set_texture3d_minification_filter(unit->unit, (kinc_g4_texture_filter_t)minificationFilter); - kinc_compute_set_texture3d_magnification_filter(unit->unit, (kinc_g4_texture_filter_t)magnificationFilter); - kinc_compute_set_texture3d_mipmap_filter(unit->unit, (kinc_g4_mipmap_filter_t)mipMapFilter); - ") - static function setTexture3DFiltersNative(unit: TextureUnit, minificationFilter: Int, magnificationFilter: Int, mipMapFilter: Int): Void {} - - public static function setTextureParameters(unit: TextureUnit, uAddressing: TextureAddressing, vAddressing: TextureAddressing, - minificationFilter: TextureFilter, magnificationFilter: TextureFilter, mipmapFilter: MipMapFilter): Void { - setTextureWrapNative(unit, uAddressing, vAddressing); - setTextureFiltersNative(unit, minificationFilter, magnificationFilter, mipmapFilter); - } - - public static function setTexture3DParameters(unit: TextureUnit, uAddressing: TextureAddressing, vAddressing: TextureAddressing, - wAddressing: TextureAddressing, minificationFilter: TextureFilter, magnificationFilter: TextureFilter, mipmapFilter: MipMapFilter): Void { - setTexture3DWrapNative(unit, uAddressing, vAddressing, wAddressing); - setTexture3DFiltersNative(unit, minificationFilter, magnificationFilter, mipmapFilter); - } - - public static function setShader(shader: Shader) { - untyped __cpp__("kinc_compute_set_shader(&shader->shader);"); - } - - public static function compute(x: Int, y: Int, z: Int) { - untyped __cpp__("kinc_compute(x, y, z);"); - } -} diff --git a/Backends/Kinc-hxcpp/kha/compute/ConstantLocation.hx b/Backends/Kinc-hxcpp/kha/compute/ConstantLocation.hx deleted file mode 100644 index 3026184b7..000000000 --- a/Backends/Kinc-hxcpp/kha/compute/ConstantLocation.hx +++ /dev/null @@ -1,9 +0,0 @@ -package kha.compute; - -@:headerCode(" -#include -") -@:headerClassCode("kinc_compute_constant_location location;") -class ConstantLocation { - public function new() {} -} diff --git a/Backends/Kinc-hxcpp/kha/compute/Shader.hx b/Backends/Kinc-hxcpp/kha/compute/Shader.hx deleted file mode 100644 index 294ab2888..000000000 --- a/Backends/Kinc-hxcpp/kha/compute/Shader.hx +++ /dev/null @@ -1,45 +0,0 @@ -package kha.compute; - -import haxe.io.Bytes; -import kha.Blob; - -@:headerCode(" -#include -") -@:headerClassCode("kinc_compute_shader shader;") -class Shader { - public function new(sources: Array, files: Array) { - init(sources[0], files[0]); - } - - function init(source: Blob, file: String): Void { - untyped __cpp__("kinc_compute_shader_init(&shader, source->bytes->b->Pointer(), source->get_length());"); - } - - public function delete(): Void { - untyped __cpp__("kinc_compute_shader_destroy(&shader);"); - } - - public function getConstantLocation(name: String): ConstantLocation { - var location = new ConstantLocation(); - initConstantLocation(location, name); - return location; - } - - @:functionCode("location->location = kinc_compute_shader_get_constant_location(&shader, name.c_str());") - function initConstantLocation(location: ConstantLocation, name: String): Void {} - - public function getTextureUnit(name: String): TextureUnit { - var unit = new TextureUnit(); - initTextureUnit(unit, name); - return unit; - } - - @:functionCode("unit->unit = kinc_compute_shader_get_texture_unit(&shader, name.c_str());") - function initTextureUnit(unit: TextureUnit, name: String): Void {} - - @:keep - function _forceInclude(): Void { - Bytes.alloc(0); - } -} diff --git a/Backends/Kinc-hxcpp/kha/compute/TextureUnit.hx b/Backends/Kinc-hxcpp/kha/compute/TextureUnit.hx deleted file mode 100644 index f3ca09baa..000000000 --- a/Backends/Kinc-hxcpp/kha/compute/TextureUnit.hx +++ /dev/null @@ -1,9 +0,0 @@ -package kha.compute; - -@:headerCode(" -#include -") -@:headerClassCode("kinc_compute_texture_unit unit;") -class TextureUnit { - public function new() {} -} diff --git a/Backends/Kinc-hxcpp/kha/graphics4/ComputeShader.hx b/Backends/Kinc-hxcpp/kha/graphics4/ComputeShader.hx new file mode 100644 index 000000000..172460743 --- /dev/null +++ b/Backends/Kinc-hxcpp/kha/graphics4/ComputeShader.hx @@ -0,0 +1,45 @@ +package kha.graphics4; + +import haxe.io.Bytes; +import kha.Blob; + +@:headerCode(" +#include +") +@:headerClassCode("kinc_g4_compute_shader shader;") +class ComputeShader { + public function new(sources: Array, files: Array) { + init(sources[0], files[0]); + } + + function init(source: Blob, file: String): Void { + untyped __cpp__("kinc_g4_compute_shader_init(&shader, source->bytes->b->Pointer(), source->get_length());"); + } + + public function delete(): Void { + untyped __cpp__("kinc_g4_compute_shader_destroy(&shader);"); + } + + public function getConstantLocation(name: String): ConstantLocation { + var location = new kha.kore.graphics4.ConstantLocation(); + initConstantLocation(location, name); + return location; + } + + @:functionCode("location->location = kinc_g4_compute_shader_get_constant_location(&shader, name.c_str());") + function initConstantLocation(location: kha.kore.graphics4.ConstantLocation, name: String): Void {} + + public function getTextureUnit(name: String): TextureUnit { + var unit = new kha.kore.graphics4.TextureUnit(); + initTextureUnit(unit, name); + return unit; + } + + @:functionCode("unit->unit = kinc_g4_compute_shader_get_texture_unit(&shader, name.c_str());") + function initTextureUnit(unit: kha.kore.graphics4.TextureUnit, name: String): Void {} + + @:keep + function _forceInclude(): Void { + Bytes.alloc(0); + } +} diff --git a/Backends/Kinc-hxcpp/kha/compute/ShaderStorageBuffer.hx b/Backends/Kinc-hxcpp/kha/graphics4/ShaderStorageBuffer.hx similarity index 94% rename from Backends/Kinc-hxcpp/kha/compute/ShaderStorageBuffer.hx rename to Backends/Kinc-hxcpp/kha/graphics4/ShaderStorageBuffer.hx index 6a4fa2acf..1d82826c8 100644 --- a/Backends/Kinc-hxcpp/kha/compute/ShaderStorageBuffer.hx +++ b/Backends/Kinc-hxcpp/kha/graphics4/ShaderStorageBuffer.hx @@ -1,9 +1,7 @@ -package kha.compute; - -import kha.graphics4.VertexData; +package kha.graphics4; @:headerCode(" -#include +#include ") @:headerClassCode(" #ifdef KORE_OPENGL diff --git a/Backends/Kinc-hxcpp/kha/kore/graphics4/Graphics.hx b/Backends/Kinc-hxcpp/kha/kore/graphics4/Graphics.hx index 52741e466..8af657968 100644 --- a/Backends/Kinc-hxcpp/kha/kore/graphics4/Graphics.hx +++ b/Backends/Kinc-hxcpp/kha/kore/graphics4/Graphics.hx @@ -10,8 +10,10 @@ import kha.graphics4.FragmentShader; import kha.graphics4.BlendingFactor; import kha.graphics4.BlendingOperation; import kha.graphics4.CompareMode; +import kha.graphics4.ComputeShader; import kha.graphics4.MipMapFilter; import kha.graphics4.PipelineState; +import kha.graphics4.ShaderStorageBuffer; import kha.graphics4.StencilAction; import kha.graphics4.TexDir; import kha.graphics4.TextureAddressing; @@ -450,6 +452,22 @@ class Graphics implements kha.graphics4.Graphics { } } + public function setShaderStorageBuffer(buffer: ShaderStorageBuffer, index: Int) { + untyped __cpp__(" + #ifdef KORE_OPENGL + kinc_compute_set_buffer(&buffer->buffer, index); + #endif + "); + } + + public function setComputeShader(shader: ComputeShader) { + untyped __cpp__("kinc_g4_set_compute_shader(&shader->shader);"); + } + + public function compute(x: Int, y: Int, z: Int) { + untyped __cpp__("kinc_g4_compute(x, y, z);"); + } + @:functionCode("kinc_g4_restore_render_target();") function renderToBackbuffer(): Void {} diff --git a/Sources/kha/compute/Access.hx b/Sources/kha/compute/Access.hx deleted file mode 100644 index 5fba3024f..000000000 --- a/Sources/kha/compute/Access.hx +++ /dev/null @@ -1,7 +0,0 @@ -package kha.compute; - -enum abstract Access(Int) to Int { - var Read = 0; - var Write = 1; - var ReadWrite = 2; -} diff --git a/Sources/kha/compute/Compute.hx b/Sources/kha/compute/Compute.hx deleted file mode 100644 index 05ba34994..000000000 --- a/Sources/kha/compute/Compute.hx +++ /dev/null @@ -1,41 +0,0 @@ -package kha.compute; - -import kha.arrays.Float32Array; -import kha.Image; -import kha.FastFloat; -import kha.math.FastMatrix3; -import kha.math.FastMatrix4; -import kha.math.FastVector2; -import kha.math.FastVector3; -import kha.math.FastVector4; -import kha.graphics4.CubeMap; -import kha.graphics4.TextureAddressing; -import kha.graphics4.TextureFilter; -import kha.graphics4.MipMapFilter; - -extern class Compute { - public static function setBool(location: ConstantLocation, value: Bool): Void; - public static function setInt(location: ConstantLocation, value: Int): Void; - public static function setFloat(location: ConstantLocation, value: FastFloat): Void; - public static function setFloat2(location: ConstantLocation, value1: FastFloat, value2: FastFloat): Void; - public static function setFloat3(location: ConstantLocation, value1: FastFloat, value2: FastFloat, value3: FastFloat): Void; - public static function setFloat4(location: ConstantLocation, value1: FastFloat, value2: FastFloat, value3: FastFloat, value4: FastFloat): Void; - public static function setFloats(location: ConstantLocation, values: Float32Array): Void; - public static function setVector2(location: ConstantLocation, value: FastVector2): Void; - public static function setVector3(location: ConstantLocation, value: FastVector3): Void; - public static function setVector4(location: ConstantLocation, value: FastVector4): Void; - public static function setMatrix(location: ConstantLocation, value: FastMatrix4): Void; - public static function setMatrix3(location: ConstantLocation, value: FastMatrix3): Void; - public static function setBuffer(buffer: ShaderStorageBuffer, index: Int): Void; - public static function setTexture(unit: TextureUnit, texture: Image, access: Access): Void; - public static function setSampledTexture(unit: TextureUnit, texture: Image): Void; - public static function setSampledDepthTexture(unit: TextureUnit, texture: Image): Void; - public static function setSampledCubeMap(unit: TextureUnit, cubeMap: CubeMap): Void; - public static function setSampledDepthCubeMap(unit: TextureUnit, cubeMap: CubeMap): Void; - public static function setTextureParameters(unit: TextureUnit, uAddressing: TextureAddressing, vAddressing: TextureAddressing, - minificationFilter: TextureFilter, magnificationFilter: TextureFilter, mipmapFilter: MipMapFilter): Void; - public static function setTexture3DParameters(unit: TextureUnit, uAddressing: TextureAddressing, vAddressing: TextureAddressing, - wAddressing: TextureAddressing, minificationFilter: TextureFilter, magnificationFilter: TextureFilter, mipmapFilter: MipMapFilter): Void; - public static function setShader(shader: Shader): Void; - public static function compute(x: Int, y: Int, z: Int): Void; -} diff --git a/Sources/kha/compute/ConstantLocation.hx b/Sources/kha/compute/ConstantLocation.hx deleted file mode 100644 index c5c096c2d..000000000 --- a/Sources/kha/compute/ConstantLocation.hx +++ /dev/null @@ -1,3 +0,0 @@ -package kha.compute; - -extern class ConstantLocation {} diff --git a/Sources/kha/compute/TextureUnit.hx b/Sources/kha/compute/TextureUnit.hx deleted file mode 100644 index ad9d82de6..000000000 --- a/Sources/kha/compute/TextureUnit.hx +++ /dev/null @@ -1,3 +0,0 @@ -package kha.compute; - -extern class TextureUnit {} diff --git a/Sources/kha/compute/Shader.hx b/Sources/kha/graphics4/ComputeShader.hx similarity index 89% rename from Sources/kha/compute/Shader.hx rename to Sources/kha/graphics4/ComputeShader.hx index 26f3838b6..13d741747 100644 --- a/Sources/kha/compute/Shader.hx +++ b/Sources/kha/graphics4/ComputeShader.hx @@ -1,4 +1,4 @@ -package kha.compute; +package kha.graphics4; import kha.Blob; diff --git a/Sources/kha/graphics4/Graphics.hx b/Sources/kha/graphics4/Graphics.hx index cf09a4563..5dc374f32 100644 --- a/Sources/kha/graphics4/Graphics.hx +++ b/Sources/kha/graphics4/Graphics.hx @@ -53,6 +53,10 @@ interface Graphics { function setPipeline(pipeline: PipelineState): Void; + function setShaderStorageBuffer(buffer: ShaderStorageBuffer, index: Int): Void; + function setComputeShader(shader: ComputeShader): Void; + function compute(x: Int, y: Int, z: Int): Void; + function setBool(location: ConstantLocation, value: Bool): Void; function setInt(location: ConstantLocation, value: Int): Void; function setInt2(location: ConstantLocation, value1: Int, value2: Int): Void; diff --git a/Sources/kha/compute/ShaderStorageBuffer.hx b/Sources/kha/graphics4/ShaderStorageBuffer.hx similarity index 82% rename from Sources/kha/compute/ShaderStorageBuffer.hx rename to Sources/kha/graphics4/ShaderStorageBuffer.hx index 15dfab80c..6f1ea4388 100644 --- a/Sources/kha/compute/ShaderStorageBuffer.hx +++ b/Sources/kha/graphics4/ShaderStorageBuffer.hx @@ -1,6 +1,4 @@ -package kha.compute; - -import kha.graphics4.VertexData; +package kha.graphics4; extern class ShaderStorageBuffer { public function new(indexCount: Int, type: VertexData); diff --git a/Sources/kha/internal/ShadersBuilder.hx b/Sources/kha/internal/ShadersBuilder.hx index 8572d8240..d86a7096e 100644 --- a/Sources/kha/internal/ShadersBuilder.hx +++ b/Sources/kha/internal/ShadersBuilder.hx @@ -56,7 +56,7 @@ class ShadersBuilder { doc: null, meta: [], access: [APublic, AStatic], - kind: FVar(macro : kha.compute.Shader, macro null), + kind: FVar(macro : kha.graphics4.ComputeShader, macro null), pos: Context.currentPos() }); @@ -69,7 +69,7 @@ class ShadersBuilder { var bytes: haxe.io.Bytes = haxe.Unserializer.run(data); blobs.push(kha.Blob.fromBytes(bytes)); } - $i{fixedName} = new kha.compute.Shader(blobs, $v{filenames}); + $i{fixedName} = new kha.graphics4.ComputeShader(blobs, $v{filenames}); } }; }