mirror of
https://github.com/libretro/parallel-dc.git
synced 2026-11-07 04:25:58 -10:00
tools: a test disc that writes into its textures a few bytes at a time
live_disc.py --atlas draws textures of every layout texel for texel and writes a little of each every frame. tools/vulkan/vk_parts.sh runs it on each renderer, with GPU decode and threaded rendering on and off: the pictures have to be the same, and the same as another core's when given.
This commit is contained in:
1 parent
8245523a55
commit
1bdca17e0e
3 files changed
+632
-5
No files matched your search
+434
-3
@@ -2,7 +2,7 @@
|
||||
"""Write a bootable GD-ROM image (GDI + three track files) around the
|
||||
bare-metal test program in live_prog.c, for tools/threads/live.sh.
|
||||
|
||||
Usage: live_disc.py out.gdi [--no-region-array | --mmu-align | --slant | --hscale | --cull]
|
||||
Usage: live_disc.py out.gdi [--no-region-array | --mmu-align | --slant | --hscale | --cull | --atlas]
|
||||
live_disc.py out.elf
|
||||
|
||||
The program is carried here already compiled, so the test needs no SH-4
|
||||
@@ -12,7 +12,8 @@ takes the build of it that renders without ever writing a region array;
|
||||
misaligned accesses; --slant the build with a slanted shaded triangle
|
||||
over the picture; --hscale that with the screen's renders through the X
|
||||
scaler as well; --cull the build with modifier volumes and translucent
|
||||
polygons of each cull mode.
|
||||
polygons of each cull mode; --atlas the build with textures written a few
|
||||
bytes at a time.
|
||||
The image is the least the core's HLE BIOS needs to boot it: an IP.BIN
|
||||
whose bootstrap jumps to the boot file, and an ISO 9660 volume holding
|
||||
1ST_READ.BIN.
|
||||
@@ -2072,6 +2073,434 @@ ffffffff78563412efbeadde000001005345474120534547414b4154414e4120
|
||||
0000803fffffffff
|
||||
""")
|
||||
|
||||
# The program built with -DLIVE_ATLAS (live_prog.c): with textures of every
|
||||
# layout drawn texel for texel, a few bytes of each written every frame,
|
||||
# for the texture cache's updates of parts of them (tools/vulkan/vk_parts.sh).
|
||||
PROGRAM_ATLAS = bytes.fromhex("""
|
||||
01df02d02b40090000f0008ce00e018c020005d119206b200e40543402004227
|
||||
01170b0009000900fefcffff020005d119205b200e4044340200422601160b00
|
||||
09000900fefcffff1b4429000b0009000344422642605a200224074402000116
|
||||
42160b00090002000b0009000e440b0009006a446a000b00090066446a004225
|
||||
0b0009006a000b000900020101e00b000e4100e00b000900034f01e00b00074f
|
||||
00e00b0009000900000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000000004d105d002600221420002704e402b00090009004440018c
|
||||
240000ff00000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000000016d0026116d229211ad208e522633031128908721045f98b
|
||||
13d33031068913d3392113d33b210be402a009000dd10ae411d33b2103a00900
|
||||
215109e45834111004510ed33921184408444b2114100cd22263017332223800
|
||||
2b000900000000ff00f0ffff00000010000000e000f0ff000000000c0040018c
|
||||
76010000ff03ffff4040018c220203d12e41fdff2e420b0009000900a800018c
|
||||
8df09df19df29df39df49df59df69df7830410f020f030f040f050f060f070f0
|
||||
3df05a000b0009005a440df24df21df25a000b00090048f44cf55af50b000900
|
||||
48f00b0009000af40b0009000dd10ed2222104710dd2222104710dd222210471
|
||||
0cd2222101e10cd212220cd200e3322204721222f0720ad33222147212220b00
|
||||
0900090000e000ac0100008000e1000c0920000100000001e86c5fa0106c5fa0
|
||||
00e0000c43631843436128411b234b23136418444b2304d210e132221041fc8f
|
||||
04720b0009000900000000a409d112610f92292108d307d42365336242661367
|
||||
636159217231028b10431042f68b0b000900ff030c815fa080841e0002d11260
|
||||
01910b001920ff030c815fa0862f962f224f436804d90b4909008230fb8b264f
|
||||
f6690b00f66809003c06018c07d3326113620de77d421a222361294101412a21
|
||||
136005e22d401a200b000223ac34018c862f962fa62fb62f224f0844084412d1
|
||||
4c311267536201421151014123636c331633028f636a136a283aa82a0d8dfee1
|
||||
19257c3509d85c3800e909db0b4b090001280179903af98f0278264ff66bf66a
|
||||
f6690b00f66809002c34018c000000a46c06018c862f224f09d00b4043688364
|
||||
0844084407d11c34415109410941294007011a00f4e11d40264f0b00f6680900
|
||||
6c06018c2c34018cf47ff361319221214d6229444c602d93236739277b201181
|
||||
2c60128100e013815d6229455c6029233b2014812c6015810fd101e220211871
|
||||
a0e220210dd20ed1206008c8018f1041fa8b0ad1106008c80989f36209d706e1
|
||||
256331271041fb8f01e00b000c7ffcaf00e0302000ff090084705fa018705fa0
|
||||
a086010080705fa027d100e220210c71602163621942047120210871a0e22021
|
||||
22d223d1206008c8018f1041fa8b1fd1106008c8348d06e11ed3456221231041
|
||||
fb8b1ad21ad1206008c8018f1041fa8b16d1106008c8258d68261d8d536400e0
|
||||
14d70174180063610a3101416362017202e33232078d017105a001e119422404
|
||||
1041098d027071622d62036301736233f48f2405f5af104107d110610b0001e0
|
||||
0b0000e00b0000e084705fa018705fa0a086010080705fa09c705fa0862f962f
|
||||
a62fb62f224f907f43680ae6f36572d472d00b400c750820018bbba009e0fc84
|
||||
0fc903886c8f01e0f3600c7002840188668f01e0f3600c7003840288608f01e0
|
||||
f3620c7225840c63284326840c6118613b2127840c600b21b9931c33b8922633
|
||||
018b9ea001e08828488d83605cd222621032018b97a002e00ee6f36559d457d0
|
||||
0b400c750820018b8fa009e0f3600c700184118801898aa003e0f3600c700484
|
||||
0188018985a003e0f3600c7005840288018980a003e0f3620c722b840c632843
|
||||
2c840c6118613b212d840c622b217e922c317d922631018b6fa003e064e6f365
|
||||
41d43ed00b400c750820688df365f36a107af36800eb6c9414a00ce938d21222
|
||||
48a0090010420a8d0177346040c8f98d7b6043610c416f841b20f3af6f801049
|
||||
088d087ab0280178a36300e78366f076ebaf08e200e12dd64c940ca00ae01c31
|
||||
1042068dff736821f9891c314a21f7af1d611040068954622c6218422a217363
|
||||
f1af7362f06001882b8bf36001840288298b1fd22a21f362fa840c6213631943
|
||||
3032228ff3622b840c621c611032ffe00a600840707f264ff66bf66af6690b00
|
||||
f668f7af0900f5af0900f3af0900f1af0900efaf0900edaf0900ebaf0900e9af
|
||||
09e0e7af04e0e5af04e0e3af04e0a8fd2b018000211009007c32018ca807018c
|
||||
1480018c7032018c6432018c00800000ffff00000ad142210471522101e109d2
|
||||
1222087212220472122207d1226001c8018d1041fa8b05d1126001c80b002900
|
||||
04745fa00c745fa000093d0018745fa0626113671947014725922821ffe22a62
|
||||
436300432903136001402444136019407a2001c8108943605c302a2306342907
|
||||
3a2773611841236318433c333b21203729022b210b001226436058302a234630
|
||||
2907eeaf3a27000249d1126249d11032048d00e248d122210b0000e047d148d2
|
||||
122248d221521032718b47d112600188028d11e00b00090044d345d131110471
|
||||
44d2292144d645d772166c921b222316726230325d8f00e341d23222736301e7
|
||||
7223226360922033558b39d2215337d22033df8f13e03bd23bd331123bd334d7
|
||||
33173bd773123bd226164e921b22271639d222623032cd8f16e038d22dd33922
|
||||
43932b23371624d305e7722332d332672fd33037318b32d32fd7322729d77357
|
||||
30372c8b22d3335728d33037b28f18e02cd778162a977b2119162bd101e33221
|
||||
2ad1126321d11033a48f19e025d338167b22291624d102e2222124d1126220d1
|
||||
10320e8f00e220d122210b0001e00b0011e00b0012e00b0013e00b0017e00b00
|
||||
18e00b001ae01601c0003601340109000000001044332211100000ff88776655
|
||||
040000100050018c4040018c5555aaaafc5f018c00f0ff1f0040018c00100010
|
||||
4440018cfc6f018c0df0ad0bb0b0b0b0c0c0c0c000300010083000100070018c
|
||||
c1c1c1c100400010000000ff08400010862f962ff45110d2222210d8422810d0
|
||||
522010d4122410d5622510d6722610d7122710d3f25992238302f35992221228
|
||||
00e11220122412251226122712238302f6690b00f6680900000000e0040000e0
|
||||
080000e00c0000e0100000e0140000e0180000e01c0000e0862f962fa62fb62f
|
||||
c62fd62fe62f224ff07f536b636a7369fd5e2ad11b24431f29dd422d00e829d1
|
||||
822129d282220871822108728222087182210872822208718221830de21f611f
|
||||
722f22dcfc575366a3650b4cb364e21ffc52211f922f2367b366a3650b4c9364
|
||||
1bdee21fa11f922ffc57b366a3650b4cb364f351122d17d112d2122212d18221
|
||||
0872822208718221087282220871822108728222830de21ffc51111f922f1367
|
||||
b366a3650b4c9364107f264ff66ef66df66cf66bf66af6690b00f66800000081
|
||||
000000e0040000e0080000e0700c018c0000803e00000024224ff87ff351111f
|
||||
722f6367536643650cd10b4100e40cd200e112220bd312230473122304731223
|
||||
047312230473122304731223047312238302087f264f0b0009000900d80c018c
|
||||
000000e0040000e0862f962fa62fb62fc62fd62fe62ff75cf85bf95e24d14b21
|
||||
24d2122224da25d1122a25d9522925d8622825d000e1122024d5122524d61226
|
||||
24d312238302436d2b2dd222b22ae229c22812201225722612238302d222b22a
|
||||
fb5bb229c22812201bdbb225722612238302d222fa5dd22ae229c228b2201225
|
||||
72261223830215dddb244222fa54422afb5dd229c228b220b225722612238302
|
||||
f66ef66df66cf66bf66af6690b00f66800000080000000e0040000e0000000c0
|
||||
080000e00c0000e0100000e0140000e0180000e01c0000e00000803f000000f0
|
||||
862f962fa62fb62fc62fd62fe62f224fbc7fc07f9bd112619bd2266526662267
|
||||
9ad2266322625b216b217b213b212b214ce0160f96d11060fec90021ffe295d3
|
||||
22230473222300e204732123106001cb002191d1126091d3392005cb02211871
|
||||
8fd33221f471222110718ed222216c718dd222219c718dd2222104718cd22221
|
||||
10718cd222218cd18cd212228cd212228cd18dd222218dd600e38dd88dd412e7
|
||||
45330a02094223611c3113652c355c353369583953609c3008408e0112260173
|
||||
1047ed8f047684d184d2222184d185d22221047184d22221047184d2222184d1
|
||||
c59222210471c392222104711fe222210471be9222217fd27fd310e132221041
|
||||
fc8f04727dd1b59222213c717cd222210871077222217bd27bd3ac9132221041
|
||||
fc8f047279d17ad77ad310e27221a3961c3632261042f98f047177d177d22221
|
||||
04719a92222176d276d310e132221041fc8f04721fe174d2122274d2122274d1
|
||||
00e002ea00e973d807e41fe58697869317e6d62f019d230df66d26211043058d
|
||||
017726657035f989f8af63616ad227536ad22033648d50e001e1160f10e168d2
|
||||
12220472122267d267d30ce132221041fc8f047200e163d212220472122263d1
|
||||
63d2222163d164d2222164d12e4164d1ffe700e308e2722131111042fb8f0871
|
||||
5fd360d1122360d260d1292148977b2111135fd1122200e111125ed212225ed2
|
||||
12225ed105e222215dd00b40090040e7fc3701175bd1eee2339320215ad71c37
|
||||
20275ad71c37202759d71c3720271043f38f017157d458d00b4005e5082001ee
|
||||
028de61fb4a0090054d00b40090054d454d10b41092454dcc36dc51fbea200ee
|
||||
52d2205335d22033978996af01e1007ce003ff7f8001800000101f7ce00700f8
|
||||
36010048846c5fa0f46c5fa0c0785fa00400d8ff0800d8ff44805fa000008000
|
||||
3f7d1700000020000401150000007f020000df0177df27000000100020805fa0
|
||||
28815fa08c805fa0000000030c0010a5f432018cabaaaaaa88805fa017b7d138
|
||||
000010a500000002000080200000003004905fa0001000a40303030374805fa0
|
||||
00ff000000825fa080800000002006a4050505050606060614905fa01ffc0000
|
||||
000006a4070707071c985fa01c9c5fa0004006a4ffff0000c040018c11111111
|
||||
380000ff000018a500000080180018a54c0e00a02c805fa000001800a800018c
|
||||
0040018c000000100050018c00f0ff1f443322114040018c000000ff100000ff
|
||||
e80a018c000023ac0000ffff0000feff0000fdff5eb000002807018c6600018c
|
||||
ff7fffff6c00018cbc32018c0041018cbd9562d462d00b4009000820028fe61f
|
||||
42af09005fd460d00b4005e50820018ba3a002ee5dd8ab9b59da5dd9b3650b4a
|
||||
83640820018b9aa002eea1900c389038f58fb36553d454d00b4008e50820018b
|
||||
8fa003ee959553d44dd00b4009000820028f10e187a003ee4fd650d220677c67
|
||||
64633c633037028d10417ea004eef58f01724bd17b9210677c674ad31c333063
|
||||
3c633037028d1042a8a005eef38f017145d16c9210677c6744d31c3330633c63
|
||||
3037028d10429ba006eef38f017135d435d00b4002e50820018b93a008ee3cd1
|
||||
3cd2222104715592222101e13ad21222087212220472122238d1226001c8018d
|
||||
1041fa8b36d1126001c8028ffc717ba009ee00e222210471126001c8018975a0
|
||||
0aee30d1379202a009000c8d017110677c672dd31c3330633c633037f58d1042
|
||||
0beeb1aee61f29d110611c61249220315e8f0cee26d110611c6120315a8f07ee
|
||||
24d110611c612031568b23d110611c612031538b00ee97aee61f95aee61f93ae
|
||||
e61f91aee61f8faee61f8daee61f00280004004000180010ee0009000000200c
|
||||
540a018c5eb000002807018c0000210c0028210c0000220ce432018c000020ac
|
||||
000021ac0000ffff000022ac0000feff04745fa00000230c0c745fa0801a0600
|
||||
18745fa0000023ac0000fdff001023ac002820ac002821ac004022ac54aee61f
|
||||
52aee61f50aee61f4eaee61f4caee61f4aaee61f48aee61f46aee61f44aee61f
|
||||
017993600888038f936801a1017e936807e00d4846911928936001c90b2870e0
|
||||
860fd26af553326bf3667076b3651ed70b47a364071ff36778778366b3651bd0
|
||||
0b40a36440e2fc322e51f7501030318f70e02f5127922921fe022031028de82e
|
||||
d2a001eecc8ff366860f7076a3650ed70b47a364036bf366787683650cd00b40
|
||||
a36440e2fc322e51103b0189bea002ee2f51089339212c522031b28d017902ee
|
||||
0aa0e51f00030103900a018c1000018c2c00018c01eee51f5ad10b4100e85ad0
|
||||
0b400900036159d957db0b4b136aa230058f0361a030ffe22a381049f58b63e1
|
||||
163801e140e0028f160f08a2090050d850d1122850d10b41090082624fd34bd1
|
||||
326001c8018d1041fa8b4cd11261136001c9081f136001c8018912a202e044d1
|
||||
126344d11033018b0da203e040d1126040d11032038dff88018906a201e03cd1
|
||||
1260ff885e893bd222213dd13dd2222104713dd222210471629222213bd13cd2
|
||||
2221147101e22221136230d1226001c8018d1041fa8b2ed112611c6113600688
|
||||
01890ba204e02ad22260294019403088028d747204a204e022632ed220330189
|
||||
00a205e022d223d3322225d22ad33222047225d33222047228d33222047228d3
|
||||
3222047227d3322227d728d320e2322701731042fb8f04771cd21dd332221472
|
||||
01e33222236311d2326001c8018d1042fa8b0fd22260ff88048922600c600788
|
||||
0089181fa2a1090056afe51f54afe51ff5500470051fe3600a882989f7ae00e9
|
||||
022009000c06018c3c06018c80841e0000e100ac785634128c05018c186c5fa0
|
||||
00e000ac0000008000e1000c046c5fa000e0000c56657273220000800c010022
|
||||
000000020000006414e000ac0000dec0047d73d1103d018910adc51f71d8836c
|
||||
057cf36a547a70db84600c69ab80f3640b4b5f74036168e0982929022031028d
|
||||
160f19a103eeab840c61c8909b201030028dc03812a103eee68b64d8836e147e
|
||||
63dd64dc64db65da0b4d0900051f8669f36678769365f3640b4c747440e3fc33
|
||||
3e52f361707110320189f9a004eef3617471a490fe0210320189f3a004ee3c52
|
||||
f5512a219a21b9213f533a22a9222b211821028de038e7a004eed58b50d00b40
|
||||
f36b036a4fd9936e187e4fdd6c7b4fdc96680b4d83640038028d02e0d6a005ee
|
||||
0a2868e0860fb365f3640b4c68740038028d40e2cca006eefc322b51b031028d
|
||||
e039c7a006eee38b41d1181241d1191241d93dd80b48936440dbf3640b4b6074
|
||||
3fd40b4807eef3640b4b64740b489364f3643cd10b41687440e7fc377a527851
|
||||
1032478fe51f36d11a17f3656c75f3642ed00b406874f36432d10b41687440e1
|
||||
fc311a521951103208ee338fe51f2ed00b4009ee01882d8fe51f2cd00b400aee
|
||||
0188278fe51f2ad483600b400bee20d428d00b40090028d110301b8fe51f27d4
|
||||
24d00b4009000188148fe51f24d140e0fc30181000e11a10f3656875f36421d1
|
||||
0b41607440e3fc333a52385110320cee028de51f40ae0900a36435a083608000
|
||||
e432018cb432018c4800018ca032018c6600018c5000018cf2830070f3830070
|
||||
8400018c8832018c7200018c7a00018c0000803f00000040010004008005018c
|
||||
010024008605018c8a00018c9800018c01000c006805018c000080bf01000080
|
||||
785634127605018c0b40090044d800e1122844d10b41090082627f9110320dee
|
||||
088fe51ff36440d00b4068740788138f00eee51ff0ad0900eeade51fecade51f
|
||||
eaade51fe8ade51fe6ade51fe4ade51fe2ade51fe0ade51f0eeeddade51f33d9
|
||||
926833d10b41090064e1122931d120e22221136230d1226020c8018f1041fa8b
|
||||
2ed00b40090029d182212ad120e2222103619c7102e2263129011c3140e0d6ad
|
||||
160f03a0081f01a0081f081f24d1126424d125d22363136600e020e733652835
|
||||
40755026017600231047f78f01731cd31ed77223dc7300e772231dd712270477
|
||||
2227047710e662271997722323651075136000eee71f01e808a010e3d6af081f
|
||||
d4af081fd2af081f1043238924666c6604677c677036f789f6af871f80011154
|
||||
4440018c2c05018c4005018cc8805fa00c06018c00695fa080841e003c06018c
|
||||
4000a0ff9040018c7040018c018200001000a0ff6ed220622822038901922302
|
||||
09006c166bd2226210711032228df75ee82e018f03eee71f67d268d112220171
|
||||
111267d100e332213111321133113411351164d732275fd32223136504731223
|
||||
047304e66223a893322710715bd004e813a004e35cd112615031d98ff75e5bd1
|
||||
12611821d48ff75e56d1126002c8d38fe82eceaf090010430789f75ee82efa8f
|
||||
56660036f789f6af871f4dd334533823048ff75e47d3326330322589e82e2a8d
|
||||
05ee00e247d122212471422148d149d33b2149d3222349d249d7222732632033
|
||||
1b8d00e244d3222341d3222345d222213263203301ee248fea1f126241d11032
|
||||
1b8ff3611fa0787137d222621032d58ff75ed7af00e2d4afe71f726337d22033
|
||||
ffe22a622a1f00e233d3222330d3222334d2222132632033df89fa5eeb610271
|
||||
1a1ff3617871399221213890118158e012810fe0138133901481329015812ad1
|
||||
00e220211871a0e2202128d228d1206008c8018f1041fa8b24d1106008c81a8d
|
||||
09eef362787223d306e1256771231041fb8b21d10fe2222120d1139222210471
|
||||
f072222100e11ed30d940d950d961dd80c994aa000e2ecafe61f314420010002
|
||||
000383001f0fff0077772c01a10f09008040018c1000a0ff6840018c0100feca
|
||||
5040018c1c00a0ff1400a0ff1800a0ff4c40018c000000e0000014a50df0ad0b
|
||||
000014e52143341284705fa018705fa0a086010080705fa0002870a0402070a0
|
||||
000081a04b1714060a071360783001400c37f5e00d4797071a0013670837d59e
|
||||
ec3771230172027361714632ec8f85315123017202736032f78f617100e16cd2
|
||||
1222047212220472c193322204721fe332220472bc9332220472122204721222
|
||||
0472122263d1b4922221047160e2222161d100e0ae9500e6ad97ad935fd25630
|
||||
d62f019d230df66d3614612101707030f58f027100e15ad21222047212220472
|
||||
9993322204721fe3322204729093322204721222047212220472122204728c93
|
||||
3222047248e3322288924ed32223047322230473222304732223047322234ad2
|
||||
12220472122249d17992222148d600e7769048d47598759373620922236106e5
|
||||
5d412c311c312c3145310a021365283501455c321942094287021a022831629e
|
||||
ec31112601771043e68f027600e13ad212220472122204724d93322204721fe3
|
||||
322204724493322204724d933222047212220472122231d13b922221047160e2
|
||||
2221d87141922221f65007e11d401fcb40e2fc32061200eeeb1fef1fee1fffee
|
||||
ed1f00eee91f9ea700e8188d5a884d8f648823d12a922221019d230d836db012
|
||||
20d10b4102e462a009001ed10b4103e45da009001bd10b4104e458a009001ad1
|
||||
15922221019d230d836d841230f800011f3c1f0fff07001070170f0f00190242
|
||||
ff0fcf07011019fc00780342e003e07f040070a0240070a0000082a090e80000
|
||||
840070a0ac0070a0c00070a0800070a0000083a06b6f4606040170a0240170a0
|
||||
1c985fa0e405018c10905fa00289819110380c8b41d142d2222183606488c18b
|
||||
40d178922221019d230d836d0212739110380389019023008360da1137d13ad2
|
||||
2221019d230d836de6111638f98937d137d2222137d1ffe2222137d10b410900
|
||||
36d110600fc90688018bdda6090034d1126118211e8933d1126118211a8f0820
|
||||
028d09e141a701e240eefc3e1e1e1f1e2dd1126004e700e600e5f3640b407874
|
||||
ee511821028d01e228d1222128d2226101711222bda68360b156014600e50b4a
|
||||
936414a001790b4c93640b4e0c1f0c660176fc550b4a93640b4c93640b4e0c1f
|
||||
07c903660176fc550b4a93640179936008882f8d107bd82dde8d48e0fe001f88
|
||||
e18b0b4c93640365b15609460b4a9364edaf0179c8001f7ca0000900000070a0
|
||||
01c200001c9c5fa00182000044815fa00000008014805fa08c05018c8c705fa0
|
||||
1080018c0880018cbc00008c0080018c0c80018c8cd10ae22221836001c8018b
|
||||
b1a1090089d18adc122c8ad1126eec1f89dee26240e0fc302210c263351001e2
|
||||
222120e1122e85d1122c85d185d4122485d5122585d786d6722686d1141f131f
|
||||
00e9921f911f84d0022f84dde59700e683d50b4d00e483dbb41fb31f921f911f
|
||||
81d1122f81d700e67dd50b4d00e480da922a80d1922180d2922280d3922380d4
|
||||
922480d5922580d6922680d79227830affe17fd0122010e1122e7ed1122c7ed1
|
||||
68d2122268d3122368d569d45224b41fb31f921f911f68d6622f78d700e668d5
|
||||
0b4d00e4922a6bd792276bde922e6bd092206bd192216bd292226bd392236bd4
|
||||
9224830affe66ad562256dd112611821018b3ba101e26bd1126177e22631028f
|
||||
01715aa1090067d2122267d112600820018b5ca1090009e11630018b9fa10a88
|
||||
017061d1022143d1fc5ee221047148e0fe000221147154e0fe02222108715bd2
|
||||
222104715ad222215ad111600d605ad111611f88028f1d6198a1090057d658d2
|
||||
40e1236740e361271043fc8f027755951041f68f5c3252911638290251d1088f
|
||||
222130d150d222214a911038018b4fd110612fd12dd222214ad1126118210189
|
||||
86a1ffe72ede4adcc41f2ad1131f49dbb21f49ddd11f28daa22f28d9ffe700e6
|
||||
2f940b49e365c41f44d1131fb21f44d1111fa22f43d744d523940b4900e6c41f
|
||||
42d1131fb21f42d1111fa22fffe741d618940b49e36540d1141f40d1131f40d1
|
||||
121fd11fa22fffe700e63ed50b4900e43dd1141f3dd17ba0131f008000010301
|
||||
0601800088000900e4805fa00000400060805fa048805fa04c805fa000007001
|
||||
00007f0068805fa06c805fa00000008044815fa0000000430000003f080e018c
|
||||
00008020000080429a99193fff0000ff000000e0040000e0080000e00c0000e0
|
||||
100000e0140000e0180000e01c0000e014805fa00000740100003f0000ff00ff
|
||||
2480018c2080018c1880018c00007f020000df01140a70a4c80a70a400f80000
|
||||
804070a42880018c0000c700010071a00000dc4200008c420000004200003043
|
||||
00001043ffffff800000908000009043000040430002003000005c420000c042
|
||||
0000f0410000002000002f430000964381d1121f81d1111fa22fffe780d681d5
|
||||
0b4908e480d181d2222181d281d332220472e222047200e3322204727ed66222
|
||||
047262220472622204726222830100e07add7bdc136376db7ada7bd97bd400e2
|
||||
7bd5cba004e17bd14dae09007ad122217ad2222c7ad17bd22221b41fb31f921f
|
||||
911f71d1122f78d700e678d50b4d00e4922a67d29222e362922e047292220472
|
||||
9222047292220472922204729222830a6fd1ffe22221a8ae09006ed111611d61
|
||||
6dd77031f7896dd101e29eae22216cdaa26c6cd1cb21122a6bd110e222211471
|
||||
6ad222216ad16bd21222047212225cd15cd222215dde68dbb41f68d1131f00e9
|
||||
921f911f50d1122f65dd829700e6e3650b4d00e4b41fb31f921f911f61d1122f
|
||||
61d700e6e3650b4d00e43fd1922140d292220472922204729222047292220472
|
||||
92220472922204729222830148d1ffe22221c22a55d101e2222164ae0900fc8b
|
||||
53d111600d60407111611f88078d1d6142d101e222214dd10be254ae2221499e
|
||||
ec314cd00821f689f2af090042933c3148d44821068b39d112611821058946d6
|
||||
5dae090044d65aae0900349657ae090042d1141f42d1131f42d1121f42d1111f
|
||||
42d1122f00e629d535d10b4100e469ae090029071ceeed473b277223fc57722b
|
||||
3bd76227922a22240c77222712dee2250877222783031041708d017002c8dc1f
|
||||
0089cc1f01c833d6e38d038832d6e1af290700802004e0070000fa4200007a43
|
||||
00000e0c24008020000000e020000080040000e0000000c00000803f00002f43
|
||||
000043430c0000e00000003f100000e0180000e0000020002480018c00007801
|
||||
44815fa000000080ff00ffff0000802014805fa0280a78a41ff800001c80018c
|
||||
f4805fa0000001004c805fa000007c0100003f0068805fa00000804200000043
|
||||
080e018c9a99193fff0000ff1880018c200a7ca4dfff000000f8000000004843
|
||||
00809f4300007042000052436666663f080000e00000574300006b4385daa41f
|
||||
85d1131f85d9921f85d1111f85dee22fffe785d685d586d00b4008e4a41f85d1
|
||||
131f921f84d1111fe22fffe783d684d57fd10b4108e483da83d4422a83dd84d2
|
||||
222d84db84d1122b84dc85d6622c00e984d3922384d5922584d7922784d09220
|
||||
830ab22a83d1122d83d7722be22c92239225ffe2087322239220830ab22a122d
|
||||
7ed3322be22cfc7592257dd1f87012200875222508709220830ab22a79d0022d
|
||||
722be22cf8751225047592250475222504759225830a74d5522a022d322be22c
|
||||
68d01220047012200470222004709220830a422a5ed4422d6cd4422b622c61d6
|
||||
9226f870922061d492240c769226830ab22a67d6622d722be22cfc709220fc74
|
||||
92240870222008749224830ab22a622d322be22c53d69226fc701220fc742224
|
||||
0c769226830ab22a5ad6622d722be22c4cd712279220222408709220830a522a
|
||||
622d322be22c122747d3122322249220830a51d2241f131f621f50d1111fe22f
|
||||
ffe737d5559432de0b4e00e64cd1122a37d0022d32d1122b4ad1122c30d339d2
|
||||
32222ed538d4522438d6922638d79227830a00e300e2c36b636affe9736421a0
|
||||
04e5236740d141dc236641dddb2725dd722d26de022e27d0c2201ad7722b29dc
|
||||
122c29d76227922a2224830d122d622e9220222b222c2227222a2224830d1045
|
||||
6c8d017302e1336002c8028d3921ada401c801c8018961a403882ed01821d08f
|
||||
13672adcd1af13662ad027d12adcccaf1366800000006b430000f04100005743
|
||||
000020410000003f00c0003400208020080e018c00005c4200000c4200c00036
|
||||
00008020000000e008000080040000e0000000c0080000e0002480200c0000e0
|
||||
00c80088100000e0140000e0180000e01c0000e00000f0420000e04100005042
|
||||
0000004300002043080000f00004802000002443000040430000604300008042
|
||||
c8000080000200300000803f00005643c80000e00000484300006c43b3dab4d9
|
||||
a36e307eb3ddb4dcb4dba66108410841dc31126209420142125613559351141f
|
||||
9251131f9151121f9261111fb22fffe72b26cb25aad00b4008e4e03ae58f1079
|
||||
a8da00e9922aa8dd922da8dc922ca8d19221a8d29222a8d39223a8d49224a8d5
|
||||
9225830aa7d5a8dbb11fa8d1122fa8dea8d753660b4e00e4b11fa7d1122fa7d7
|
||||
a7d6a8d50b4e00e4a7d1122a922d922c97d6922602e297d7222706e196d01220
|
||||
96d3222396d41224830ab11f9dd5522f9ed79fd69fd5a0d40b4e0900922a922d
|
||||
922c8bd692268bd792278bde922e8bd092208bd19221830a98d2241f98d1131f
|
||||
98d3321f98d4411f98dee22f7cdb98d698d599d40b4bffe790d5541f97d1131f
|
||||
90d6621f96d1111fe22f96d691d592d40b4bffe7922a922d922c75d7922775d0
|
||||
922075d1922175d2922275d39223830a8dd4441f84d5531f8cd6621f8cd7711f
|
||||
8cd0022f8cd78dd58dd40b4b00e686d1141f8cd2231f85d3321f8bd4411f8bd5
|
||||
522f8bd785d586d40b4b00e6922a922d922c5fd692265fd792275fd092205fd1
|
||||
92215fd29222830a82d183d2222183d1141f83d1131f83d1121f83d1111f83d1
|
||||
122f83d700e683d50b4b00e45cd3341f81d1131f73d4421f80d1111fe22f80d7
|
||||
80d581940b4b00e6922a922d922c48d5922548d6922648d7922748de922e48d0
|
||||
9220830a78d179de79d77ad67ad57bd40b4e122f74d27ad77ad67bd57bd40b4e
|
||||
222f47d3341f50d4431f5ed5521f58d6611f58d7722f58d758d559d40b4b00e6
|
||||
3fdee41f57d0031f021f57d1111f57d2222f57d751d552d40b4b00e6922a922d
|
||||
922c2bd392232bd492242bd592252bd692262bd79227830a65d1ffe222213491
|
||||
10380189f9a9090062d263d1226001c8018d1041fa8b61d161d2222161d162d2
|
||||
2221047161d22221047161d2222104713bd2222104715fd222215fd35fd220e1
|
||||
222301721041fb8f04735dd15dd22221147101e2222113624fd1226001c8018d
|
||||
1041fa8bcca9090080009600fc33018c3c33018c2c34018c000480203333733f
|
||||
080e018c000000e0040000e0080000e00c0000e0100000e0140000e0180000e0
|
||||
1c0000e00000a0420000403f0000c842d80c018c0000704300006f4300007443
|
||||
0000524300005c43000000200000004300004443000080420000020000005c42
|
||||
000068430000f041000048430000003f00c40030000090200800000400008d43
|
||||
00007a4300c6003000002a430000024300000c439a99193fff00008000009094
|
||||
00000002000034430000f0429a99993e0000ff8060815fa0000000800000d842
|
||||
00008c420000be42000020423333333fffff00ff000080200000964300008043
|
||||
ffffff80000090806666663fb80d018c0000d442000082420000c24200003442
|
||||
00004d4300009143000039430000874314805fa0186c5fa080841e0000e100ac
|
||||
7856341200e000ac2200008000e1000c0c0100220000006514e000ac0001dec0
|
||||
046c5fa000e0000c63d222610171122283603c88028f4288a9a00900048ffb5e
|
||||
e82e018ba8a009005cd10b4109005cd10b4110e45bd1126283639c73aa911633
|
||||
028ff951c6a009002831fd5e163e008b1d1ffe5e123e00891e1fff5e1c3eef1f
|
||||
291f00e150e0fe022822038d1821018924a10900028d3fe114a1fe521638018b
|
||||
c2a08360017883603c88028f3ce171a809001638018b58a846881e88028f2d88
|
||||
5ea80900028f0f885fa809000189a1a183603dd10b4101e4836208422c320842
|
||||
8c32184209428c326591192283603fc9036108410c31184134d33c3134d32121
|
||||
1043fc8f0271a8a8090032d1222100e131d210220c720ae33022047210222fd1
|
||||
a0e220212ed22fd1206008c8018f1041fa8b2bd1106008c8238d13e268712121
|
||||
00e221210ae3312121212121212124d224d1206008c8018f1041fa8b20d11060
|
||||
08c811896871116211601162116211611ad220620fc918401c610b211ad257af
|
||||
12221ad1faaf090018d1f7af090018d00b4000e404a00b1f15d00b4001e40b1f
|
||||
06d10b41090006d10b4110e405d1126267af291f9500ff7f1080018c0c06018c
|
||||
4c06018c0c00d8ffe405018c000000a500a000000880018c84705fa09c705fa0
|
||||
18705fa0a08601000480018cffff00005c08018cac9110381f8ff55ee82e1c89
|
||||
57d1a693322157d1ec31291f56d2122256d112611821078d8360226254d11032
|
||||
038f01c8c4a00ae201c8018be3a0090050d151d2122236af017889911038b78f
|
||||
ce71fe53fd5ee8331633288dff5e4bd3ec337f911633288d4ce0fe000820298d
|
||||
f65e3fd177933221291fff5e43d2ec3270911632608d4ce0fe0008205f8ff65e
|
||||
e82e5f8f50e0fe0008205e8f40e0fe011821288df850136339d1b7af3c3130d1
|
||||
5a93322137d1b1af291f2dd155933221dbaf291fe82e0e8d58e029d1fe000221
|
||||
291ffe52fd5ee832449116322dd19d8dff5ecbaf0900291fd4ae01e120d13d92
|
||||
2221efaffe520820038df75e26d18daf0c31e82e028925d188afec31fa5ee82e
|
||||
028923d182afec31fb5ee82e038d44e020d17bafec3101e1fe021732038f44e0
|
||||
1dd173af2c31fe000188028910d16daf09001ad16aaf090019d167af090019d1
|
||||
64af090018d161af090018d15eaf0900fa00e003c8001f7c007cff03007e0900
|
||||
10905fa00001d0ba4840018c1080018c0d600d600000400050805fa043c721fe
|
||||
0008d0ba0200d0ba0009d0ba000ad0ba000bd0ba000dd0ba0007d0ba4d4d0d60
|
||||
0300d0ba0400d0ba0500d0ba0600d0ba60d11261c971263112895fd112611821
|
||||
13895ed11262b291103202895cd108a009005cd1126118210a895bd101a00900
|
||||
5ad15bd212221faf83605ad1f9af090059d1f6af090059d11baf090029071ce6
|
||||
1821028d6d479fab090055d055dc56d66bab090003c903880389019123013fe1
|
||||
2aee3fe11638018957ae8362836dc07d4edb00e983601fc940e1fc314cdc4dde
|
||||
4dda0211d62f019d230df66daaee4bd222621071103202ee068fe71f48d11261
|
||||
103502ee048de71f0192230209008ae9019123010900c8e93360038829071ce1
|
||||
1d4740d038d137dc2fab1366f48f18213cd054ab09004121017002715630058f
|
||||
20c8d62f019d230df66dc0ebf38f2364f1af336401a093628362212101700271
|
||||
a630f78f0388f78d46302c8f66302c8b312101705888f38f02712bd128922221
|
||||
2ad22bd129212bd33b2113662367e07729d518e352271043fc8f047727d30ce7
|
||||
7223fc7310e7722325d708e3722101771043fb8f0471830621d700e101e60195
|
||||
230508e37edec8af5362c6af73622806800009000c80018c0880018c0480018c
|
||||
030cd0ba0080018c040cd0ba010cd0ba4840018c020cd0ba9d5a0d6000002000
|
||||
0000484300006c430000803f2c34018cf406018c6c06018c9006018c1000a0ff
|
||||
1400a0ff000070431c815fa0e040018ce0ffff03000000e0111111113c0000ff
|
||||
e0ffc000400000006400000000000000400100000e0000000000000010000000
|
||||
0a0000000000000001000400000004000300040001000c000100240001000400
|
||||
010000000200000000010000000200000303000000017f80ff00000000000000
|
||||
0100000002000000ffffff7f0000008001000080ffffffff78563412efbeadde
|
||||
000001005345474120534547414b4154414e4120000000000000000017b7d138
|
||||
0000000000000000ffffffff000020440000000017b7d1380000803f00000000
|
||||
ffffffff000000000000f04317b7d138000000000000803fffffffff00000000
|
||||
0000000000000043000000430000004300000000000040430000804200004043
|
||||
0000000000008043000080420000004300008042000040430000a04200004043
|
||||
00008042000080430000c0420000804300000000000090430000004200008043
|
||||
0000004200009043000080420000804300008042000090430000c04200008043
|
||||
0000c042000088430000e042000088430000c04200008c430000d04200008c43
|
||||
0000c04200008e430000c84200008e430000c04200008f430000c44200000000
|
||||
0100000002000000030000000400000005000000060000000700000007000000
|
||||
0700000007000000070000000000180000000800000000103600000038021000
|
||||
00000200000000082d0000002818120000480000000000482d000000986f1200
|
||||
00a00000000000162b00000000a0140000280000000000442c00000000101300
|
||||
0040000000000030240000000811140000800000000000182400000040501300
|
||||
b0aa0000000000882400000091f44525
|
||||
""")
|
||||
|
||||
# The same program built with -DLIVE_MMU_ALIGN: its MMU test also asks for
|
||||
# the address errors a misaligned access raises (live_prog.c). For a core
|
||||
# that keeps translations in a table, which they all do: it is the build
|
||||
@@ -2630,7 +3059,7 @@ def main():
|
||||
if len(sys.argv) == 2 and sys.argv[1].endswith('.elf'):
|
||||
write_elf(sys.argv[1])
|
||||
return 0
|
||||
if len(sys.argv) not in (2, 3) or sys.argv[2:] not in ([], ['--no-region-array'], ['--mmu-align'], ['--slant'], ['--hscale'], ['--cull']):
|
||||
if len(sys.argv) not in (2, 3) or sys.argv[2:] not in ([], ['--no-region-array'], ['--mmu-align'], ['--slant'], ['--hscale'], ['--cull'], ['--atlas']):
|
||||
sys.stderr.write(__doc__)
|
||||
return 2
|
||||
out = sys.argv[1]
|
||||
@@ -2645,6 +3074,8 @@ def main():
|
||||
program = PROGRAM_HSCALE
|
||||
elif sys.argv[2:] == ['--cull']:
|
||||
program = PROGRAM_CULL
|
||||
elif sys.argv[2:] == ['--atlas']:
|
||||
program = PROGRAM_ATLAS
|
||||
d = os.path.dirname(out) or '.'
|
||||
|
||||
ip = bytearray(16 * 2048)
|
||||
|
||||
+109
-2
@@ -27,8 +27,8 @@
|
||||
* and paste the bytes of live_prog.bin into PROGRAM; the same again with
|
||||
* -DNO_REGION_ARRAY for PROGRAM_NO_REGION_ARRAY, with -DLIVE_MMU_ALIGN
|
||||
* for PROGRAM_MMU_ALIGN, with -DLIVE_SLANT for PROGRAM_SLANT, and with
|
||||
* -DLIVE_SLANT -DLIVE_HSCALE for PROGRAM_HSCALE, and with -DLIVE_CULL for
|
||||
* PROGRAM_CULL. */
|
||||
* -DLIVE_SLANT -DLIVE_HSCALE for PROGRAM_HSCALE, with -DLIVE_CULL for
|
||||
* PROGRAM_CULL, and with -DLIVE_ATLAS for PROGRAM_ATLAS. */
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned short u16;
|
||||
#define PVR(off) (*(volatile u32 *)(0xA05F8000 + (off)))
|
||||
@@ -504,6 +504,105 @@ static void ta_volume(u32 x0, u32 y0, u32 x1, u32 y1, u32 near)
|
||||
ta_send(0, 0, 0, 0, 0, 0, 0, 0); /* end of the volume list */
|
||||
}
|
||||
|
||||
#ifdef LIVE_ATLAS
|
||||
/* With -DLIVE_ATLAS, over the top of the screen: textures of every
|
||||
* layout, each drawn texel for texel at an internal resolution of 2x, a
|
||||
* few bytes of every one of them written every frame from frame 64 on and
|
||||
* now and then much of it, as a game writes into an atlas. Twiddled 565,
|
||||
* 4444 512 by 512 and YUV; compressed; planar 4444 with a stride of 320
|
||||
* (TEXT_CONTROL) and planar compressed 1555; 8-bit palette indices;
|
||||
* mipmapped 565, drawn at five sizes for its levels. Not starting where
|
||||
* the pieces of video memory a texture cache may watch them by start. */
|
||||
static const u32 atlas[][4] = {
|
||||
/* address, bytes, texture control word (address apart), texture size bits */
|
||||
{ 0x180000, 0x80000, (2u << 27), (6u << 3) | 6u },
|
||||
{ 0x100238, 0x20000, (1u << 27), (5u << 3) | 5u },
|
||||
{ 0x121828, 0x04800, (1u << 30) | (1u << 27), (5u << 3) | 5u },
|
||||
{ 0x126f98, 0x0a000, (2u << 27) | (1u << 26) | (1u << 25), (5u << 3) | 3u },
|
||||
{ 0x14a000, 0x02800, (1u << 30) | (1u << 26), (5u << 3) | 4u },
|
||||
{ 0x131000, 0x04000, (6u << 27), (4u << 3) | 4u },
|
||||
{ 0x141108, 0x08000, (3u << 27), (4u << 3) | 4u },
|
||||
{ 0x135040, 0x0aab0, (1u << 31) | (1u << 27), (4u << 3) | 4u },
|
||||
};
|
||||
#define ATLAS_TEXTURES (sizeof(atlas) / sizeof(atlas[0]))
|
||||
/* Where each is drawn, and the mipmapped one (the last) four times more,
|
||||
* smaller and smaller */
|
||||
static const u32 atlas_of[] = { 0, 1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7 };
|
||||
static const float atlas_at[][4] = {
|
||||
/* x0, y0, x1, y1 */
|
||||
{ 0.0f, 0.0f, 128.0f, 128.0f },
|
||||
{ 128.0f, 0.0f, 192.0f, 64.0f },
|
||||
{ 192.0f, 0.0f, 256.0f, 64.0f },
|
||||
{ 128.0f, 64.0f, 192.0f, 80.0f },
|
||||
{ 192.0f, 64.0f, 256.0f, 96.0f },
|
||||
{ 256.0f, 0.0f, 288.0f, 32.0f },
|
||||
{ 256.0f, 32.0f, 288.0f, 64.0f },
|
||||
{ 256.0f, 64.0f, 288.0f, 96.0f },
|
||||
{ 256.0f, 96.0f, 272.0f, 112.0f },
|
||||
{ 272.0f, 96.0f, 280.0f, 104.0f },
|
||||
{ 280.0f, 96.0f, 284.0f, 100.0f },
|
||||
{ 284.0f, 96.0f, 286.0f, 98.0f },
|
||||
};
|
||||
static u32 atlas_seed = 0x2545F491;
|
||||
|
||||
static u32 atlas_rnd(void)
|
||||
{
|
||||
atlas_seed ^= atlas_seed << 13;
|
||||
atlas_seed ^= atlas_seed >> 17;
|
||||
atlas_seed ^= atlas_seed << 5;
|
||||
return atlas_seed;
|
||||
}
|
||||
|
||||
/* @n halves of texture @i from its byte @at on */
|
||||
static void atlas_write(u32 i, u32 at, u32 n)
|
||||
{
|
||||
volatile u16 *texel = (volatile u16 *)(0xA4000000 + atlas[i][0]);
|
||||
u32 k;
|
||||
|
||||
at /= 2;
|
||||
if (at + n > atlas[i][1] / 2)
|
||||
n = atlas[i][1] / 2 - at;
|
||||
for (k = 0; k < n; k++)
|
||||
texel[at + k] = (u16)atlas_rnd();
|
||||
}
|
||||
|
||||
/* A byte of texture @i (with no division: the program has none) */
|
||||
static u32 atlas_at_random(u32 i)
|
||||
{
|
||||
return ((atlas_rnd() >> 16) * (atlas[i][1] >> 4)) >> 12;
|
||||
}
|
||||
|
||||
static void atlas_frame(u32 frame)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < ATLAS_TEXTURES; i++)
|
||||
{
|
||||
if (frame == 0)
|
||||
atlas_write(i, 0, atlas[i][1] / 2);
|
||||
else if ((frame & 31) == 31)
|
||||
atlas_write(i, atlas_at_random(i), atlas[i][1] / 4);
|
||||
else
|
||||
{
|
||||
atlas_write(i, atlas_at_random(i), 1 + (atlas_rnd() & 255));
|
||||
atlas_write(i, atlas_at_random(i), 1 + (atlas_rnd() & 7));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void ta_atlas(void)
|
||||
{
|
||||
u32 q;
|
||||
|
||||
for (q = 0; q < sizeof(atlas_of) / sizeof(atlas_of[0]); q++)
|
||||
{
|
||||
const u32 i = atlas_of[q];
|
||||
ta_quad(TA_TEXTURED, TSP_PLAIN | (4u << 8) | atlas[i][3], atlas[i][2] | (atlas[i][0] >> 3), 0xFFFFFFFF, F(0.95f),
|
||||
F(atlas_at[q][0]), F(atlas_at[q][1]), F(atlas_at[q][2]), F(atlas_at[q][3]));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* What every render draws on top of the background: three polygons that
|
||||
* take shadows and a modifier volume that crosses them all.
|
||||
*
|
||||
@@ -611,6 +710,9 @@ static void ta_scene(void)
|
||||
ta_send(TA_VERTEX, F(150.1f), F(205.9f), F(0.92f), 0, 0, 0xFF10E010, 0);
|
||||
ta_send(TA_VERTEX | TA_LAST, F(290.6f), F(130.2f), F(0.92f), 0, 0, 0xFF1010E0, 0);
|
||||
#endif
|
||||
#ifdef LIVE_ATLAS
|
||||
ta_atlas();
|
||||
#endif
|
||||
#ifdef LIVE_CULL
|
||||
/* With -DLIVE_CULL, on the left: two white polygons that take shadows,
|
||||
* under the two volumes below, which differ only in their cull modes */
|
||||
@@ -656,6 +758,7 @@ static void ta_scene(void)
|
||||
ta_send(0, 0, 0, 0, 0, 0, 0, 0); /* end of the translucent list */
|
||||
}
|
||||
|
||||
|
||||
/* A render to a texture: 128 by 128, at 0x700000 in video memory, orange
|
||||
* with its top left quarter blue. The screen's scene then has a polygon
|
||||
* with that texture, which has to show it the same way up. */
|
||||
@@ -1791,6 +1894,10 @@ void cmain(void)
|
||||
* of two buffers in turn */
|
||||
if (frame >= 64)
|
||||
{
|
||||
#ifdef LIVE_ATLAS
|
||||
atlas_frame(frame - 64);
|
||||
PVR(0xE4) = 10; /* TEXT_CONTROL: a stride of 320 */
|
||||
#endif
|
||||
PVR(0x60) = (frame & 1) ? 0x400000 : 0x200000; /* FB_W_SOF1 */
|
||||
render_to_texture();
|
||||
scene_in_part = frame >= 260;
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
#!/bin/sh
|
||||
# Textures written a few bytes at a time, as a game writes into an atlas
|
||||
# (the test disc built with -DLIVE_ATLAS: tools/threads/live_disc.py
|
||||
# --atlas), with Vulkan, on a frontend that runs the core's frames as
|
||||
# RetroArch does (vk_hdr.c), under the validation layer. The texture
|
||||
# cache makes only the parts of them that changed again; for each
|
||||
# renderer, the picture is the same with the textures made on the GPU and
|
||||
# on the CPU, with threaded rendering on and off - and, given a second
|
||||
# core (one built before a change to the texture cache), the same as that
|
||||
# core's in each.
|
||||
#
|
||||
# sh tools/vulkan/vk_parts.sh [core.so [other.so]]
|
||||
#
|
||||
# VKPARTS_FRAMES: how many frames are run before the picture is taken
|
||||
# (160 by default; the disc writes into its textures from frame 64 on, and
|
||||
# much of each at frames 95, 127, 159...). VKPARTS_RENDERERS: the lanes,
|
||||
# of per-triangle, per-strip, per-pixel and compute (all but compute by
|
||||
# default: lavapipe takes minutes over the compute renderer's frames).
|
||||
# KEEP=1: the pictures and logs are kept, in $TMPDIR/vk_parts.<pid>.
|
||||
#
|
||||
# Needs the core built with Vulkan, a Vulkan driver (lavapipe will do:
|
||||
# VK_DRIVER_FILES=/usr/share/vulkan/icd.d/lvp_icd.json) and python3 for
|
||||
# the test disc.
|
||||
set -e
|
||||
cd "$(dirname "$0")/../.."
|
||||
CORE=$(readlink -f "${1:-parallel_dc_libretro.so}")
|
||||
OTHER=${2:+$(readlink -f "$2")}
|
||||
WORK=${TMPDIR:-/tmp}/vk_parts.$$
|
||||
mkdir -p "$WORK"
|
||||
[ -n "${KEEP:-}" ] || trap 'rm -rf "$WORK"' EXIT
|
||||
${CC:-cc} -O1 -g -Wall -I./core/libretro-common/include -I./core/deps/khronos \
|
||||
-DTARGET_NO_THREADS -o "$WORK/vk_hdr" tools/vulkan/vk_hdr.c tools/hdr/hdr_post_ref.c \
|
||||
core/rend/hdr/hdr_output.c core/rend/hdr/hdr_transform.c core/rend/hdr/hdr_aces2.c \
|
||||
core/rend/hdr/hdr_libretro.c core/rend/hdr/hdr_display.c -ldl -lm -lpthread
|
||||
python3 tools/threads/live_disc.py "$WORK/test.gdi" --atlas
|
||||
FRAMES=${VKPARTS_FRAMES:-160}
|
||||
RENDERERS=${VKPARTS_RENDERERS:-"per-triangle per-strip per-pixel"}
|
||||
fails=0
|
||||
|
||||
# run <core> <name> <options...>: from nothing kept by an earlier run (the
|
||||
# disc writes to the memory card)
|
||||
run() {
|
||||
run_core=$1; run_name=$2; shift 2
|
||||
rm -rf "$WORK/dir"; mkdir -p "$WORK/dir"
|
||||
VKH_DIR="$WORK/dir" VKH_FRONTEND=sdr "$WORK/vk_hdr" "$run_core" "$WORK/test.gdi" "$WORK/$run_name.raw" $FRAMES \
|
||||
reicast_internal_resolution=2x "$@" > "$WORK/$run_name.log" 2>&1 || {
|
||||
{ echo " FAIL: the $run_name run failed:"; tail -5 "$WORK/$run_name.log"; } >&2; return 1; }
|
||||
}
|
||||
|
||||
for r in $RENDERERS; do
|
||||
case $r in
|
||||
per-triangle) set -- "reicast_alpha_sorting=per-triangle (normal)" ;;
|
||||
per-strip) set -- "reicast_alpha_sorting=per-strip (fast, least accurate)" ;;
|
||||
per-pixel) set -- "reicast_alpha_sorting=per-pixel (accurate)" ;;
|
||||
compute) set -- "reicast_alpha_sorting=per-pixel (accurate)" "reicast_rendering_method=compute" ;;
|
||||
*) echo "vk_parts: no renderer $r" >&2; exit 2 ;;
|
||||
esac
|
||||
echo "$r"
|
||||
before=$fails
|
||||
first=
|
||||
for gpu in enabled disabled; do
|
||||
for threaded in enabled disabled; do
|
||||
name="$r-$gpu-$threaded"
|
||||
run "$CORE" "$name" "$@" reicast_gpu_texture_decode=$gpu reicast_threaded_rendering=$threaded || { fails=$((fails + 1)); continue; }
|
||||
if [ -z "$first" ]; then
|
||||
first=$name
|
||||
elif ! cmp -s "$WORK/$first.raw" "$WORK/$name.raw"; then
|
||||
echo " FAIL: the picture with GPU decode $gpu, threaded rendering $threaded is not the one with $first's"
|
||||
fails=$((fails + 1))
|
||||
fi
|
||||
if [ -n "$OTHER" ]; then
|
||||
run "$OTHER" "other-$name" "$@" reicast_gpu_texture_decode=$gpu reicast_threaded_rendering=$threaded || { fails=$((fails + 1)); continue; }
|
||||
if ! cmp -s "$WORK/$name.raw" "$WORK/other-$name.raw"; then
|
||||
echo " FAIL: the picture with GPU decode $gpu, threaded rendering $threaded is not the other core's"
|
||||
fails=$((fails + 1))
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
if [ $fails = $before ]; then
|
||||
echo " GPU decode on and off, threaded rendering on and off: the same picture${OTHER:+, the other core's}"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $fails != 0 ]; then
|
||||
echo "vk_parts: $fails failed"
|
||||
exit 1
|
||||
fi
|
||||
echo "vk_parts: all passed"
|
||||
Reference in new issue
Block a user