papyrus sgpu update

This commit is contained in:
peterino2 2025-08-14 22:08:55 -07:00
parent bec2f4d547
commit a76cccc08a
19 changed files with 2 additions and 218 deletions

View File

@ -132,6 +132,7 @@ pub fn destroy(self: *@This()) void {
self.stringArena.deinit(); self.stringArena.deinit();
self.runtime.destroy(); self.runtime.destroy();
self.drawList.deinit(); self.drawList.deinit();
self.tempDrawCommand.deinit(self.allocator);
self.allocator.destroy(self); self.allocator.destroy(self);
} }

View File

@ -35,7 +35,7 @@ struct main0_in
uint in_var_TEXCOORD3 [[user(locn3)]]; uint in_var_TEXCOORD3 [[user(locn3)]];
}; };
fragment main0_out main0(main0_in in [[stage_in]], const device type_StructuredBuffer_Scene& scene [[buffer(4294967295)]], texture2d<float> Texture0 [[texture(0)]], sampler Sampler0 [[sampler(0)]]) fragment main0_out main0(main0_in in [[stage_in]], const device type_StructuredBuffer_Scene& scene [[buffer(0)]], texture2d<float> Texture0 [[texture(0)]], sampler Sampler0 [[sampler(0)]])
{ {
main0_out out = {}; main0_out out = {};
bool _73 = in.in_var_TEXCOORD2.x < scene._m0[in.in_var_TEXCOORD3].rounding.x; bool _73 = in.in_var_TEXCOORD2.x < scene._m0[in.in_var_TEXCOORD3].rounding.x;

View File

@ -1,22 +0,0 @@
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct main0_out
{
float4 out_var_SV_Target0 [[color(0)]];
};
struct main0_in
{
float2 in_var_TEXCOORD0 [[user(locn0)]];
};
fragment main0_out main0(main0_in in [[stage_in]], texture2d<float> Texture [[texture(0)]], sampler Sampler [[sampler(0)]])
{
main0_out out = {};
out.out_var_SV_Target0 = Texture.sample(Sampler, in.in_var_TEXCOORD0);
return out;
}

View File

@ -1,41 +0,0 @@
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct Scene
{
float4x4 Model;
};
struct type_StructuredBuffer_Scene
{
Scene _m0[1];
};
struct type_Uniforms
{
float4x4 ViewProjection;
float time;
};
struct main0_out
{
float2 out_var_TEXCOORD0 [[user(locn0)]];
float4 gl_Position [[position]];
};
struct main0_in
{
float3 in_var_TEXCOORD0 [[attribute(0)]];
float2 in_var_TEXCOORD3 [[attribute(3)]];
};
vertex main0_out main0(main0_in in [[stage_in]], constant type_Uniforms& Uniforms [[buffer(0)]], const device type_StructuredBuffer_Scene& scene [[buffer(1)]], uint gl_InstanceIndex [[instance_id]])
{
main0_out out = {};
out.out_var_TEXCOORD0 = in.in_var_TEXCOORD3;
out.gl_Position = Uniforms.ViewProjection * (scene._m0[gl_InstanceIndex].Model * float4(in.in_var_TEXCOORD0, 1.0));
return out;
}

View File

@ -1,22 +0,0 @@
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct main0_out
{
float4 out_var_SV_Target0 [[color(0)]];
};
struct main0_in
{
float4 in_var_TEXCOORD0 [[user(locn0)]];
};
fragment main0_out main0(main0_in in [[stage_in]])
{
main0_out out = {};
out.out_var_SV_Target0 = in.in_var_TEXCOORD0;
return out;
}

View File

@ -1,66 +0,0 @@
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct Scene
{
float3 color;
};
struct type_StructuredBuffer_Scene
{
Scene _m0[1];
};
constant float2 _31 = {};
constant float4 _32 = {};
struct main0_out
{
float4 out_var_TEXCOORD0 [[user(locn0)]];
float4 gl_Position [[position]];
};
vertex main0_out main0(const device type_StructuredBuffer_Scene& test [[buffer(0)]], uint gl_VertexIndex [[vertex_id]])
{
main0_out out = {};
float4 _71;
float2 _72;
if (gl_VertexIndex == 0u)
{
_71 = float4(test._m0[0u].color, 1.0);
_72 = float2(-1.0);
}
else
{
float4 _69;
float2 _70;
if (gl_VertexIndex == 1u)
{
_69 = float4(test._m0[1u].color, 1.0);
_70 = float2(1.0, -1.0);
}
else
{
bool _57 = gl_VertexIndex == 2u;
float4 _66;
if (_57)
{
_66 = float4(test._m0[2u].color, 1.0);
}
else
{
_66 = _32;
}
_69 = _66;
_70 = select(_31, float2(0.0, 1.0), bool2(_57));
}
_71 = _69;
_72 = _70;
}
out.out_var_TEXCOORD0 = _71;
out.gl_Position = float4(_72, 0.0, 1.0);
return out;
}

View File

@ -1,66 +0,0 @@
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct Scene
{
float4 color;
};
struct type_StructuredBuffer_Scene
{
Scene _m0[1];
};
constant float2 _30 = {};
constant float4 _31 = {};
struct main0_out
{
float4 out_var_TEXCOORD0 [[user(locn0)]];
float4 gl_Position [[position]];
};
vertex main0_out main0(const device type_StructuredBuffer_Scene& test [[buffer(0)]], uint gl_VertexIndex [[vertex_id]])
{
main0_out out = {};
float4 _58;
float2 _59;
if (gl_VertexIndex == 0u)
{
_58 = test._m0[0u].color;
_59 = float2(-1.0);
}
else
{
float4 _56;
float2 _57;
if (gl_VertexIndex == 1u)
{
_56 = test._m0[1u].color;
_57 = float2(1.0, -1.0);
}
else
{
bool _48 = gl_VertexIndex == 2u;
float4 _53;
if (_48)
{
_53 = test._m0[2u].color;
}
else
{
_53 = _31;
}
_56 = _53;
_57 = select(_30, float2(0.0, 1.0), bool2(_48));
}
_58 = _56;
_59 = _57;
}
out.out_var_TEXCOORD0 = _58;
out.gl_Position = float4(_59, 0.0, 1.0);
return out;
}