Argument Buffers (#24)

* Stuff

* More arg buffer stuff

* Fixes

* Rebase

* Pass storage buffers to inline functions

* Fix binding

* Fix typo + Fix a couple shaders

* Enforce ids

* Dispose

* Mark used buffers as resident

* Update depth clear shader

* Fix non-contiguous struct defs

* Update ChangeBufferStride

* Fix StorageBuffer assignments

* Fix odyssey crash

* Retain buffer bindings

* Pad Std140

* Set texture data with safe buffers

* Clone buffers

* Always declare vert in

* Stop clears from breaking OpenGL games

* Fix depth clear

* Use invariant position

* Horribly inefficient texture & sampler arg buffers

* Fix missing struct access

* Minimise rebinds as much as possible

* Build arg buffers on staging buffer
This commit is contained in:
Isaac Marovitz
2024-06-25 14:25:31 +01:00
committed by Evan Husted
parent a1ab7fe6a2
commit dae0f3cded
20 changed files with 721 additions and 402 deletions

View File

@@ -11,6 +11,14 @@ struct FragmentOut {
uint stencil [[stencil]];
};
struct ClearDepth {
float data;
};
struct ConstantBuffers {
constant ClearDepth* clear_depth;
};
vertex VertexOut vertexMain(ushort vid [[vertex_id]]) {
int low = vid & 1;
int high = vid >> 1;
@@ -26,10 +34,10 @@ vertex VertexOut vertexMain(ushort vid [[vertex_id]]) {
}
fragment FragmentOut fragmentMain(VertexOut in [[stage_in]],
constant float& clear_depth [[buffer(0)]]) {
constant ConstantBuffers &constant_buffers [[buffer(20)]]) {
FragmentOut out;
out.depth = clear_depth;
out.depth = constant_buffers.clear_depth->data;
// out.stencil = stencil_clear;
return out;