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:
committed by
Evan Husted
parent
a1ab7fe6a2
commit
dae0f3cded
@@ -6,6 +6,14 @@ struct VertexOut {
|
||||
float4 position [[position]];
|
||||
};
|
||||
|
||||
struct ClearColor {
|
||||
float4 data;
|
||||
};
|
||||
|
||||
struct ConstantBuffers {
|
||||
constant ClearColor* clear_color;
|
||||
};
|
||||
|
||||
vertex VertexOut vertexMain(ushort vid [[vertex_id]]) {
|
||||
int low = vid & 1;
|
||||
int high = vid >> 1;
|
||||
@@ -25,6 +33,6 @@ struct FragmentOut {
|
||||
};
|
||||
|
||||
fragment FragmentOut fragmentMain(VertexOut in [[stage_in]],
|
||||
constant float4& clear_color [[buffer(0)]]) {
|
||||
return {clear_color};
|
||||
constant ConstantBuffers &constant_buffers [[buffer(20)]]) {
|
||||
return {constant_buffers.clear_color->data};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user