lister & profiler experimentation

This commit is contained in:
jacob 2026-03-29 18:41:22 -05:00
parent bf835cbeb7
commit c530ec16c0
4 changed files with 1876 additions and 647 deletions

View File

@ -15,6 +15,16 @@
////////////////////////////// //////////////////////////////
//- Resources //- Resources
// FIXME: Remove this
@ComputeShader V_BlaCS (128, 1)
@ComputeShader V_PrepareShadeCS (16, 16) @ComputeShader V_PrepareShadeCS (16, 16)
@ComputeShader V_PrepareCellsCS (16, 16) @ComputeShader V_PrepareCellsCS (16, 16)
@ComputeShader V_BackdropDownCS (16, 16) @ComputeShader V_BackdropDownCS (16, 16)

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,132 @@
////////////////////////////////////////////////////////////
//~ Bla samples test
// FIXME: Remove this
// FIXME: Header
// TODO: Make use of the fact that x is always scalar?
ComputeShader(V_BlaCS)
{
// FIXME: Don't use frame slot
BlaParams params = G_Deref(V_GpuConst_Frame, StructuredBuffer<BlaParams>)[0];
RWTexture2D<Vec4> bla = G_Deref(params.bla_tex, RWTexture2D<Vec4>);
i64 samples_count = params.bla_samples_count;
StructuredBuffer<BlaSample> samples = G_Deref(params.bla_samples, StructuredBuffer<BlaSample>);
Vec2 bla_pos = SV_DispatchThreadID + 0.5;
Vec2 dims = params.bla_dims;
// f32 samp_width = 10 * G_TweakFloat;
f32 samp_width = 3;
i64 sample_idx = bla_pos.x / samp_width;
if (all(bla_pos < dims) && sample_idx < samples_count)
{
// // Vec4 color = Color_Red;
// Vec4 color = Color_Black;
// color.b = bla_pos.x / dims.x;
// if (MatchFloor(bla_pos, params.cursor))
// {
// G_PrintF("bla_pos: %F, dims: %F, color: %F", G_Fmt(bla_pos), G_Fmt(dims), G_Fmt(color));
// }
// bla[bla_pos] = color;
BlaSample sample = samples[sample_idx];
// f32 ratio0 = (f32)sample.bla0 / (f32)samples_count;
// f32 ratio1 = (f32)sample.bla1 / (f32)samples_count;
f32 ratio0 = sample.r0;
f32 ratio1 = sample.r1;
f32 ratio_y = 1.0 - (bla_pos.y / dims.y);
Vec4 color = 0;
if (ratio_y < ratio0)
{
color = LinearFromSrgb(Vec4(0.82, 0, 0.933, 1));
}
else if (ratio_y < ratio0 + ratio1)
{
color = LinearFromSrgb(Vec4(0.953, 0.467, 0.208, 1));
}
else
{
color = 0;
}
bla[bla_pos] = color;
}
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Helpers //~ Helpers

View File

@ -267,6 +267,55 @@ Struct(V_Affines)
Affine tile_to_world; Affine tile_to_world;
}; };
// FIXME: Remove this
Struct(BlaSample)
{
f32 r0;
f32 r1;
};
Struct(BlaParams)
{
// FIXME: Remove this
i64 bla_samples_count;
G_BufferRef bla_samples;
Vec2 cursor;
Vec2 bla_dims;
G_TextureRef bla_tex;
};
Struct(V_SharedFrame) Struct(V_SharedFrame)
{ {
//- Time //- Time