2021-12-04 10:49:58 +11:00
|
|
|
struct Alloc
|
|
|
|
{
|
|
|
|
uint offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MallocResult
|
|
|
|
{
|
|
|
|
Alloc alloc;
|
|
|
|
bool failed;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct BinInstanceRef
|
|
|
|
{
|
|
|
|
uint offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct BinInstance
|
|
|
|
{
|
|
|
|
uint element_ix;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct PathRef
|
|
|
|
{
|
|
|
|
uint offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TileRef
|
|
|
|
{
|
|
|
|
uint offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Path
|
|
|
|
{
|
|
|
|
uint4 bbox;
|
|
|
|
TileRef tiles;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TileSegRef
|
|
|
|
{
|
|
|
|
uint offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Tile
|
|
|
|
{
|
|
|
|
TileSegRef tile;
|
|
|
|
int backdrop;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CmdStrokeRef
|
|
|
|
{
|
|
|
|
uint offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CmdStroke
|
|
|
|
{
|
|
|
|
uint tile_ref;
|
|
|
|
float half_width;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CmdFillRef
|
|
|
|
{
|
|
|
|
uint offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CmdFill
|
|
|
|
{
|
|
|
|
uint tile_ref;
|
|
|
|
int backdrop;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CmdColorRef
|
|
|
|
{
|
|
|
|
uint offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CmdColor
|
|
|
|
{
|
|
|
|
uint rgba_color;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CmdLinGradRef
|
|
|
|
{
|
|
|
|
uint offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CmdLinGrad
|
|
|
|
{
|
|
|
|
uint index;
|
|
|
|
float line_x;
|
|
|
|
float line_y;
|
|
|
|
float line_c;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CmdImageRef
|
|
|
|
{
|
|
|
|
uint offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CmdImage
|
|
|
|
{
|
|
|
|
uint index;
|
|
|
|
int2 offset;
|
|
|
|
};
|
|
|
|
|
2022-03-08 07:49:59 +11:00
|
|
|
struct CmdEndClipRef
|
|
|
|
{
|
|
|
|
uint offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CmdEndClip
|
|
|
|
{
|
|
|
|
uint blend;
|
|
|
|
};
|
|
|
|
|
2021-12-04 10:49:58 +11:00
|
|
|
struct CmdJumpRef
|
|
|
|
{
|
|
|
|
uint offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CmdJump
|
|
|
|
{
|
|
|
|
uint new_ref;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CmdRef
|
|
|
|
{
|
|
|
|
uint offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Config
|
|
|
|
{
|
|
|
|
uint n_elements;
|
|
|
|
uint n_pathseg;
|
|
|
|
uint width_in_tiles;
|
|
|
|
uint height_in_tiles;
|
|
|
|
Alloc tile_alloc;
|
|
|
|
Alloc bin_alloc;
|
|
|
|
Alloc ptcl_alloc;
|
|
|
|
Alloc pathseg_alloc;
|
|
|
|
Alloc anno_alloc;
|
|
|
|
Alloc trans_alloc;
|
2022-03-03 09:44:03 +11:00
|
|
|
Alloc path_bbox_alloc;
|
2021-12-04 10:49:58 +11:00
|
|
|
Alloc drawmonoid_alloc;
|
2022-02-18 11:25:41 +11:00
|
|
|
Alloc clip_alloc;
|
|
|
|
Alloc clip_bic_alloc;
|
|
|
|
Alloc clip_stack_alloc;
|
|
|
|
Alloc clip_bbox_alloc;
|
2022-03-03 09:44:03 +11:00
|
|
|
Alloc draw_bbox_alloc;
|
|
|
|
Alloc drawinfo_alloc;
|
2021-12-04 10:49:58 +11:00
|
|
|
uint n_trans;
|
|
|
|
uint n_path;
|
2022-02-18 11:25:41 +11:00
|
|
|
uint n_clip;
|
2021-12-04 10:49:58 +11:00
|
|
|
uint trans_offset;
|
|
|
|
uint linewidth_offset;
|
|
|
|
uint pathtag_offset;
|
|
|
|
uint pathseg_offset;
|
2022-03-03 09:44:03 +11:00
|
|
|
uint drawtag_offset;
|
|
|
|
uint drawdata_offset;
|
2021-12-04 10:49:58 +11:00
|
|
|
};
|
|
|
|
|
|
|
|
static const uint3 gl_WorkGroupSize = uint3(256u, 1u, 1u);
|
|
|
|
|
2022-03-03 09:44:03 +11:00
|
|
|
RWByteAddressBuffer _242 : register(u0, space0);
|
|
|
|
ByteAddressBuffer _854 : register(t1, space0);
|
|
|
|
ByteAddressBuffer _1222 : register(t2, space0);
|
2021-12-04 10:49:58 +11:00
|
|
|
|
|
|
|
static uint3 gl_WorkGroupID;
|
|
|
|
static uint3 gl_LocalInvocationID;
|
|
|
|
struct SPIRV_Cross_Input
|
|
|
|
{
|
|
|
|
uint3 gl_WorkGroupID : SV_GroupID;
|
|
|
|
uint3 gl_LocalInvocationID : SV_GroupThreadID;
|
|
|
|
};
|
|
|
|
|
|
|
|
groupshared uint sh_bitmaps[8][256];
|
|
|
|
groupshared Alloc sh_part_elements[256];
|
|
|
|
groupshared uint sh_part_count[256];
|
|
|
|
groupshared uint sh_elements[256];
|
|
|
|
groupshared uint sh_tile_stride[256];
|
|
|
|
groupshared uint sh_tile_width[256];
|
|
|
|
groupshared uint sh_tile_x0[256];
|
|
|
|
groupshared uint sh_tile_y0[256];
|
|
|
|
groupshared uint sh_tile_base[256];
|
|
|
|
groupshared uint sh_tile_count[256];
|
|
|
|
|
|
|
|
Alloc slice_mem(Alloc a, uint offset, uint size)
|
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
Alloc _319 = { a.offset + offset };
|
|
|
|
return _319;
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
bool touch_mem(Alloc alloc, uint offset)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint read_mem(Alloc alloc, uint offset)
|
|
|
|
{
|
|
|
|
Alloc param = alloc;
|
|
|
|
uint param_1 = offset;
|
|
|
|
if (!touch_mem(param, param_1))
|
|
|
|
{
|
|
|
|
return 0u;
|
|
|
|
}
|
2022-03-03 09:44:03 +11:00
|
|
|
uint v = _242.Load(offset * 4 + 8);
|
2021-12-04 10:49:58 +11:00
|
|
|
return v;
|
|
|
|
}
|
|
|
|
|
|
|
|
Alloc new_alloc(uint offset, uint size, bool mem_ok)
|
|
|
|
{
|
|
|
|
Alloc a;
|
|
|
|
a.offset = offset;
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
|
|
|
|
BinInstanceRef BinInstance_index(BinInstanceRef ref, uint index)
|
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
BinInstanceRef _328 = { ref.offset + (index * 4u) };
|
|
|
|
return _328;
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
BinInstance BinInstance_read(Alloc a, BinInstanceRef ref)
|
|
|
|
{
|
|
|
|
uint ix = ref.offset >> uint(2);
|
|
|
|
Alloc param = a;
|
|
|
|
uint param_1 = ix + 0u;
|
|
|
|
uint raw0 = read_mem(param, param_1);
|
|
|
|
BinInstance s;
|
|
|
|
s.element_ix = raw0;
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
Path Path_read(Alloc a, PathRef ref)
|
|
|
|
{
|
|
|
|
uint ix = ref.offset >> uint(2);
|
|
|
|
Alloc param = a;
|
|
|
|
uint param_1 = ix + 0u;
|
|
|
|
uint raw0 = read_mem(param, param_1);
|
|
|
|
Alloc param_2 = a;
|
|
|
|
uint param_3 = ix + 1u;
|
|
|
|
uint raw1 = read_mem(param_2, param_3);
|
|
|
|
Alloc param_4 = a;
|
|
|
|
uint param_5 = ix + 2u;
|
|
|
|
uint raw2 = read_mem(param_4, param_5);
|
|
|
|
Path s;
|
|
|
|
s.bbox = uint4(raw0 & 65535u, raw0 >> uint(16), raw1 & 65535u, raw1 >> uint(16));
|
2022-03-03 09:44:03 +11:00
|
|
|
TileRef _391 = { raw2 };
|
|
|
|
s.tiles = _391;
|
2021-12-04 10:49:58 +11:00
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
void write_tile_alloc(uint el_ix, Alloc a)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Alloc read_tile_alloc(uint el_ix, bool mem_ok)
|
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
uint _741;
|
|
|
|
_242.GetDimensions(_741);
|
|
|
|
_741 = (_741 - 8) / 4;
|
2021-12-04 10:49:58 +11:00
|
|
|
uint param = 0u;
|
2022-03-03 09:44:03 +11:00
|
|
|
uint param_1 = uint(int(_741) * 4);
|
2021-12-04 10:49:58 +11:00
|
|
|
bool param_2 = mem_ok;
|
|
|
|
return new_alloc(param, param_1, param_2);
|
|
|
|
}
|
|
|
|
|
|
|
|
Tile Tile_read(Alloc a, TileRef ref)
|
|
|
|
{
|
|
|
|
uint ix = ref.offset >> uint(2);
|
|
|
|
Alloc param = a;
|
|
|
|
uint param_1 = ix + 0u;
|
|
|
|
uint raw0 = read_mem(param, param_1);
|
|
|
|
Alloc param_2 = a;
|
|
|
|
uint param_3 = ix + 1u;
|
|
|
|
uint raw1 = read_mem(param_2, param_3);
|
2022-03-03 09:44:03 +11:00
|
|
|
TileSegRef _416 = { raw0 };
|
2021-12-04 10:49:58 +11:00
|
|
|
Tile s;
|
2022-03-03 09:44:03 +11:00
|
|
|
s.tile = _416;
|
2021-12-04 10:49:58 +11:00
|
|
|
s.backdrop = int(raw1);
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
MallocResult malloc(uint size)
|
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
uint _248;
|
|
|
|
_242.InterlockedAdd(0, size, _248);
|
|
|
|
uint offset = _248;
|
|
|
|
uint _255;
|
|
|
|
_242.GetDimensions(_255);
|
|
|
|
_255 = (_255 - 8) / 4;
|
2021-12-04 10:49:58 +11:00
|
|
|
MallocResult r;
|
2022-03-03 09:44:03 +11:00
|
|
|
r.failed = (offset + size) > uint(int(_255) * 4);
|
2021-12-04 10:49:58 +11:00
|
|
|
uint param = offset;
|
|
|
|
uint param_1 = size;
|
|
|
|
bool param_2 = !r.failed;
|
|
|
|
r.alloc = new_alloc(param, param_1, param_2);
|
|
|
|
if (r.failed)
|
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
uint _277;
|
|
|
|
_242.InterlockedMax(4, 1u, _277);
|
2021-12-04 10:49:58 +11:00
|
|
|
return r;
|
|
|
|
}
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
|
|
|
void write_mem(Alloc alloc, uint offset, uint val)
|
|
|
|
{
|
|
|
|
Alloc param = alloc;
|
|
|
|
uint param_1 = offset;
|
|
|
|
if (!touch_mem(param, param_1))
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2022-03-03 09:44:03 +11:00
|
|
|
_242.Store(offset * 4 + 8, val);
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
void CmdJump_write(Alloc a, CmdJumpRef ref, CmdJump s)
|
|
|
|
{
|
|
|
|
uint ix = ref.offset >> uint(2);
|
|
|
|
Alloc param = a;
|
|
|
|
uint param_1 = ix + 0u;
|
|
|
|
uint param_2 = s.new_ref;
|
|
|
|
write_mem(param, param_1, param_2);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Cmd_Jump_write(Alloc a, CmdRef ref, CmdJump s)
|
|
|
|
{
|
|
|
|
Alloc param = a;
|
|
|
|
uint param_1 = ref.offset >> uint(2);
|
|
|
|
uint param_2 = 10u;
|
|
|
|
write_mem(param, param_1, param_2);
|
2022-03-03 09:44:03 +11:00
|
|
|
CmdJumpRef _734 = { ref.offset + 4u };
|
2021-12-04 10:49:58 +11:00
|
|
|
Alloc param_3 = a;
|
2022-03-03 09:44:03 +11:00
|
|
|
CmdJumpRef param_4 = _734;
|
2021-12-04 10:49:58 +11:00
|
|
|
CmdJump param_5 = s;
|
|
|
|
CmdJump_write(param_3, param_4, param_5);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool alloc_cmd(inout Alloc cmd_alloc, inout CmdRef cmd_ref, inout uint cmd_limit)
|
|
|
|
{
|
|
|
|
if (cmd_ref.offset < cmd_limit)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
uint param = 1024u;
|
2022-03-03 09:44:03 +11:00
|
|
|
MallocResult _762 = malloc(param);
|
|
|
|
MallocResult new_cmd = _762;
|
2021-12-04 10:49:58 +11:00
|
|
|
if (new_cmd.failed)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2022-03-03 09:44:03 +11:00
|
|
|
CmdJump _772 = { new_cmd.alloc.offset };
|
|
|
|
CmdJump jump = _772;
|
2021-12-04 10:49:58 +11:00
|
|
|
Alloc param_1 = cmd_alloc;
|
|
|
|
CmdRef param_2 = cmd_ref;
|
|
|
|
CmdJump param_3 = jump;
|
|
|
|
Cmd_Jump_write(param_1, param_2, param_3);
|
|
|
|
cmd_alloc = new_cmd.alloc;
|
2022-03-03 09:44:03 +11:00
|
|
|
CmdRef _784 = { cmd_alloc.offset };
|
|
|
|
cmd_ref = _784;
|
2021-12-04 10:49:58 +11:00
|
|
|
cmd_limit = (cmd_alloc.offset + 1024u) - 60u;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CmdFill_write(Alloc a, CmdFillRef ref, CmdFill s)
|
|
|
|
{
|
|
|
|
uint ix = ref.offset >> uint(2);
|
|
|
|
Alloc param = a;
|
|
|
|
uint param_1 = ix + 0u;
|
|
|
|
uint param_2 = s.tile_ref;
|
|
|
|
write_mem(param, param_1, param_2);
|
|
|
|
Alloc param_3 = a;
|
|
|
|
uint param_4 = ix + 1u;
|
|
|
|
uint param_5 = uint(s.backdrop);
|
|
|
|
write_mem(param_3, param_4, param_5);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Cmd_Fill_write(Alloc a, CmdRef ref, CmdFill s)
|
|
|
|
{
|
|
|
|
Alloc param = a;
|
|
|
|
uint param_1 = ref.offset >> uint(2);
|
|
|
|
uint param_2 = 1u;
|
|
|
|
write_mem(param, param_1, param_2);
|
2022-03-03 09:44:03 +11:00
|
|
|
CmdFillRef _604 = { ref.offset + 4u };
|
2021-12-04 10:49:58 +11:00
|
|
|
Alloc param_3 = a;
|
2022-03-03 09:44:03 +11:00
|
|
|
CmdFillRef param_4 = _604;
|
2021-12-04 10:49:58 +11:00
|
|
|
CmdFill param_5 = s;
|
|
|
|
CmdFill_write(param_3, param_4, param_5);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Cmd_Solid_write(Alloc a, CmdRef ref)
|
|
|
|
{
|
|
|
|
Alloc param = a;
|
|
|
|
uint param_1 = ref.offset >> uint(2);
|
|
|
|
uint param_2 = 3u;
|
|
|
|
write_mem(param, param_1, param_2);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CmdStroke_write(Alloc a, CmdStrokeRef ref, CmdStroke s)
|
|
|
|
{
|
|
|
|
uint ix = ref.offset >> uint(2);
|
|
|
|
Alloc param = a;
|
|
|
|
uint param_1 = ix + 0u;
|
|
|
|
uint param_2 = s.tile_ref;
|
|
|
|
write_mem(param, param_1, param_2);
|
|
|
|
Alloc param_3 = a;
|
|
|
|
uint param_4 = ix + 1u;
|
|
|
|
uint param_5 = asuint(s.half_width);
|
|
|
|
write_mem(param_3, param_4, param_5);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Cmd_Stroke_write(Alloc a, CmdRef ref, CmdStroke s)
|
|
|
|
{
|
|
|
|
Alloc param = a;
|
|
|
|
uint param_1 = ref.offset >> uint(2);
|
|
|
|
uint param_2 = 2u;
|
|
|
|
write_mem(param, param_1, param_2);
|
2022-03-03 09:44:03 +11:00
|
|
|
CmdStrokeRef _622 = { ref.offset + 4u };
|
2021-12-04 10:49:58 +11:00
|
|
|
Alloc param_3 = a;
|
2022-03-03 09:44:03 +11:00
|
|
|
CmdStrokeRef param_4 = _622;
|
2021-12-04 10:49:58 +11:00
|
|
|
CmdStroke param_5 = s;
|
|
|
|
CmdStroke_write(param_3, param_4, param_5);
|
|
|
|
}
|
|
|
|
|
2022-03-03 09:44:03 +11:00
|
|
|
void write_fill(Alloc alloc, inout CmdRef cmd_ref, Tile tile, float linewidth)
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
if (linewidth < 0.0f)
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
|
|
|
if (tile.tile.offset != 0u)
|
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
CmdFill _807 = { tile.tile.offset, tile.backdrop };
|
|
|
|
CmdFill cmd_fill = _807;
|
|
|
|
Alloc param = alloc;
|
|
|
|
CmdRef param_1 = cmd_ref;
|
|
|
|
CmdFill param_2 = cmd_fill;
|
|
|
|
Cmd_Fill_write(param, param_1, param_2);
|
2021-12-04 10:49:58 +11:00
|
|
|
cmd_ref.offset += 12u;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
Alloc param_3 = alloc;
|
|
|
|
CmdRef param_4 = cmd_ref;
|
|
|
|
Cmd_Solid_write(param_3, param_4);
|
2021-12-04 10:49:58 +11:00
|
|
|
cmd_ref.offset += 4u;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
CmdStroke _837 = { tile.tile.offset, 0.5f * linewidth };
|
|
|
|
CmdStroke cmd_stroke = _837;
|
|
|
|
Alloc param_5 = alloc;
|
|
|
|
CmdRef param_6 = cmd_ref;
|
|
|
|
CmdStroke param_7 = cmd_stroke;
|
|
|
|
Cmd_Stroke_write(param_5, param_6, param_7);
|
2021-12-04 10:49:58 +11:00
|
|
|
cmd_ref.offset += 12u;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CmdColor_write(Alloc a, CmdColorRef ref, CmdColor s)
|
|
|
|
{
|
|
|
|
uint ix = ref.offset >> uint(2);
|
|
|
|
Alloc param = a;
|
|
|
|
uint param_1 = ix + 0u;
|
|
|
|
uint param_2 = s.rgba_color;
|
|
|
|
write_mem(param, param_1, param_2);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Cmd_Color_write(Alloc a, CmdRef ref, CmdColor s)
|
|
|
|
{
|
|
|
|
Alloc param = a;
|
|
|
|
uint param_1 = ref.offset >> uint(2);
|
|
|
|
uint param_2 = 5u;
|
|
|
|
write_mem(param, param_1, param_2);
|
2022-03-03 09:44:03 +11:00
|
|
|
CmdColorRef _649 = { ref.offset + 4u };
|
2021-12-04 10:49:58 +11:00
|
|
|
Alloc param_3 = a;
|
2022-03-03 09:44:03 +11:00
|
|
|
CmdColorRef param_4 = _649;
|
2021-12-04 10:49:58 +11:00
|
|
|
CmdColor param_5 = s;
|
|
|
|
CmdColor_write(param_3, param_4, param_5);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CmdLinGrad_write(Alloc a, CmdLinGradRef ref, CmdLinGrad s)
|
|
|
|
{
|
|
|
|
uint ix = ref.offset >> uint(2);
|
|
|
|
Alloc param = a;
|
|
|
|
uint param_1 = ix + 0u;
|
|
|
|
uint param_2 = s.index;
|
|
|
|
write_mem(param, param_1, param_2);
|
|
|
|
Alloc param_3 = a;
|
|
|
|
uint param_4 = ix + 1u;
|
|
|
|
uint param_5 = asuint(s.line_x);
|
|
|
|
write_mem(param_3, param_4, param_5);
|
|
|
|
Alloc param_6 = a;
|
|
|
|
uint param_7 = ix + 2u;
|
|
|
|
uint param_8 = asuint(s.line_y);
|
|
|
|
write_mem(param_6, param_7, param_8);
|
|
|
|
Alloc param_9 = a;
|
|
|
|
uint param_10 = ix + 3u;
|
|
|
|
uint param_11 = asuint(s.line_c);
|
|
|
|
write_mem(param_9, param_10, param_11);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Cmd_LinGrad_write(Alloc a, CmdRef ref, CmdLinGrad s)
|
|
|
|
{
|
|
|
|
Alloc param = a;
|
|
|
|
uint param_1 = ref.offset >> uint(2);
|
|
|
|
uint param_2 = 6u;
|
|
|
|
write_mem(param, param_1, param_2);
|
2022-03-03 09:44:03 +11:00
|
|
|
CmdLinGradRef _668 = { ref.offset + 4u };
|
2021-12-04 10:49:58 +11:00
|
|
|
Alloc param_3 = a;
|
2022-03-03 09:44:03 +11:00
|
|
|
CmdLinGradRef param_4 = _668;
|
2021-12-04 10:49:58 +11:00
|
|
|
CmdLinGrad param_5 = s;
|
|
|
|
CmdLinGrad_write(param_3, param_4, param_5);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CmdImage_write(Alloc a, CmdImageRef ref, CmdImage s)
|
|
|
|
{
|
|
|
|
uint ix = ref.offset >> uint(2);
|
|
|
|
Alloc param = a;
|
|
|
|
uint param_1 = ix + 0u;
|
|
|
|
uint param_2 = s.index;
|
|
|
|
write_mem(param, param_1, param_2);
|
|
|
|
Alloc param_3 = a;
|
|
|
|
uint param_4 = ix + 1u;
|
|
|
|
uint param_5 = (uint(s.offset.x) & 65535u) | (uint(s.offset.y) << uint(16));
|
|
|
|
write_mem(param_3, param_4, param_5);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Cmd_Image_write(Alloc a, CmdRef ref, CmdImage s)
|
|
|
|
{
|
|
|
|
Alloc param = a;
|
|
|
|
uint param_1 = ref.offset >> uint(2);
|
|
|
|
uint param_2 = 7u;
|
|
|
|
write_mem(param, param_1, param_2);
|
2022-03-03 09:44:03 +11:00
|
|
|
CmdImageRef _687 = { ref.offset + 4u };
|
2021-12-04 10:49:58 +11:00
|
|
|
Alloc param_3 = a;
|
2022-03-03 09:44:03 +11:00
|
|
|
CmdImageRef param_4 = _687;
|
2021-12-04 10:49:58 +11:00
|
|
|
CmdImage param_5 = s;
|
|
|
|
CmdImage_write(param_3, param_4, param_5);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Cmd_BeginClip_write(Alloc a, CmdRef ref)
|
|
|
|
{
|
|
|
|
Alloc param = a;
|
|
|
|
uint param_1 = ref.offset >> uint(2);
|
|
|
|
uint param_2 = 8u;
|
|
|
|
write_mem(param, param_1, param_2);
|
|
|
|
}
|
|
|
|
|
2022-03-08 07:49:59 +11:00
|
|
|
void CmdEndClip_write(Alloc a, CmdEndClipRef ref, CmdEndClip s)
|
|
|
|
{
|
|
|
|
uint ix = ref.offset >> uint(2);
|
|
|
|
Alloc param = a;
|
|
|
|
uint param_1 = ix + 0u;
|
|
|
|
uint param_2 = s.blend;
|
|
|
|
write_mem(param, param_1, param_2);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Cmd_EndClip_write(Alloc a, CmdRef ref, CmdEndClip s)
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
|
|
|
Alloc param = a;
|
|
|
|
uint param_1 = ref.offset >> uint(2);
|
|
|
|
uint param_2 = 9u;
|
|
|
|
write_mem(param, param_1, param_2);
|
2022-03-03 09:44:03 +11:00
|
|
|
CmdEndClipRef _715 = { ref.offset + 4u };
|
2022-03-08 07:49:59 +11:00
|
|
|
Alloc param_3 = a;
|
2022-03-03 09:44:03 +11:00
|
|
|
CmdEndClipRef param_4 = _715;
|
2022-03-08 07:49:59 +11:00
|
|
|
CmdEndClip param_5 = s;
|
|
|
|
CmdEndClip_write(param_3, param_4, param_5);
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
void Cmd_End_write(Alloc a, CmdRef ref)
|
|
|
|
{
|
|
|
|
Alloc param = a;
|
|
|
|
uint param_1 = ref.offset >> uint(2);
|
|
|
|
uint param_2 = 0u;
|
|
|
|
write_mem(param, param_1, param_2);
|
|
|
|
}
|
|
|
|
|
|
|
|
void comp_main()
|
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
uint width_in_bins = ((_854.Load(8) + 16u) - 1u) / 16u;
|
2021-12-04 10:49:58 +11:00
|
|
|
uint bin_ix = (width_in_bins * gl_WorkGroupID.y) + gl_WorkGroupID.x;
|
|
|
|
uint partition_ix = 0u;
|
2022-03-03 09:44:03 +11:00
|
|
|
uint n_partitions = ((_854.Load(0) + 256u) - 1u) / 256u;
|
2021-12-04 10:49:58 +11:00
|
|
|
uint th_ix = gl_LocalInvocationID.x;
|
|
|
|
uint bin_tile_x = 16u * gl_WorkGroupID.x;
|
|
|
|
uint bin_tile_y = 16u * gl_WorkGroupID.y;
|
|
|
|
uint tile_x = gl_LocalInvocationID.x % 16u;
|
|
|
|
uint tile_y = gl_LocalInvocationID.x / 16u;
|
2022-03-03 09:44:03 +11:00
|
|
|
uint this_tile_ix = (((bin_tile_y + tile_y) * _854.Load(8)) + bin_tile_x) + tile_x;
|
|
|
|
Alloc _919;
|
|
|
|
_919.offset = _854.Load(24);
|
2021-12-04 10:49:58 +11:00
|
|
|
Alloc param;
|
2022-03-03 09:44:03 +11:00
|
|
|
param.offset = _919.offset;
|
2021-12-04 10:49:58 +11:00
|
|
|
uint param_1 = this_tile_ix * 1024u;
|
|
|
|
uint param_2 = 1024u;
|
|
|
|
Alloc cmd_alloc = slice_mem(param, param_1, param_2);
|
2022-03-03 09:44:03 +11:00
|
|
|
CmdRef _928 = { cmd_alloc.offset };
|
|
|
|
CmdRef cmd_ref = _928;
|
2021-12-04 10:49:58 +11:00
|
|
|
uint cmd_limit = (cmd_ref.offset + 1024u) - 60u;
|
|
|
|
uint clip_depth = 0u;
|
|
|
|
uint clip_zero_depth = 0u;
|
|
|
|
uint rd_ix = 0u;
|
|
|
|
uint wr_ix = 0u;
|
|
|
|
uint part_start_ix = 0u;
|
|
|
|
uint ready_ix = 0u;
|
2022-03-03 09:44:03 +11:00
|
|
|
uint drawmonoid_start = _854.Load(44) >> uint(2);
|
|
|
|
uint drawtag_start = _854.Load(100) >> uint(2);
|
|
|
|
uint drawdata_start = _854.Load(104) >> uint(2);
|
|
|
|
uint drawinfo_start = _854.Load(68) >> uint(2);
|
|
|
|
bool mem_ok = _242.Load(4) == 0u;
|
2021-12-04 10:49:58 +11:00
|
|
|
Alloc param_3;
|
|
|
|
Alloc param_5;
|
2022-03-03 09:44:03 +11:00
|
|
|
uint _1154;
|
2021-12-04 10:49:58 +11:00
|
|
|
uint element_ix;
|
|
|
|
Alloc param_14;
|
|
|
|
uint tile_count;
|
2022-03-17 08:40:58 +11:00
|
|
|
uint _1455;
|
2022-03-03 09:44:03 +11:00
|
|
|
float linewidth;
|
2021-12-04 10:49:58 +11:00
|
|
|
CmdLinGrad cmd_lin;
|
|
|
|
while (true)
|
|
|
|
{
|
|
|
|
for (uint i = 0u; i < 8u; i++)
|
|
|
|
{
|
|
|
|
sh_bitmaps[i][th_ix] = 0u;
|
|
|
|
}
|
2022-03-03 09:44:03 +11:00
|
|
|
bool _1206;
|
2021-12-04 10:49:58 +11:00
|
|
|
for (;;)
|
|
|
|
{
|
|
|
|
if ((ready_ix == wr_ix) && (partition_ix < n_partitions))
|
|
|
|
{
|
|
|
|
part_start_ix = ready_ix;
|
|
|
|
uint count = 0u;
|
2022-03-03 09:44:03 +11:00
|
|
|
bool _1003 = th_ix < 256u;
|
|
|
|
bool _1011;
|
|
|
|
if (_1003)
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
_1011 = (partition_ix + th_ix) < n_partitions;
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
_1011 = _1003;
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
2022-03-03 09:44:03 +11:00
|
|
|
if (_1011)
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
uint in_ix = (_854.Load(20) >> uint(2)) + ((((partition_ix + th_ix) * 256u) + bin_ix) * 2u);
|
|
|
|
Alloc _1029;
|
|
|
|
_1029.offset = _854.Load(20);
|
|
|
|
param_3.offset = _1029.offset;
|
2021-12-04 10:49:58 +11:00
|
|
|
uint param_4 = in_ix;
|
|
|
|
count = read_mem(param_3, param_4);
|
2022-03-03 09:44:03 +11:00
|
|
|
Alloc _1040;
|
|
|
|
_1040.offset = _854.Load(20);
|
|
|
|
param_5.offset = _1040.offset;
|
2021-12-04 10:49:58 +11:00
|
|
|
uint param_6 = in_ix + 1u;
|
|
|
|
uint offset = read_mem(param_5, param_6);
|
|
|
|
uint param_7 = offset;
|
|
|
|
uint param_8 = count * 4u;
|
|
|
|
bool param_9 = mem_ok;
|
|
|
|
sh_part_elements[th_ix] = new_alloc(param_7, param_8, param_9);
|
|
|
|
}
|
|
|
|
for (uint i_1 = 0u; i_1 < 8u; i_1++)
|
|
|
|
{
|
|
|
|
if (th_ix < 256u)
|
|
|
|
{
|
|
|
|
sh_part_count[th_ix] = count;
|
|
|
|
}
|
|
|
|
GroupMemoryBarrierWithGroupSync();
|
|
|
|
if (th_ix < 256u)
|
|
|
|
{
|
|
|
|
if (th_ix >= (1u << i_1))
|
|
|
|
{
|
|
|
|
count += sh_part_count[th_ix - (1u << i_1)];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GroupMemoryBarrierWithGroupSync();
|
|
|
|
}
|
|
|
|
if (th_ix < 256u)
|
|
|
|
{
|
|
|
|
sh_part_count[th_ix] = part_start_ix + count;
|
|
|
|
}
|
|
|
|
GroupMemoryBarrierWithGroupSync();
|
|
|
|
ready_ix = sh_part_count[255];
|
|
|
|
partition_ix += 256u;
|
|
|
|
}
|
|
|
|
uint ix = rd_ix + th_ix;
|
|
|
|
if (((ix >= wr_ix) && (ix < ready_ix)) && mem_ok)
|
|
|
|
{
|
|
|
|
uint part_ix = 0u;
|
|
|
|
for (uint i_2 = 0u; i_2 < 8u; i_2++)
|
|
|
|
{
|
|
|
|
uint probe = part_ix + (128u >> i_2);
|
|
|
|
if (ix >= sh_part_count[probe - 1u])
|
|
|
|
{
|
|
|
|
part_ix = probe;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (part_ix > 0u)
|
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
_1154 = sh_part_count[part_ix - 1u];
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
_1154 = part_start_ix;
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
2022-03-03 09:44:03 +11:00
|
|
|
ix -= _1154;
|
2021-12-04 10:49:58 +11:00
|
|
|
Alloc bin_alloc = sh_part_elements[part_ix];
|
2022-03-03 09:44:03 +11:00
|
|
|
BinInstanceRef _1173 = { bin_alloc.offset };
|
|
|
|
BinInstanceRef inst_ref = _1173;
|
2021-12-04 10:49:58 +11:00
|
|
|
BinInstanceRef param_10 = inst_ref;
|
|
|
|
uint param_11 = ix;
|
|
|
|
Alloc param_12 = bin_alloc;
|
|
|
|
BinInstanceRef param_13 = BinInstance_index(param_10, param_11);
|
|
|
|
BinInstance inst = BinInstance_read(param_12, param_13);
|
|
|
|
sh_elements[th_ix] = inst.element_ix;
|
|
|
|
}
|
|
|
|
GroupMemoryBarrierWithGroupSync();
|
|
|
|
wr_ix = min((rd_ix + 256u), ready_ix);
|
2022-03-03 09:44:03 +11:00
|
|
|
bool _1196 = (wr_ix - rd_ix) < 256u;
|
|
|
|
if (_1196)
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
_1206 = (wr_ix < ready_ix) || (partition_ix < n_partitions);
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
_1206 = _1196;
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
2022-03-03 09:44:03 +11:00
|
|
|
if (_1206)
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
uint tag = 0u;
|
|
|
|
if ((th_ix + rd_ix) < wr_ix)
|
|
|
|
{
|
|
|
|
element_ix = sh_elements[th_ix];
|
2022-03-03 09:44:03 +11:00
|
|
|
tag = _1222.Load((drawtag_start + element_ix) * 4 + 0);
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
|
|
|
switch (tag)
|
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
case 68u:
|
|
|
|
case 72u:
|
|
|
|
case 276u:
|
2021-12-04 10:49:58 +11:00
|
|
|
case 5u:
|
2022-03-03 09:44:03 +11:00
|
|
|
case 37u:
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
uint drawmonoid_base = drawmonoid_start + (4u * element_ix);
|
|
|
|
uint path_ix = _242.Load(drawmonoid_base * 4 + 8);
|
|
|
|
PathRef _1247 = { _854.Load(16) + (path_ix * 12u) };
|
|
|
|
Alloc _1250;
|
|
|
|
_1250.offset = _854.Load(16);
|
|
|
|
param_14.offset = _1250.offset;
|
|
|
|
PathRef param_15 = _1247;
|
|
|
|
Path path = Path_read(param_14, param_15);
|
2021-12-04 10:49:58 +11:00
|
|
|
uint stride = path.bbox.z - path.bbox.x;
|
|
|
|
sh_tile_stride[th_ix] = stride;
|
|
|
|
int dx = int(path.bbox.x) - int(bin_tile_x);
|
|
|
|
int dy = int(path.bbox.y) - int(bin_tile_y);
|
|
|
|
int x0 = clamp(dx, 0, 16);
|
|
|
|
int y0 = clamp(dy, 0, 16);
|
|
|
|
int x1 = clamp(int(path.bbox.z) - int(bin_tile_x), 0, 16);
|
|
|
|
int y1 = clamp(int(path.bbox.w) - int(bin_tile_y), 0, 16);
|
|
|
|
sh_tile_width[th_ix] = uint(x1 - x0);
|
|
|
|
sh_tile_x0[th_ix] = uint(x0);
|
|
|
|
sh_tile_y0[th_ix] = uint(y0);
|
|
|
|
tile_count = uint(x1 - x0) * uint(y1 - y0);
|
|
|
|
uint base = path.tiles.offset - (((uint(dy) * stride) + uint(dx)) * 8u);
|
|
|
|
sh_tile_base[th_ix] = base;
|
2022-03-03 09:44:03 +11:00
|
|
|
uint param_16 = path.tiles.offset;
|
|
|
|
uint param_17 = ((path.bbox.z - path.bbox.x) * (path.bbox.w - path.bbox.y)) * 8u;
|
|
|
|
bool param_18 = mem_ok;
|
|
|
|
Alloc path_alloc = new_alloc(param_16, param_17, param_18);
|
|
|
|
uint param_19 = th_ix;
|
|
|
|
Alloc param_20 = path_alloc;
|
|
|
|
write_tile_alloc(param_19, param_20);
|
2021-12-04 10:49:58 +11:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
tile_count = 0u;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sh_tile_count[th_ix] = tile_count;
|
|
|
|
for (uint i_3 = 0u; i_3 < 8u; i_3++)
|
|
|
|
{
|
|
|
|
GroupMemoryBarrierWithGroupSync();
|
|
|
|
if (th_ix >= (1u << i_3))
|
|
|
|
{
|
|
|
|
tile_count += sh_tile_count[th_ix - (1u << i_3)];
|
|
|
|
}
|
|
|
|
GroupMemoryBarrierWithGroupSync();
|
|
|
|
sh_tile_count[th_ix] = tile_count;
|
|
|
|
}
|
|
|
|
GroupMemoryBarrierWithGroupSync();
|
|
|
|
uint total_tile_count = sh_tile_count[255];
|
|
|
|
for (uint ix_1 = th_ix; ix_1 < total_tile_count; ix_1 += 256u)
|
|
|
|
{
|
|
|
|
uint el_ix = 0u;
|
|
|
|
for (uint i_4 = 0u; i_4 < 8u; i_4++)
|
|
|
|
{
|
|
|
|
uint probe_1 = el_ix + (128u >> i_4);
|
|
|
|
if (ix_1 >= sh_tile_count[probe_1 - 1u])
|
|
|
|
{
|
|
|
|
el_ix = probe_1;
|
|
|
|
}
|
|
|
|
}
|
2022-03-17 08:40:58 +11:00
|
|
|
uint element_ix_1 = sh_elements[el_ix];
|
|
|
|
uint tag_1 = _1222.Load((drawtag_start + element_ix_1) * 4 + 0);
|
2021-12-04 10:49:58 +11:00
|
|
|
if (el_ix > 0u)
|
|
|
|
{
|
2022-03-17 08:40:58 +11:00
|
|
|
_1455 = sh_tile_count[el_ix - 1u];
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-03-17 08:40:58 +11:00
|
|
|
_1455 = 0u;
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
2022-03-17 08:40:58 +11:00
|
|
|
uint seq_ix = ix_1 - _1455;
|
2021-12-04 10:49:58 +11:00
|
|
|
uint width = sh_tile_width[el_ix];
|
|
|
|
uint x = sh_tile_x0[el_ix] + (seq_ix % width);
|
|
|
|
uint y = sh_tile_y0[el_ix] + (seq_ix / width);
|
|
|
|
bool include_tile = false;
|
2022-02-18 11:25:41 +11:00
|
|
|
if (mem_ok)
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
uint param_21 = el_ix;
|
|
|
|
bool param_22 = mem_ok;
|
2022-03-17 08:40:58 +11:00
|
|
|
TileRef _1507 = { sh_tile_base[el_ix] + (((sh_tile_stride[el_ix] * y) + x) * 8u) };
|
2022-03-03 09:44:03 +11:00
|
|
|
Alloc param_23 = read_tile_alloc(param_21, param_22);
|
2022-03-17 08:40:58 +11:00
|
|
|
TileRef param_24 = _1507;
|
2022-03-03 09:44:03 +11:00
|
|
|
Tile tile = Tile_read(param_23, param_24);
|
|
|
|
bool is_clip = (tag_1 & 1u) != 0u;
|
|
|
|
bool is_blend = false;
|
2022-03-17 08:40:58 +11:00
|
|
|
if (is_clip)
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
2022-03-17 08:40:58 +11:00
|
|
|
uint drawmonoid_base_1 = drawmonoid_start + (4u * element_ix_1);
|
|
|
|
uint scene_offset = _242.Load((drawmonoid_base_1 + 2u) * 4 + 8);
|
|
|
|
uint dd = drawdata_start + (scene_offset >> uint(2));
|
|
|
|
uint blend = _1222.Load(dd * 4 + 0);
|
|
|
|
is_blend = blend != 3u;
|
|
|
|
}
|
|
|
|
bool _1542 = tile.tile.offset != 0u;
|
|
|
|
bool _1551;
|
|
|
|
if (!_1542)
|
|
|
|
{
|
|
|
|
_1551 = (tile.backdrop == 0) == is_clip;
|
2022-02-18 11:25:41 +11:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-03-17 08:40:58 +11:00
|
|
|
_1551 = _1542;
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
2022-03-31 01:27:29 +11:00
|
|
|
include_tile = _1551 || is_blend;
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
|
|
|
if (include_tile)
|
|
|
|
{
|
|
|
|
uint el_slice = el_ix / 32u;
|
|
|
|
uint el_mask = 1u << (el_ix & 31u);
|
2022-03-31 01:27:29 +11:00
|
|
|
uint _1573;
|
|
|
|
InterlockedOr(sh_bitmaps[el_slice][(y * 16u) + x], el_mask, _1573);
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
GroupMemoryBarrierWithGroupSync();
|
|
|
|
uint slice_ix = 0u;
|
|
|
|
uint bitmap = sh_bitmaps[0][th_ix];
|
|
|
|
while (mem_ok)
|
|
|
|
{
|
|
|
|
if (bitmap == 0u)
|
|
|
|
{
|
|
|
|
slice_ix++;
|
|
|
|
if (slice_ix == 8u)
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
bitmap = sh_bitmaps[slice_ix][th_ix];
|
|
|
|
if (bitmap == 0u)
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
uint element_ref_ix = (slice_ix * 32u) + uint(int(firstbitlow(bitmap)));
|
2022-03-17 08:40:58 +11:00
|
|
|
uint element_ix_2 = sh_elements[element_ref_ix];
|
2021-12-04 10:49:58 +11:00
|
|
|
bitmap &= (bitmap - 1u);
|
2022-03-17 08:40:58 +11:00
|
|
|
uint drawtag = _1222.Load((drawtag_start + element_ix_2) * 4 + 0);
|
2021-12-04 10:49:58 +11:00
|
|
|
if (clip_zero_depth == 0u)
|
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
uint param_25 = element_ref_ix;
|
|
|
|
bool param_26 = mem_ok;
|
2022-03-31 01:27:29 +11:00
|
|
|
TileRef _1650 = { sh_tile_base[element_ref_ix] + (((sh_tile_stride[element_ref_ix] * tile_y) + tile_x) * 8u) };
|
2022-03-03 09:44:03 +11:00
|
|
|
Alloc param_27 = read_tile_alloc(param_25, param_26);
|
2022-03-31 01:27:29 +11:00
|
|
|
TileRef param_28 = _1650;
|
2022-03-03 09:44:03 +11:00
|
|
|
Tile tile_1 = Tile_read(param_27, param_28);
|
2022-03-17 08:40:58 +11:00
|
|
|
uint drawmonoid_base_2 = drawmonoid_start + (4u * element_ix_2);
|
|
|
|
uint scene_offset_1 = _242.Load((drawmonoid_base_2 + 2u) * 4 + 8);
|
|
|
|
uint info_offset = _242.Load((drawmonoid_base_2 + 3u) * 4 + 8);
|
|
|
|
uint dd_1 = drawdata_start + (scene_offset_1 >> uint(2));
|
2022-03-03 09:44:03 +11:00
|
|
|
uint di = drawinfo_start + (info_offset >> uint(2));
|
|
|
|
switch (drawtag)
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
case 68u:
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
linewidth = asfloat(_242.Load(di * 4 + 8));
|
|
|
|
Alloc param_29 = cmd_alloc;
|
|
|
|
CmdRef param_30 = cmd_ref;
|
|
|
|
uint param_31 = cmd_limit;
|
2022-03-31 01:27:29 +11:00
|
|
|
bool _1697 = alloc_cmd(param_29, param_30, param_31);
|
2022-03-03 09:44:03 +11:00
|
|
|
cmd_alloc = param_29;
|
|
|
|
cmd_ref = param_30;
|
|
|
|
cmd_limit = param_31;
|
2022-03-31 01:27:29 +11:00
|
|
|
if (!_1697)
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
2022-03-03 09:44:03 +11:00
|
|
|
Alloc param_32 = cmd_alloc;
|
|
|
|
CmdRef param_33 = cmd_ref;
|
|
|
|
Tile param_34 = tile_1;
|
|
|
|
float param_35 = linewidth;
|
|
|
|
write_fill(param_32, param_33, param_34, param_35);
|
|
|
|
cmd_ref = param_33;
|
2022-03-17 08:40:58 +11:00
|
|
|
uint rgba = _1222.Load(dd_1 * 4 + 0);
|
2022-03-31 01:27:29 +11:00
|
|
|
CmdColor _1720 = { rgba };
|
2022-03-03 09:44:03 +11:00
|
|
|
Alloc param_36 = cmd_alloc;
|
|
|
|
CmdRef param_37 = cmd_ref;
|
2022-03-31 01:27:29 +11:00
|
|
|
CmdColor param_38 = _1720;
|
2022-03-03 09:44:03 +11:00
|
|
|
Cmd_Color_write(param_36, param_37, param_38);
|
2021-12-04 10:49:58 +11:00
|
|
|
cmd_ref.offset += 8u;
|
|
|
|
break;
|
|
|
|
}
|
2022-03-03 09:44:03 +11:00
|
|
|
case 276u:
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
Alloc param_39 = cmd_alloc;
|
|
|
|
CmdRef param_40 = cmd_ref;
|
|
|
|
uint param_41 = cmd_limit;
|
2022-03-31 01:27:29 +11:00
|
|
|
bool _1738 = alloc_cmd(param_39, param_40, param_41);
|
2022-03-03 09:44:03 +11:00
|
|
|
cmd_alloc = param_39;
|
|
|
|
cmd_ref = param_40;
|
|
|
|
cmd_limit = param_41;
|
2022-03-31 01:27:29 +11:00
|
|
|
if (!_1738)
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
2022-03-03 09:44:03 +11:00
|
|
|
linewidth = asfloat(_242.Load(di * 4 + 8));
|
|
|
|
Alloc param_42 = cmd_alloc;
|
|
|
|
CmdRef param_43 = cmd_ref;
|
|
|
|
Tile param_44 = tile_1;
|
|
|
|
float param_45 = linewidth;
|
|
|
|
write_fill(param_42, param_43, param_44, param_45);
|
|
|
|
cmd_ref = param_43;
|
2022-03-17 08:40:58 +11:00
|
|
|
cmd_lin.index = _1222.Load(dd_1 * 4 + 0);
|
2022-03-03 09:44:03 +11:00
|
|
|
cmd_lin.line_x = asfloat(_242.Load((di + 1u) * 4 + 8));
|
|
|
|
cmd_lin.line_y = asfloat(_242.Load((di + 2u) * 4 + 8));
|
|
|
|
cmd_lin.line_c = asfloat(_242.Load((di + 3u) * 4 + 8));
|
|
|
|
Alloc param_46 = cmd_alloc;
|
|
|
|
CmdRef param_47 = cmd_ref;
|
|
|
|
CmdLinGrad param_48 = cmd_lin;
|
|
|
|
Cmd_LinGrad_write(param_46, param_47, param_48);
|
2021-12-04 10:49:58 +11:00
|
|
|
cmd_ref.offset += 20u;
|
|
|
|
break;
|
|
|
|
}
|
2022-03-03 09:44:03 +11:00
|
|
|
case 72u:
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
linewidth = asfloat(_242.Load(di * 4 + 8));
|
|
|
|
Alloc param_49 = cmd_alloc;
|
|
|
|
CmdRef param_50 = cmd_ref;
|
|
|
|
uint param_51 = cmd_limit;
|
2022-03-31 01:27:29 +11:00
|
|
|
bool _1806 = alloc_cmd(param_49, param_50, param_51);
|
2022-03-03 09:44:03 +11:00
|
|
|
cmd_alloc = param_49;
|
|
|
|
cmd_ref = param_50;
|
|
|
|
cmd_limit = param_51;
|
2022-03-31 01:27:29 +11:00
|
|
|
if (!_1806)
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
2022-03-03 09:44:03 +11:00
|
|
|
Alloc param_52 = cmd_alloc;
|
|
|
|
CmdRef param_53 = cmd_ref;
|
|
|
|
Tile param_54 = tile_1;
|
|
|
|
float param_55 = linewidth;
|
|
|
|
write_fill(param_52, param_53, param_54, param_55);
|
|
|
|
cmd_ref = param_53;
|
2022-03-17 08:40:58 +11:00
|
|
|
uint index = _1222.Load(dd_1 * 4 + 0);
|
|
|
|
uint raw1 = _1222.Load((dd_1 + 1u) * 4 + 0);
|
2022-03-03 09:44:03 +11:00
|
|
|
int2 offset_1 = int2(int(raw1 << uint(16)) >> 16, int(raw1) >> 16);
|
2022-03-31 01:27:29 +11:00
|
|
|
CmdImage _1845 = { index, offset_1 };
|
2022-03-03 09:44:03 +11:00
|
|
|
Alloc param_56 = cmd_alloc;
|
|
|
|
CmdRef param_57 = cmd_ref;
|
2022-03-31 01:27:29 +11:00
|
|
|
CmdImage param_58 = _1845;
|
2022-03-03 09:44:03 +11:00
|
|
|
Cmd_Image_write(param_56, param_57, param_58);
|
2021-12-04 10:49:58 +11:00
|
|
|
cmd_ref.offset += 12u;
|
|
|
|
break;
|
|
|
|
}
|
2022-03-03 09:44:03 +11:00
|
|
|
case 5u:
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
2022-03-31 01:27:29 +11:00
|
|
|
bool _1859 = tile_1.tile.offset == 0u;
|
|
|
|
bool _1865;
|
|
|
|
if (_1859)
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
2022-03-31 01:27:29 +11:00
|
|
|
_1865 = tile_1.backdrop == 0;
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-03-31 01:27:29 +11:00
|
|
|
_1865 = _1859;
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
2022-03-31 01:27:29 +11:00
|
|
|
if (_1865)
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
|
|
|
clip_zero_depth = clip_depth + 1u;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
Alloc param_59 = cmd_alloc;
|
|
|
|
CmdRef param_60 = cmd_ref;
|
|
|
|
uint param_61 = cmd_limit;
|
2022-03-31 01:27:29 +11:00
|
|
|
bool _1877 = alloc_cmd(param_59, param_60, param_61);
|
2022-03-03 09:44:03 +11:00
|
|
|
cmd_alloc = param_59;
|
|
|
|
cmd_ref = param_60;
|
|
|
|
cmd_limit = param_61;
|
2022-03-31 01:27:29 +11:00
|
|
|
if (!_1877)
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
2022-02-18 11:25:41 +11:00
|
|
|
break;
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
2022-03-03 09:44:03 +11:00
|
|
|
Alloc param_62 = cmd_alloc;
|
|
|
|
CmdRef param_63 = cmd_ref;
|
|
|
|
Cmd_BeginClip_write(param_62, param_63);
|
2022-02-18 11:25:41 +11:00
|
|
|
cmd_ref.offset += 4u;
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
|
|
|
clip_depth++;
|
|
|
|
break;
|
|
|
|
}
|
2022-03-03 09:44:03 +11:00
|
|
|
case 37u:
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
|
|
|
clip_depth--;
|
2022-03-03 09:44:03 +11:00
|
|
|
Alloc param_64 = cmd_alloc;
|
|
|
|
CmdRef param_65 = cmd_ref;
|
|
|
|
uint param_66 = cmd_limit;
|
2022-03-31 01:27:29 +11:00
|
|
|
bool _1905 = alloc_cmd(param_64, param_65, param_66);
|
2022-03-03 09:44:03 +11:00
|
|
|
cmd_alloc = param_64;
|
|
|
|
cmd_ref = param_65;
|
|
|
|
cmd_limit = param_66;
|
2022-03-31 01:27:29 +11:00
|
|
|
if (!_1905)
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
2022-02-18 11:25:41 +11:00
|
|
|
break;
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
2022-03-03 09:44:03 +11:00
|
|
|
Alloc param_67 = cmd_alloc;
|
|
|
|
CmdRef param_68 = cmd_ref;
|
|
|
|
Tile param_69 = tile_1;
|
|
|
|
float param_70 = -1.0f;
|
|
|
|
write_fill(param_67, param_68, param_69, param_70);
|
|
|
|
cmd_ref = param_68;
|
2022-03-17 08:40:58 +11:00
|
|
|
uint blend_1 = _1222.Load(dd_1 * 4 + 0);
|
2022-03-31 01:27:29 +11:00
|
|
|
CmdEndClip _1928 = { blend_1 };
|
2022-03-03 09:44:03 +11:00
|
|
|
Alloc param_71 = cmd_alloc;
|
|
|
|
CmdRef param_72 = cmd_ref;
|
2022-03-31 01:27:29 +11:00
|
|
|
CmdEndClip param_73 = _1928;
|
2022-03-03 09:44:03 +11:00
|
|
|
Cmd_EndClip_write(param_71, param_72, param_73);
|
2022-03-08 07:49:59 +11:00
|
|
|
cmd_ref.offset += 8u;
|
2021-12-04 10:49:58 +11:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
switch (drawtag)
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
case 5u:
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
|
|
|
clip_depth++;
|
|
|
|
break;
|
|
|
|
}
|
2022-03-03 09:44:03 +11:00
|
|
|
case 37u:
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
|
|
|
if (clip_depth == clip_zero_depth)
|
|
|
|
{
|
|
|
|
clip_zero_depth = 0u;
|
|
|
|
}
|
|
|
|
clip_depth--;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GroupMemoryBarrierWithGroupSync();
|
|
|
|
rd_ix += 256u;
|
|
|
|
if ((rd_ix >= ready_ix) && (partition_ix >= n_partitions))
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2022-03-31 01:27:29 +11:00
|
|
|
bool _1975 = (bin_tile_x + tile_x) < _854.Load(8);
|
|
|
|
bool _1984;
|
|
|
|
if (_1975)
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
2022-03-31 01:27:29 +11:00
|
|
|
_1984 = (bin_tile_y + tile_y) < _854.Load(12);
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-03-31 01:27:29 +11:00
|
|
|
_1984 = _1975;
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
2022-03-31 01:27:29 +11:00
|
|
|
if (_1984)
|
2021-12-04 10:49:58 +11:00
|
|
|
{
|
2022-03-03 09:44:03 +11:00
|
|
|
Alloc param_74 = cmd_alloc;
|
|
|
|
CmdRef param_75 = cmd_ref;
|
|
|
|
Cmd_End_write(param_74, param_75);
|
2021-12-04 10:49:58 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[numthreads(256, 1, 1)]
|
|
|
|
void main(SPIRV_Cross_Input stage_input)
|
|
|
|
{
|
|
|
|
gl_WorkGroupID = stage_input.gl_WorkGroupID;
|
|
|
|
gl_LocalInvocationID = stage_input.gl_LocalInvocationID;
|
|
|
|
comp_main();
|
|
|
|
}
|