Update Files
This commit is contained in:
3
Kha/Sources/kha/graphics5_/AccelerationStructure.hx
Normal file
3
Kha/Sources/kha/graphics5_/AccelerationStructure.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
interface AccelerationStructure {}
|
3
Kha/Sources/kha/graphics5_/BlendingFactor.hx
Normal file
3
Kha/Sources/kha/graphics5_/BlendingFactor.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef BlendingFactor = kha.graphics4.BlendingFactor;
|
3
Kha/Sources/kha/graphics5_/BlendingOperation.hx
Normal file
3
Kha/Sources/kha/graphics5_/BlendingOperation.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef BlendingOperation = kha.graphics4.BlendingOperation;
|
45
Kha/Sources/kha/graphics5_/CommandList.hx
Normal file
45
Kha/Sources/kha/graphics5_/CommandList.hx
Normal file
@ -0,0 +1,45 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
interface CommandList {
|
||||
function begin(): Void;
|
||||
function end(): Void;
|
||||
function setRenderTargets(targets: Array<RenderTarget>): Void;
|
||||
function setPipelineLayout(): Void;
|
||||
function clear(target: RenderTarget, ?color: Color, ?depth: Float, ?stencil: Int): Void;
|
||||
|
||||
function setVertexBuffer(vertexBuffer: VertexBuffer): Void;
|
||||
function setVertexBuffers(vertexBuffers: Array<kha.graphics4.VertexBuffer>): Void;
|
||||
function setIndexBuffer(indexBuffer: IndexBuffer): Void;
|
||||
|
||||
function uploadIndexBuffer(buffer: IndexBuffer): Void;
|
||||
function uploadVertexBuffer(buffer: VertexBuffer): Void;
|
||||
function uploadTexture(texture: Image): Void;
|
||||
|
||||
function setTexture(unit: TextureUnit, texture: Image): Void;
|
||||
function setTextureDepth(unit: TextureUnit, texture: Image): Void;
|
||||
function setTextureArray(unit: TextureUnit, texture: Image): Void;
|
||||
function setVideoTexture(unit: TextureUnit, texture: Video): Void;
|
||||
function setImageTexture(unit: TextureUnit, texture: Image): Void;
|
||||
function setTextureParameters(texunit: TextureUnit, uAddressing: TextureAddressing, vAddressing: TextureAddressing, minificationFilter: TextureFilter,
|
||||
magnificationFilter: TextureFilter, mipmapFilter: MipMapFilter): Void;
|
||||
function setTexture3DParameters(texunit: TextureUnit, uAddressing: TextureAddressing, vAddressing: TextureAddressing, wAddressing: TextureAddressing,
|
||||
minificationFilter: TextureFilter, magnificationFilter: TextureFilter, mipmapFilter: MipMapFilter): Void;
|
||||
function setCubeMap(unit: TextureUnit, cubeMap: CubeMap): Void;
|
||||
function setCubeMapDepth(unit: TextureUnit, cubeMap: CubeMap): Void;
|
||||
|
||||
function setPipeline(pipeline: PipelineState): Void;
|
||||
|
||||
function setVertexConstants(buffer: ConstantBuffer): Void;
|
||||
function setFragmentConstants(buffer: ConstantBuffer): Void;
|
||||
|
||||
function drawIndexedVertices(start: Int = 0, count: Int = -1): Void;
|
||||
function drawIndexedVerticesInstanced(instanceCount: Int, start: Int = 0, count: Int = -1): Void;
|
||||
|
||||
function renderTargetToFramebufferBarrier(renderTarget: Image): Void;
|
||||
function framebufferToRenderTargetBarrier(renderTarget: Image): Void;
|
||||
function textureToRenderTargetBarrier(renderTarget: Image): Void;
|
||||
function renderTargetToTextureBarrier(renderTarget: Image): Void;
|
||||
|
||||
function execute(): Void;
|
||||
function executeAndWait(): Void;
|
||||
}
|
3
Kha/Sources/kha/graphics5_/CompareMode.hx
Normal file
3
Kha/Sources/kha/graphics5_/CompareMode.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef CompareMode = kha.graphics4.CompareMode;
|
23
Kha/Sources/kha/graphics5_/ConstantBuffer.hx
Normal file
23
Kha/Sources/kha/graphics5_/ConstantBuffer.hx
Normal file
@ -0,0 +1,23 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
import kha.arrays.Float32Array;
|
||||
import kha.math.FastVector2;
|
||||
import kha.math.FastVector3;
|
||||
import kha.math.FastVector4;
|
||||
import kha.math.FastMatrix3;
|
||||
import kha.math.FastMatrix4;
|
||||
|
||||
interface ConstantBuffer {
|
||||
function setBool(location: ConstantLocation, value: Bool): Void;
|
||||
function setInt(location: ConstantLocation, value: Int): Void;
|
||||
function setFloat(location: ConstantLocation, value: FastFloat): Void;
|
||||
function setFloat2(location: ConstantLocation, value1: FastFloat, value2: FastFloat): Void;
|
||||
function setFloat3(location: ConstantLocation, value1: FastFloat, value2: FastFloat, value3: FastFloat): Void;
|
||||
function setFloat4(location: ConstantLocation, value1: FastFloat, value2: FastFloat, value3: FastFloat, value4: FastFloat): Void;
|
||||
function setFloats(location: ConstantLocation, floats: Float32Array): Void;
|
||||
function setVector2(location: ConstantLocation, value: FastVector2): Void;
|
||||
function setVector3(location: ConstantLocation, value: FastVector3): Void;
|
||||
function setVector4(location: ConstantLocation, value: FastVector4): Void;
|
||||
function setMatrix(location: ConstantLocation, value: FastMatrix4): Void;
|
||||
function setMatrix3(location: ConstantLocation, value: FastMatrix3): Void;
|
||||
}
|
3
Kha/Sources/kha/graphics5_/ConstantLocation.hx
Normal file
3
Kha/Sources/kha/graphics5_/ConstantLocation.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef ConstantLocation = kha.graphics4.ConstantLocation;
|
3
Kha/Sources/kha/graphics5_/CubeMap.hx
Normal file
3
Kha/Sources/kha/graphics5_/CubeMap.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef CubeMap = kha.graphics4.CubeMap;
|
3
Kha/Sources/kha/graphics5_/CullMode.hx
Normal file
3
Kha/Sources/kha/graphics5_/CullMode.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef CullMode = kha.graphics4.CullMode;
|
3
Kha/Sources/kha/graphics5_/FragmentShader.hx
Normal file
3
Kha/Sources/kha/graphics5_/FragmentShader.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef FragmentShader = kha.graphics4.FragmentShader;
|
3
Kha/Sources/kha/graphics5_/GeometryShader.hx
Normal file
3
Kha/Sources/kha/graphics5_/GeometryShader.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef GeometryShader = kha.graphics4.GeometryShader;
|
14
Kha/Sources/kha/graphics5_/Graphics.hx
Normal file
14
Kha/Sources/kha/graphics5_/Graphics.hx
Normal file
@ -0,0 +1,14 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
interface Graphics {
|
||||
function begin(target: RenderTarget): Void;
|
||||
function end(): Void;
|
||||
function swapBuffers(): Void;
|
||||
#if kha_dxr
|
||||
function setAccelerationStructure(accel: AccelerationStructure): Void;
|
||||
function setRayTracePipeline(pipe: RayTracePipeline): Void;
|
||||
function setRayTraceTarget(target: RayTraceTarget): Void;
|
||||
function dispatchRays(commandList: CommandList): Void;
|
||||
function copyRayTraceTarget(commandList: CommandList, renderTarget: RenderTarget, output: RayTraceTarget): Void;
|
||||
#end
|
||||
}
|
3
Kha/Sources/kha/graphics5_/IndexBuffer.hx
Normal file
3
Kha/Sources/kha/graphics5_/IndexBuffer.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef IndexBuffer = kha.graphics4.IndexBuffer;
|
3
Kha/Sources/kha/graphics5_/MipMapFilter.hx
Normal file
3
Kha/Sources/kha/graphics5_/MipMapFilter.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef MipMapFilter = kha.graphics4.MipMapFilter;
|
3
Kha/Sources/kha/graphics5_/PipelineState.hx
Normal file
3
Kha/Sources/kha/graphics5_/PipelineState.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef PipelineState = kha.graphics4.PipelineState;
|
124
Kha/Sources/kha/graphics5_/PipelineStateBase.hx
Normal file
124
Kha/Sources/kha/graphics5_/PipelineStateBase.hx
Normal file
@ -0,0 +1,124 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
class PipelineStateBase {
|
||||
public function new() {
|
||||
inputLayout = null;
|
||||
vertexShader = null;
|
||||
fragmentShader = null;
|
||||
// geometryShader = null;
|
||||
// tessellationControlShader = null;
|
||||
// tessellationEvaluationShader = null;
|
||||
|
||||
cullMode = CullMode.None;
|
||||
|
||||
depthWrite = false;
|
||||
depthMode = CompareMode.Always;
|
||||
|
||||
stencilMode = CompareMode.Always;
|
||||
stencilBothPass = StencilAction.Keep;
|
||||
stencilDepthFail = StencilAction.Keep;
|
||||
stencilFail = StencilAction.Keep;
|
||||
stencilReferenceValue = 0;
|
||||
stencilReadMask = 0xff;
|
||||
stencilWriteMask = 0xff;
|
||||
|
||||
blendSource = BlendingFactor.BlendOne;
|
||||
blendDestination = BlendingFactor.BlendZero;
|
||||
blendOperation = BlendingOperation.Add;
|
||||
alphaBlendSource = BlendingFactor.BlendOne;
|
||||
alphaBlendDestination = BlendingFactor.BlendZero;
|
||||
alphaBlendOperation = BlendingOperation.Add;
|
||||
|
||||
colorWriteMasksRed = [];
|
||||
colorWriteMasksGreen = [];
|
||||
colorWriteMasksBlue = [];
|
||||
colorWriteMasksAlpha = [];
|
||||
for (i in 0...8)
|
||||
colorWriteMasksRed.push(true);
|
||||
for (i in 0...8)
|
||||
colorWriteMasksGreen.push(true);
|
||||
for (i in 0...8)
|
||||
colorWriteMasksBlue.push(true);
|
||||
for (i in 0...8)
|
||||
colorWriteMasksAlpha.push(true);
|
||||
|
||||
conservativeRasterization = false;
|
||||
}
|
||||
|
||||
public var inputLayout: Array<VertexStructure>;
|
||||
public var vertexShader: VertexShader;
|
||||
public var fragmentShader: FragmentShader;
|
||||
|
||||
// public var geometryShader: GeometryShader;
|
||||
// public var tessellationControlShader: TessellationControlShader;
|
||||
// public var tessellationEvaluationShader: TessellationEvaluationShader;
|
||||
public var cullMode: CullMode;
|
||||
|
||||
public var depthWrite: Bool;
|
||||
public var depthMode: CompareMode;
|
||||
|
||||
public var stencilMode: CompareMode;
|
||||
public var stencilBothPass: StencilAction;
|
||||
public var stencilDepthFail: StencilAction;
|
||||
public var stencilFail: StencilAction;
|
||||
public var stencilReferenceValue: Int;
|
||||
public var stencilReadMask: Int;
|
||||
public var stencilWriteMask: Int;
|
||||
|
||||
// One, Zero deactivates blending
|
||||
public var blendSource: BlendingFactor;
|
||||
public var blendDestination: BlendingFactor;
|
||||
public var blendOperation: BlendingOperation;
|
||||
public var alphaBlendSource: BlendingFactor;
|
||||
public var alphaBlendDestination: BlendingFactor;
|
||||
public var alphaBlendOperation: BlendingOperation;
|
||||
|
||||
public var colorWriteMask(never, set): Bool;
|
||||
public var colorWriteMaskRed(get, set): Bool;
|
||||
public var colorWriteMaskGreen(get, set): Bool;
|
||||
public var colorWriteMaskBlue(get, set): Bool;
|
||||
public var colorWriteMaskAlpha(get, set): Bool;
|
||||
|
||||
public var colorWriteMasksRed: Array<Bool>;
|
||||
public var colorWriteMasksGreen: Array<Bool>;
|
||||
public var colorWriteMasksBlue: Array<Bool>;
|
||||
public var colorWriteMasksAlpha: Array<Bool>;
|
||||
|
||||
inline function set_colorWriteMask(value: Bool): Bool {
|
||||
return colorWriteMaskRed = colorWriteMaskBlue = colorWriteMaskGreen = colorWriteMaskAlpha = value;
|
||||
}
|
||||
|
||||
inline function get_colorWriteMaskRed(): Bool {
|
||||
return colorWriteMasksRed[0];
|
||||
}
|
||||
|
||||
inline function set_colorWriteMaskRed(value: Bool): Bool {
|
||||
return colorWriteMasksRed[0] = value;
|
||||
}
|
||||
|
||||
inline function get_colorWriteMaskGreen(): Bool {
|
||||
return colorWriteMasksGreen[0];
|
||||
}
|
||||
|
||||
inline function set_colorWriteMaskGreen(value: Bool): Bool {
|
||||
return colorWriteMasksGreen[0] = value;
|
||||
}
|
||||
|
||||
inline function get_colorWriteMaskBlue(): Bool {
|
||||
return colorWriteMasksBlue[0];
|
||||
}
|
||||
|
||||
inline function set_colorWriteMaskBlue(value: Bool): Bool {
|
||||
return colorWriteMasksBlue[0] = value;
|
||||
}
|
||||
|
||||
inline function get_colorWriteMaskAlpha(): Bool {
|
||||
return colorWriteMasksAlpha[0];
|
||||
}
|
||||
|
||||
inline function set_colorWriteMaskAlpha(value: Bool): Bool {
|
||||
return colorWriteMasksAlpha[0] = value;
|
||||
}
|
||||
|
||||
public var conservativeRasterization: Bool;
|
||||
}
|
3
Kha/Sources/kha/graphics5_/RenderTarget.hx
Normal file
3
Kha/Sources/kha/graphics5_/RenderTarget.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
interface RenderTarget {}
|
3
Kha/Sources/kha/graphics5_/StencilAction.hx
Normal file
3
Kha/Sources/kha/graphics5_/StencilAction.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef StencilAction = kha.graphics4.StencilAction;
|
3
Kha/Sources/kha/graphics5_/TessellationControlShader.hx
Normal file
3
Kha/Sources/kha/graphics5_/TessellationControlShader.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef TessellationControlShader = kha.graphics4.TessellationControlShader;
|
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef TessellationEvaluationShader = kha.graphics4.TessellationEvaluationShader;
|
3
Kha/Sources/kha/graphics5_/TextureAddressing.hx
Normal file
3
Kha/Sources/kha/graphics5_/TextureAddressing.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef TextureAddressing = kha.graphics4.TextureAddressing;
|
3
Kha/Sources/kha/graphics5_/TextureFilter.hx
Normal file
3
Kha/Sources/kha/graphics5_/TextureFilter.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef TextureFilter = kha.graphics4.TextureFilter;
|
3
Kha/Sources/kha/graphics5_/TextureFormat.hx
Normal file
3
Kha/Sources/kha/graphics5_/TextureFormat.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef TextureFormat = kha.graphics4.TextureFormat;
|
3
Kha/Sources/kha/graphics5_/TextureUnit.hx
Normal file
3
Kha/Sources/kha/graphics5_/TextureUnit.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef TextureUnit = kha.graphics4.TextureUnit;
|
3
Kha/Sources/kha/graphics5_/Usage.hx
Normal file
3
Kha/Sources/kha/graphics5_/Usage.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef Usage = kha.graphics4.Usage;
|
3
Kha/Sources/kha/graphics5_/VertexBuffer.hx
Normal file
3
Kha/Sources/kha/graphics5_/VertexBuffer.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef VertexBuffer = kha.graphics4.VertexBuffer;
|
3
Kha/Sources/kha/graphics5_/VertexData.hx
Normal file
3
Kha/Sources/kha/graphics5_/VertexData.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef VertexData = kha.graphics4.VertexData;
|
3
Kha/Sources/kha/graphics5_/VertexElement.hx
Normal file
3
Kha/Sources/kha/graphics5_/VertexElement.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef VertexElement = kha.graphics4.VertexElement;
|
3
Kha/Sources/kha/graphics5_/VertexShader.hx
Normal file
3
Kha/Sources/kha/graphics5_/VertexShader.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef VertexShader = kha.graphics4.VertexShader;
|
3
Kha/Sources/kha/graphics5_/VertexStructure.hx
Normal file
3
Kha/Sources/kha/graphics5_/VertexStructure.hx
Normal file
@ -0,0 +1,3 @@
|
||||
package kha.graphics5_;
|
||||
|
||||
typedef VertexStructure = kha.graphics4.VertexStructure;
|
Reference in New Issue
Block a user