Render to texture: textures made from what a render covers are made again

A render to a texture writes video memory on the console. Here its picture
stays on the graphics card, and video memory gets it later without a write
that faults, so a texture made from that memory - another size, another
format, a part of it - went on showing what was there before: a render made
every frame and drawn as a texture of another shape froze at its first
frame. rtt_watch_add() now has every texture made from what the render
covers made again (VramRendered()), all but the one rendered to, with no
change of page protection; every renderer names that one in its watch.

The DMA test disc renders a picture every frame, red then blue, and draws
it as a texture of another size: tools/vulkan/vk_dma.sh, tools/gl/gl_dma.sh
and tools/rend/d3d_dma.sh have it blue.
This commit is contained in:
libretroadmin committed 2026-11-02 00:54:05 +01:00
1 parent a68605c46b
commit 3673ad27a9
13 files changed
+259 -189

No files matched your search

+30
View File
@@ -347,6 +347,36 @@ void VramLockedWriteRange(u32 offset, u32 size)
vram_writes.Mark(page);
}
/* Render thread, the machine standing still: a render to a texture covers
* @size bytes from @offset. On the console it writes them, and a texture
* made from them - another size, another format, a part of it - shows what
* was there before; here the picture is on the graphics card, and video
* memory gets it later (rend/rtt_watch.h) without a write that faults. So
* every texture made from them is made again now, but @target, the one
* rendered to. No page changes protection: a lock dropped leaves its page
* as it is. */
void VramRendered(u32 offset, u32 size, const BaseTextureCacheData *target)
{
if (size == 0 || offset >= VRAM_SIZE)
return;
if (size > VRAM_SIZE - offset)
size = VRAM_SIZE - offset;
vramlock_collect();
const u32 end = offset + size - 1;
for (u32 page = offset / PAGE_SIZE; page <= end / PAGE_SIZE; page++)
{
const VramLockList& list = VramLocks[page];
for (u32 k = 0; k < list.count; k++)
{
vram_block *lock = list.locks[k];
/* (dropping one takes it off every page it is on) */
if (lock != nullptr && lock->userdata != target && lock->start <= end && lock->end >= offset)
rend_text_invl(lock);
}
}
}
/* A block copy (a DMA) is about to write every byte of @size from @offset
* of video memory, on the thread that runs the machine. What its writes
* would fault on a page at a time is done once for all of it: a picture
+1
View File
@@ -946,6 +946,7 @@ class BaseTextureCacheData;
bool VramLockedWriteOffset(size_t offset);
void VramLockedWriteRange(u32 offset, u32 size);
void VramBlockWrite(u32 offset, u32 size);
void VramRendered(u32 offset, u32 size, const BaseTextureCacheData *target);
void vram_load(const u8 *from);
void libCore_vramlock_Lock(u32 start_offset, u32 end_offset, BaseTextureCacheData *texture);
+1
View File
@@ -907,6 +907,7 @@ void dx11_rtt_watch(DX11Texture *texture, u32 addr, u32 x0, u32 y0, u32 width, u
watch.alpha_threshold = FB_W_CTRL.fb_alpha_threshold;
watch.dither = FB_W_CTRL.fb_dither;
watch.tex = (uintptr_t)texture;
watch.target = texture;
watch.scale = settings.rend.RenderToTextureUpscale > 1 ? settings.rend.RenderToTextureUpscale : 1;
if (watch.bytes != 0)
rtt_watch_add(&watch, &dx11_rtt_backend);
+1
View File
@@ -967,6 +967,7 @@ void dx12_rtt_watch(DX12Texture *texture, u32 addr, u32 x0, u32 y0, u32 width, u
watch.alpha_threshold = FB_W_CTRL.fb_alpha_threshold;
watch.dither = FB_W_CTRL.fb_dither;
watch.tex = (uintptr_t)texture;
watch.target = texture;
watch.scale = settings.rend.RenderToTextureUpscale > 1 ? settings.rend.RenderToTextureUpscale : 1;
if (watch.bytes != 0)
rtt_watch_add(&watch, &dx12_rtt_backend);
+1
View File
@@ -619,6 +619,7 @@ void dx9_rtt_watch(DX9Texture *texture, u32 addr, u32 x0, u32 y0, u32 width, u32
watch.alpha_threshold = FB_W_CTRL.fb_alpha_threshold;
watch.dither = FB_W_CTRL.fb_dither;
watch.tex = (uintptr_t)texture;
watch.target = texture;
watch.scale = settings.rend.RenderToTextureUpscale > 1 ? settings.rend.RenderToTextureUpscale : 1;
if (watch.bytes != 0)
rtt_watch_add(&watch, &dx9_rtt_backend);
+1
View File
@@ -1225,6 +1225,7 @@ void ReadRTTBuffer() {
texture_data->stride_read = 0; // (rendered, not read)
texture_data->made_type = 0;
libCore_vramlock_Lock(texture_data->sa_tex, texture_data->sa + texture_data->size - 1, texture_data);
watch.target = texture_data;
rtt_watch_add(&watch, &rtt_gl_backend);
}
gl.rtt.tex = 0;
+2
View File
@@ -309,6 +309,8 @@ void rtt_watch_add(const RttWatch *watch, const RttWatchBackend *b)
#if !defined(TARGET_NO_THREADS)
render_thread = sthread_get_current_thread_id();
#endif
if (watch->bytes != 0 && watch->addr + watch->bytes <= VRAM_SIZE)
VramRendered(watch->addr, watch->bytes, watch->target);
release_garbage();
if (need > pixels_size)
{
+6
View File
@@ -22,6 +22,8 @@
#include "types.h"
#include <cstdint>
class BaseTextureCacheData;
struct RttWatch
{
u32 addr; /* where in video memory, in bytes */
@@ -39,6 +41,10 @@ struct RttWatch
u32 age; /* frames it has waited */
u32 serial; /* this render's, of every render watched: never 0 */
bool used;
/* The texture cache's texture rendered to, NULL if none. On the console
* a render writes video memory: every other texture made from what it
* covers is made again (VramRendered()). */
const BaseTextureCacheData *target;
};
/* What a renderer hands the picture over to: w by h pixels of R, G, B, A
+1
View File
@@ -352,6 +352,7 @@ void vk_rtt_watch(Texture *texture, u32 addr, u32 x0, u32 y0, u32 width, u32 hei
watch.alpha_threshold = FB_W_CTRL.fb_alpha_threshold;
watch.dither = FB_W_CTRL.fb_dither;
watch.tex = (uintptr_t)texture;
watch.target = texture;
watch.scale = settings.rend.RenderToTextureUpscale > 1 ? settings.rend.RenderToTextureUpscale : 1;
if (watch.bytes != 0)
rtt_watch_add(&watch, &vk_rtt_backend);
+5 -2
View File
@@ -2,7 +2,9 @@
"""Check a picture of the test disc built with -DLIVE_DMA (live_prog.c):
the three textures DMA writes into, where the disc draws them at the top
right of the screen - cyan over the yellow fetched from a render, cyan, and
green. The picture is as vk_hdr.c writes one (a 16-byte header: "VKHR", a
green - and beside the green, a render made every frame drawn as a texture
of another size: blue, what it is rendered last, not the red of its first
frames. The picture is as vk_hdr.c writes one (a 16-byte header: "VKHR", a
format, the width and the height; then 8-bit R, G, B, A rows, top first).
Used by tools/vulkan/vk_dma.sh, tools/gl/gl_dma.sh and tools/rend/d3d_dma.sh.
@@ -25,7 +27,8 @@ def at(x, y):
want = [((530, 20), (0, 255, 255), "the half: the DMA's cyan"),
((530, 60), (255, 255, 0), "the half: the render's yellow, fetched"),
((600, 40), (0, 255, 255), "the whole: the DMA's cyan"),
((530, 110), (0, 255, 0), "the texture: the DMA's green")]
((530, 110), (0, 255, 0), "the texture: the DMA's green"),
((600, 110), (0, 0, 255), "a render as another size: the last one's blue")]
bad = 0
for (x, y), c, what in want:
got = at(x, y)
+1
View File
@@ -46,6 +46,7 @@ void _vmem_open_watched_vram(u32, u32) {}
bool _vmem_vram_page_watched(u32 page) { return watched[page]; }
u32 _vmem_get_vram_offset(void *) { return (u32)-1; }
void VramLockedWriteRange(u32, u32) {}
void VramRendered(u32, u32, const BaseTextureCacheData *) {}
/* the renderer: every read and every batch of copies begun, in order */
struct Event { char what; u32 serial; unsigned count; };
+190 -185
View File
@@ -2584,7 +2584,7 @@ b9931c33b8922633018b9ea001e08828488d83605cd222621032018b97a002e0
fa840c62136319433032228ff3622b840c621c611032ffe00a600840707f264f
f66bf66af6690b00f668f7af0900f5af0900f3af0900f1af0900efaf0900edaf
0900ebaf0900e9af09e0e7af04e0e5af04e0e3af04e0a8fd2b01800021100900
3033018c3007018c1480018c2433018c1833018c00800000ffff00000ad14221
dc33018c3007018c1480018cd033018cc433018c00800000ffff00000ad14221
0471522101e109d21222087212220472122207d1226001c8018d1041fa8b05d1
126001c80b00290004745fa00c745fa000093d0018745fa06261136719470147
25922821ffe22a62436300432903136001402444136019407a2001c810894360
@@ -2633,7 +2633,7 @@ fec90021ffe295d322230473222300e204732123106001cb002191d1126091d3
7bd3ac9132221041fc8f047279d17ad77ad310e27221a3961c3632261042f98f
047177d177d2222104719a92222176d276d310e132221041fc8f04721fe174d2
122274d2122274d100e002ea00e973d807e41fe58697869317e6d62f019d230d
f66daa221043058d017726657035f989f8af63616ad227536ad22033648d4ce0
f66d56231043058d017726657035f989f8af63616ad227536ad22033648d4ce0
01e1160f10e168d212220472122267d267d30ce132221041fc8f047200e163d2
12220472122263d163d2222163d164d2222164d12e4164d1ffe700e308e27221
31111042fb8f08715fd360d1122360d260d1292148977b2111135fd1122200e1
@@ -2643,14 +2643,14 @@ f66daa221043058d017726657035f989f8af63616ad227536ad22033648d4ce0
c36dc51fc0a200ee52d2205335d22033978996af01e1007ce003ff7f80018000
00101f7ce00700f836010048846c5fa0f46c5fa0c0785fa00400d8ff0800d8ff
44805fa0000080003f7d1700000020000401150000007f020000df0177df2700
0000100020805fa028815fa08c805fa0000000030c0010a5a833018cabaaaaaa
0000100020805fa028815fa08c805fa0000000030c0010a55434018cabaaaaaa
88805fa017b7d138000010a500000002000080200000003004905fa0001000a4
0303030374805fa000ff000000825fa080800000002006a40505050506060606
14905fa01ffc0000000006a4070707071c985fa01c9c5fa0004006a4ffff0000
c040018c11111111380000ff000018a500000080180018a54c0e00a02c805fa0
00001800a800018c0040018c000000100050018c00f0ff1f443322114040018c
000000ff100000ff700a018c000023ac0000ffff0000feff0000fdff5eb00000
b006018c6600018cff7fffff6c00018c7033018c0041018cbd9562d462d00b40
b006018c6600018cff7fffff6c00018c1c34018c0041018cbd9562d462d00b40
09000820028fd71f42af09005fd460d00b4005e50820018ba3a002ed5dd8ab9b
59da5dd9b3650b4a83640820018b9aa002eda1900c389038f58fb36553d454d0
0b4008e50820018b8fa003ed959553d44dd00b4009000820028f10e187a003ed
@@ -2664,7 +2664,7 @@ b006018c6600018cff7fffff6c00018c7033018c0041018cbd9562d462d00b40
1c6120315a8f07ed24d110611c612031568b23d110611c612031538b00ed97ae
d71f95aed71f93aed71f91aed71f8faed71f8daed71f00280004004000180010
ee0009000000200cdc09018c5eb00000b006018c0000210c0028210c0000220c
9833018c000020ac000021ac0000ffff000022ac0000feff04745fa00000230c
4434018c000020ac000021ac0000ffff000022ac0000feff04745fa00000230c
0c745fa0801a060018745fa0000023ac0000fdff001023ac002820ac002821ac
004022ac54aed71f52aed71f50aed71f4eaed71f4caed71f4aaed71f48aed71f
46aed71f44aed71f017993600888038f936803a1017e936807e00d4847911928
@@ -2701,8 +2701,8 @@ fc35525210320189f3a004ed3d52f5512a219a21b92151533a22a9222b211821
09ed01882d8fd61f2bd00b400aed0188278fd61f29d483600b400bed1fd428d0
0b40090027d110301b8fd61f26d424d00b4009000188148fd61f24d140e0fc30
191000e11b10f3656c75f36420d10b41647440e3fc333b52395110320ced028d
d61f3fae090035a0a36480009833018c6833018c4800018c5433018c6600018c
5000018cf2830070f38300708400018c3c33018c7200018c7a00018c0000803f
d61f3fae090035a0a36480004434018c1434018c4800018c0034018c6600018c
5000018cf2830070f38300708400018ce833018c7200018c7a00018c0000803f
00000040010004008005018c010024008605018c8a00018c9800018c01000c00
6805018c000080bf01000080785634127605018c83600b40090045d800e11228
44d10b41090082627f9110320ded088fd61ff36440d00b406c740788138f00ed
@@ -2715,7 +2715,7 @@ d61fdfadd61f0eeddcadd61f33d9926833d10b41090064e1122932d120e22221
00edd81f01e808a010e3d6af091fd4af091fd2af091f1043248924666c660467
7c677036f789f6af881f8001115409004440018c2c05018c4005018cc8805fa0
0c06018c00695fa080841e003c06018c4000a0ff9040018c7040018c01820000
1000a0ff6ed22062282203890192230209007e176bd2226210711032228df85d
1000a0ff6ed22062282203890192230209002a186bd2226210711032228df85d
d82d018f03edd81f67d268d112220171111267d100e332213111321133113411
351164d732275fd32223136504731223047304e66223a893322710715bd004e8
13a004e35cd112615031d98ff85d5bd112611821d48ff85d56d1126002c8d38f
@@ -2735,7 +2735,7 @@ a086010080705fa0002870a0402070a0000081a04b1714060a07136078300140
0c37f5e00d4797071a0013670837cd9ddc3771230172027361714632ec8f8531
5123017202736032f78f617100e168d21222047212220472b993322204721fe3
32220472b49332220472122204721222047212225fd1ac922221047160e22221
5dd100e0a69500e6a597a5935bd25630d62f019d230df66d4815612101707030
5dd100e0a69500e6a597a5935bd25630d62f019d230df66df415612101707030
f58f027100e156d212220472122204729193322204721fe33222047288933222
047212220472122204721222047284933222047248e3322280924ad322230473
222304732223047322230473222346d212220472122245d17192222144d600e7
@@ -2743,185 +2743,190 @@ f58f027100e156d212220472122204729193322204721fe33222047288933222
01455c321942094287021a0228315a9ddc31112601771043e68f027600e136d2
12220472122204724593322204721fe3322204723c9332220472459332220472
1222047212222dd133922221047160e22221d87139922221f75007e11d401fcb
40e2fc32071200eddc1fdf1fde1fffeddd1f00edda1f00e010a6051f4688438d
5a88468b1ed12192222121a6f5501dd10b4102e41ca6f5501ad10b4103e417a6
f55018d10b4104e412a6f55030f800011f3c1f0fff07001070170f0f00190242
40e2fc32071200eddc1fdf1fde1fffeddd1f00edda1f00e028a6051f4688438d
5a88468b1ed12192222139a6f5501dd10b4102e434a6f5501ad10b4103e42fa6
f55018d10b4104e42aa6f55030f800011f3c1f0fff07001070170f0f00190242
ff0fcf07011019fc00780342e0030900040070a0240070a0000082a090e80000
840070a0ac0070a0c00070a0800070a0000083a06b6f4606040170a0240170a0
1c985fa0e405018c4ed190922221dfa5f550f550648802898a9110300a8b4ad1
4ad22221f5506488028b49d181922221daa5f5507e911030038901902300f550
aa1241d143d22221cea5f5504288138ff55041d26f936f9131221041fc8f0272
3ed869953ed40b48090066953dd40b4809003dd1bda509005088c88f40e136d2
5c9331221041fc8f0272589537d433d10b410900edaf090008422c3208420c32
184209420c324b9119223fc9036108410c3118412ed33c312ed321211043fc8f
02710191230109004812f550163003890191230109002e1286a5f55022d188a5
090025d1222125d2222b25d125d22221a41fa31f821f811f23d1122f23d700e6
23d50b4e00e48229d362822d0472822204728222047282220472822204728222
047282228309ffe2222c2aa60900e07fc8001f7ca000ff0700100020e0078000
ff7f090010905fa0000070a001c200001c9c5fa001820000000080ac6c06018c
00007e0000407e000000200000807e00000000a500a000002480018c00007801
44815fa0000000800000003fff00ffff0000802069d1222169d16ad712276ade
6addd22e6adaa41fa31f00e9921f911f68d0022f68ddbc9700e668d50b4d00e4
67d8922867dc922c67db922b67d1922167d2922267d3922367d4922467d59225
8308ffe766d6722666d156d0122057d1122ea41fa31f921f911f56d2222f62d7
00e656d50b4d00e49228922c922b57d3922357d4922457d5922557d6922657d7
92278308ffe056dd022db9a5090057d9926b57d1bb21122956d110e222211471
55d2222155d156d21222047212223ed13ed2222141dd3edaa41f52d1131f00e8
821f811f3bd1122f3bdc639700e6d3650b4c00e4a41fa31f821f811f4ad1122f
4ad700e6d3650b4c00e435d1822135d282220472822204728222047282220472
82220472822204728222830134d1ffe22221b2293ed101e222217fa50900fc8b
3cd111600d60407111611f88078d1d6139d101e2222136d10be26fa522212a93
3c3136d44821f689f2af0900239ddc3132d00821068b30d112611821058930d6
79a509002ed676a50900159673a509002cd1141f2cd1131f2cd1121f2cd1111f
2cd1122f00e60dd50bd10b4100e486a5090000ff00802004e00709002c80018c
00007e0160805fa044815fa000000080000080420000003f900d018c00008020
1c985fa0e405018c4fd193922221f7a5f550f550648802898d9110300a8b4bd1
4bd22221f5506488028b4ad184922221f2a5f55081911030038901902300f550
561342d144d22221e6a5f5504288138ff55042d27293729131221041fc8f0272
3fd86c953fd40b48090069953ed40b4809003ed1d5a509005088c88f40e137d2
5f9331221041fc8f02725b9538d434d10b410900edaf090008422c3208420c32
184209420c324e9119223fc9036108410c3118412fd33c312fd321211043fc8f
0271019123010900f412f55016300389019123010900da129ea5f55023d1a0a5
090026d1222126d2222b26d126d22221a41fa31f821f811f24d1122f24d700e6
24d50b4e00e48229d362822d0472822204728222047282220472822204728222
047282228309ffe2222c42a609001ad74fa60900e07fc8001f7ca000ff070010
0020e0078000ff7f10905fa0000070a001c200001c9c5fa001820000000080ac
6c06018c00007e0000407e000000200000807e00000000a500a000002480018c
0000780144815fa0000000800000003fff00ffff00008020ff0000ff69d12221
69d16ad712276ade6addd22e6adaa41fa31f00e9921f911f68d0022f68ddbc97
00e668d50b4d00e467d8922867dc922c67db922b67d1922167d2922267d39223
67d4922467d592258308ffe766d6722666d156d0122057d1122ea41fa31f921f
911f56d2222f62d700e656d50b4d00e49228922c922b57d3922357d4922457d5
922557d6922657d792278308ffe056dd022dfea5090057d9926b57d1bb211229
56d110e22221147155d2222155d156d21222047212223ed13ed2222141dd3eda
a41f52d1131f00e8821f811f3bd1122f3bdc639700e6d3650b4c00e4a41fa31f
821f811f4ad1122f4ad700e6d3650b4c00e435d1822135d28222047282220472
822204728222047282220472822204728222830134d1ffe22221b2293ed101e2
2221c4a50900fc8b3cd111600d60407111611f88078d1d6139d101e2222136d1
0be2b4a522212a933c3136d44821f689f2af0900239ddc3132d00821068b30d1
12611821058930d6bea509002ed6bba509001596b8a509002cd1141f2cd1131f
2cd1121f2cd1111f2cd1122f00e60dd50bd10b4100e4cba5090000ff00802004
e00709003080018c00007e0160805fa044815fa000000080000080420000003f
900d018c00008020000000e0040000e0080000e00c0000e0100000e0140000e0
180000e01c0000e014805fa000407e010000fffff4805fa0000001004c805fa0
00007c0100003f0068805fa0000000439a99193fff0000ff1880018c200a7ca4
1c80018cdfff000000f800000000484300809f4300007042000052436666663f
038829071ceddd473b27722340e7fc377457722a8dd76227822922240c772227
8bddd22508772227830310410c8d017002c840e6fc36c4160089b41601c8df8d
e36684d6ddaf038882d9941f82d1131f82d8821f82d1111f82ddd22fffe782d6
82d583d00b4008e4941f82d1131f821f81d1111fd22fffe780d681d57cd10b41
08e480d980d4422980dc81d2222c6fda80d1122a80db81d6622b81de00e8822e
80d3822380d5822580d782278309a2297fd1122c7fd7722ad22b822e8223ffe2
22257ad082208309a229122c7ad3322ad22b822e79d1fc751225fc7022200875
82258309a22976d0022c722ad22b122ef87582250475222504758225830971d5
5229022c322ad22b122e66d012200470222004708220830942295dd4422c6ad4
422a622b822e5fd68226fc7082205fd482248309a22965d6622c722ad22b822e
fc708220fc742224087082208309a229622c322ad22b822efc74122452d62226
82208309a2295ad6622c722ad22b122e82244dd72227822083095229622c322a
d22b122e122422278220830951d2241f131f621f50d1111fd22fffe738d55494
33dd0b4d00e64dd1122939d0022c34d1122a4bd1122b32d2222e30d439d34223
39d5822539d68226830900e300e2b36a24de5369ffe8636425a004e541d01cd1
41db04a01366236719d140db236640dccb2724dc722c25dd022d14d0b220e22a
27db122b27d7622782292224830c122c622d8220222a222b222722292224830c
1045678d017302e1336002c8028d392123a701c801c80189b1a6038829d01821
d18f136729dbd2af13668000080000e00000803f00006b430000f04100005743
000020410000003f00c0003400208020900d018c00005c4200000c4200c00036
00008020000000e008000080040000e0000000c0002480200c0000e000c80088
100000e0140000e0180000e01c0000e00000f0420000e0410000504200000043
00002043080000f00004802000002443000040430000604300008042c8000080
000200300000484300006c4300005643c80000e0bedbbfddd41fbfdaa31fbfdc
c21fbfdee11fbfd9922fbfd8ffe7bfd6b3650b4808e4d41fbdd1131fc21fbdd1
111f922fffe7bcd6b3650b4808e4bbd1141fa31fbad1121fe11f922fffe7b9d6
b9d50b4808e4b9d11261182101893ea1ffe7b7d900e88229b6dc822cb6db822b
b6de822eb6d18221b6d28222b6d38223b6d482248309b6d5b6daa11fb6d1122f
b6ddb7d753660b4d00e4a11fb5d1122fb5d7b6d6b6d50b4d00e4b6d11229822c
822b822e02e2a6d5222506e1a5d61226a5d72227a5d012208309a11facd1aed7
aed6afd5afd40b4d122f8229822c822b822e9bd282229bd382239bd482249bd5
82258309a8d6641fa8d1131fa8d7721fa8ddd11f83ddd22f83daa7d6a7d5a8d4
0b4affe7a0d0041fa6d1131fa0d1121f7bd1111fd22fa4d6a0d5a1d40b4affe7
8229822c822b822e85d2822285d3822385d4822485d5822583099cd6641f95d7
731f9bd0021f9bd1111f9bd2222f9bd79bd59cd40b4a00e694d3341f9ad4431f
93d5521f99d6611f99d7722f99d794d594d40b4a00e68229822c822b822e70d0
822070d1822170d2822270d38223830991d192d2222192d1141f60d1131f91d1
121f5fd1111f90d1122f90d700e65ed50b4a00e46dd4441f8dd1131f82d5521f
8cd1111fd22f8cd78cd58f940b4a00e68229822c822b822e59d6822659d78227
59dd822d59d08220830985d185dd86d786d687d587d40b4d122f81d286d787d6
87d588d40b4d222f58d3341f61d4431f6dd5521f67d6611f67d7722f67d768d5
68d40b4a00e651ddd41f67d0031f021f66d1111f66d2222f66d761d561d40b4a
00e68229822c822b822e3dd382233dd482243dd582253dd68226830972d1ffe2
22214491f5501030018937a509006fd26fd1226001c8018d1041fa8b6dd16ed2
22216ed16ed2222104716ed2222104716dd2222104714bd2222104716bd22221
6bd36cd220e1222301721041fb8f047369d16ad22221147101e2222113625cd1
226001c8018d1041fa8b0aa5090013d1141f0fd1131f12d1121f0ed1111f922f
5fd660d50b4808e4b3ae0900800096001b00802000000c4200008c430000a040
00007a430000003f900d018c00c00f0c00809d4300808e4300c80f0c00008c42
0000204200d00f0c000080202c80018c000000e0040000e0080000e00c0000e0
100000e0140000e0180000e01c0000e00000a0420000403f0000c842600c018c
0000704300006f43000074430000524300005c43000000200000004300004443
000080420000020000005c42000068430000f0410000484300c4003000009020
0800000400008d4300c6003000002a430000024300000c439a99193fff000080
0000909400000002000034430000f0429a99993e0000ff8060815fa000000080
0000d8420000be423333333fffff00ff0000964300008043ffffff8000009080
6666663f400d018c0000d442000082420000c2420000344200004d4300009143
000039430000874314805fa0186c5fa080841e0000e100ac7856341200e000ac
2200008000e1000c0c0100220000006514e000ac0001dec0046c5fa000e0000c
00000c0c120080206fd2226101711222f5503c88028ff55063a209004288048f
fc5dd82d018befa2090068d10b41090067d10b4110e467d11262f5539c73c091
1633028ffa51eda2f5502831fd5d163d008b1d1ffe5d123d00891e1fff5d1c3d
df1f2a1f00e14ce0fe022822038d182101894da30900028d3fe13da3fe52f550
1630018be9a201c80170051ff5503c88028f3ce1e5a909001630028f1e88cda9
f550028f2d88d2a90900028f0f88d3a909000189cfa3f55047d10b4101e4f550
03c90388028df5505faa3fe13fe11630018941aa0362f55001c8018b5eaa0900
3ed13fdb122b3fd1126340e2fc3234123dddd2644512b265561201e2222120e1
122d3ad1122b3ad13ad612263ad712273ad13bd012203bd1141f131f00e8821f
811f39d2222f39de4c9700e638d50b4e00e438daa41fa31f821f811f36d1122f
36d700e632d50b4e00e435d9822935d3822335d4822435d5822535d6822635d7
822735d0822035d18221830934dcffe2222c10e1122d33d1122b33d11dd31223
1dd412241dd61ed56225a41fa31f821f811f1dd7722f2dd700e61dd50b4e00e4
822920dd822d20d0822020d1822120d2822220d3822320d4822420d5822547a0
09009500008009001080018c0c06018c4c06018c0c00d8ffe405018c00004000
60805fa048805fa04c805fa00000700100007f0068805fa06c805fa000000080
44815fa0000000430000003f900d018c00008020000080429a99193fff0000ff
000000e0040000e0080000e00c0000e0100000e0140000e0180000e01c0000e0
14805fa000407e010000fffff4805fa0000001004c805fa000007c0100003f00
68805fa0000000439a99193fff0000ff1880018c200a7ca41c80018cdfff0000
00f800000000484300809f4300007042000052436666663f038829071ceddd47
3b27722340e7fc377457722a8dd76227822922240c7722278bddd22508772227
830310410c8d017002c840e6fc36c4160089b41601c8df8de36684d6ddaf0388
82d9941f82d1131f82d8821f82d1111f82ddd22fffe782d682d583d00b4008e4
941f82d1131f821f81d1111fd22fffe780d681d57cd10b4108e480d980d44229
80dc81d2222c6fda80d1122a80db81d6622b81de00e8822e80d3822380d58225
80d782278309a2297fd1122c7fd7722ad22b822e8223ffe222257ad082208309
a229122c7ad3322ad22b822e79d1fc751225fc702220087582258309a22976d0
022c722ad22b122ef87582250475222504758225830971d55229022c322ad22b
122e66d012200470222004708220830942295dd4422c6ad4422a622b822e5fd6
8226fc7082205fd482248309a22965d6622c722ad22b822efc708220fc742224
087082208309a229622c322ad22b822efc74122452d6222682208309a2295ad6
622c722ad22b122e82244dd72227822083095229622c322ad22b122e12242227
8220830951d2241f131f621f50d1111fd22fffe738d5549433dd0b4d00e64dd1
122939d0022c34d1122a4bd1122b32d2222e30d439d3422339d5822539d68226
830900e300e2b36a24de5369ffe8636420a004e523671cd140db236640dccb27
26dc722c27dd022d16d0b220e22a2adb122b2ad7622782292224830c122c622d
8220222a222b222722292224830c10456c8d017302e1336002c8028d3921d6a6
01c801c8018964a603882ed01821d18f13672adbd2af13662ad003d12adbcdaf
13668000080000e00000803f00006b430000f04100005743000020410000003f
00c0003400208020900d018c00005c4200000c4200c0003600008020000000e0
08000080040000e0000000c0002480200c0000e000c80088100000e0140000e0
180000e01c0000e00000f0420000e041000050420000004300002043080000f0
0004802000002443000040430000604300008042c80000800002003000005643
c80000e00000484300006c43b7d8b8dbb41fb8dcc31fb8d9921fb8d1111fb8dd
d22fb8daffe7b8d683650b4a08e4b41fb6d1131f921fb6d1111fd22fffe7b5d6
83650b4a08e4b4d2241fc31fb3d3321faad4411fd22fffe7b1d6b2d50b4a08e4
b1d900e88229b1dc822cb1db822bb1de822eb1d58225b1d68226b1d78227b1d0
82208309b0d5b1d1111fb1d1122fb1d75366b1d20b4200e4acd3311fafd1122f
afd7b0d6b0d5acd00b4000e4afd11229822c822b822e02e29fd1222106e19fd3
12239fd422249fd5122583099fd6611fa5d7722fa6d7a7d6a7d5a8d49ed00b40
09008229822c822b822e93d1822193d2822293d3822393d482248309a0d5541f
a0d1131fa0d6621fa0d7711fd22fa0d6a0d5a1d40b4affe799d0041f9fd1131f
99d1121f75d2211fd22f9dd699d59ad40b4affe78229822c822b822e7ed38223
7ed482247ed582257ed68226830995d7741f8ed0031f94d1121f94d2211f94d3
322f94d794d595d40b4a00e68dd4441f93d5531f8cd6621f92d7711f92d0022f
92d78dd58dd40b4a00e68229822c822b822e69d1822169d2822269d3822369d4
822483098ad18bd222218bd1141f5ad5531f8ad1121f59d6611f89d1122f89d7
00e658d50b4a00e466d7741f86d1131f7bd0021f85d1111fd22f85d785d58294
0b4a00e68229822c822b822e52d1822152d2822252d3822352d4822483097ed5
522f7edd7ed77fd67fd580d40b4d090079d6622f7ed77fd67fd580d40b4d0900
50d7741f59ddd31f65d0021f5fd1111f5fd2222f5fd760d560d40b4a00e649d3
341f5fd4431f421f5ed5511f5ed6622f5ed759d559d40b4a00e68229822c822b
822e35d7822735dd822d35d0822035d1822183096ad1ffe222213591f5501030
0189e5a4090067d267d1226001c8018d1041fa8b65d166d2222166d166d22221
047166d22221047165d22221047143d22221047163d2222163d364d220e12223
01721041fb8f047361d162d22221147101e22221136254d1226001c8018d1041
fa8bb8a409008000960009001b00802000000c4200008c430000a04000007a43
0000003f900d018c00c00f0c00809d4300808e4300c80f0c00008c4200002042
00d00f0c00008020000000e0040000e0080000e00c0000e0100000e0140000e0
180000e01c0000e00000a0420000403f0000c84200007043600c018c00006f43
000074430000524300005c430000002000000043000044430000804200000200
00005c42000068430000f0410000484300c40030000090200800000400008d43
00c6003000002a430000024300000c439a99193fff0000800000909400000002
000034430000f0429a99993e0000ff8060815fa0000000800000d8420000be42
3333333fffff00ff0000964300008043ffffff80000090806666663f400d018c
0000d442000082420000c2420000344200004d43000091430000394300008743
14805fa0186c5fa080841e0000e100ac7856341200e000ac2200008000e1000c
0c0100220000006514e000ac0001dec0046c5fa000e0000c6fd2226101711222
f5503c88028ff55032a209004288048ffc5dd82d018bb1a2090068d10b410900
67d10b4110e467d11262f5539c73c0911633028ffa51afa2f5502831fd5d163d
008b1d1ffe5d123d00891e1fff5d1c3ddf1f2a1f00e14ce0fe022822038d1821
01890fa30900028d3fe1ffa2fe52f5501630018baba201c80170051ff5503c88
028f3ce1fda909001630028f1e88e5a9f550028f2d88eaa90900028f0f88eba9
0900018991a3f55047d10b4101e4f55003c90388028df55077aa3fe13fe11630
018959aa0362f55001c8018b76aa09003ed13fdb122b3fd1126340e2fc323412
3dddd2644512b265561201e2222120e1122d3ad1122b3ad13ad612263ad71227
3ad13bd012203bd1141f131f00e8821f811f39d2222f39de4c9700e638d50b4e
00e438daa41fa31f821f811f36d1122f36d700e632d50b4e00e435d9822935d3
822335d4822435d5822535d6822635d7822735d0822035d18221830934dcffe2
222c10e1122d33d1122b33d11dd312231dd412241dd61ed56225a41fa31f821f
811f1dd7722f2dd700e61dd50b4e00e4822920dd822d20d0822020d1822120d2
822220d3822320d4822420d5822547a009009500008009001080018c0c06018c
4c06018c0c00d8ffe405018c0000400060805fa048805fa04c805fa000007001
00007f0068805fa06c805fa00000008044815fa0000000430000003f900d018c
00008020000080429a99193fff0000ff000000e0040000e0080000e00c0000e0
100000e0140000e0180000e01c0000e014805fa00000740100003f0000ff00ff
8309ffe6622c8fd112611821018bb8a901e28dd1126177e22631028d01718ad2
12228ad112611821018b03aa01e288d111611d6187d22031028987d101e22221
86d112600820018b41aa090009e11630018b84aa0a88017080d1022180d150e0
fe055221047154e0fe066221147158e0fe07722108717bd2222104717ad22221
7ad111600d607ad111611f88028f1d617caa090077d678d240e1236740e36127
1043fc8f0277c8931041f68f3c32c591f5501630290271d1088f222170d171d2
2221bc911030018b6fd110616fd170d222216ad112611821018969aaffe76dde
ae9d6ddbb41f6dd1131f6ddaa21f6ddcc11f6dd9922f6dd8ffe700e6e3650b48
d364b41f6ad1131fa21f6ad1111f922f69d700e669d50b48d364b41f68d1131f
a21f68d1111f922fffe767d689940b48e36566d1141f66d1131f66d1121fc11f
922fffe700e664d50b4800e463d1141f63d1131f63d1121f63d1111f922fffe7
62d663d50b4808e462d163d2222163d263d332220472e222047200e332220472
60d33222047232220472322204723222830100e051dc5cdb5cde136357da5cd9
41d85cd400e25cd57eaa04e15bd1222100e15bd210220c720ae3302204721022
58d1a0e2202158d258d1206008c8018f1041fa8b54d1106008c8238d13e26871
212100e221210ae331212121212121214dd24ed1206008c8018f1041fa8b4ad1
106008c8118968711162116011621162116144d220620fc918401c610b2144d2
cead122243d1faaf090042d1f7af090041d00b4000e485a00c1f000103010601
800088002480018c2080018c2c80018c280a78a41ff800001c80018c1880018c
48805fa000007f020000df01140a70a4c80a70a400f80000804070a42880018c
68805fa00000c700010071a044815fa000000080000080200000dc4200000043
00008c42000000420000003f900d018c0000304300001043ffffff8000009080
00009043000040430002003000005c420000c0420000f0410000002000002f43
000096430000fa4200007a4300000e0c24008020000000e020000080040000e0
000000c00000803f00004343000057430c0000e0100000e0180000e00880018c
84705fa09c705fa018705fa0a08601000480018cffff0000e407018c61d00b40
01e40c1f60d10b41090060d10b4110e45fd112625ead2a1fac9110301f8ff65d
d82d1c895bd1a69332215bd1dc312a1f5ad212225ad112611821078df5502262
58d11032038f01c8cda00ae201c8018beca0090054d155d212224dadf5508991
f5501030d68fce71fe53fd5dd8331633298dff5d4ed3dc337e911633298d48e0
fe0008202a8df75d42d1769332212a1fff5d47d2dc326f911632628d48e0fe00
0820618ff75dd82d618f4ce0fe000820028d40e094a00900fe011821278d1363
3cd1b5af3c3133d1589332213ad1afaf2a1f30d153933221daaf2a1fd82d0e8d
5ce02cd1fe0002212a1ffe52fd5dd8324291163230d19b8dff5dcaaf09002a1f
e9ac01e123d13b922221efaffe52f9500820038df85d29d18aaf0c31d82d0289
27d185afdc31fb5dd82d028925d17fafdc31fc5dd82d038d44e023d178afdc31
01e1fe021732038f44e020d170af2c31fe000188028913d16aaf09001cd167af
09001cd164af09001bd161af09001bd15eaf0900fa00e003c8001f7c007cff03
007e0900e407018c0c06018c4c06018c0c00d8ff10905fa00001d0ba4840018c
1080018c0d600d600000400050805fa043c721fe0008d0ba0200d0ba0009d0ba
000ad0ba000bd0ba000dd0ba0007d0ba4d4d0d600300d0ba0400d0ba0500d0ba
56d125af090056d11261c9712631128954d112611821138953d112629d911032
028952d108a0090051d1126118210a8950d101a0090050d150d2122216aff550
4fd1f9af09004fd1f6af09004ed112af090029071ce61821028d6d479ca90900
4ad04bdb4bd669a909000820048d1fe301902300f55056ed47d240e131221041
fc8f027245d146d2222146d1ffe2222145d10b41090045d110600fc90688018b
faab090042d1126118211f892dd1126118211b8f0820028d09e1e7ad01e27ce0
160f7ce3fc3311133ad1126004e700e600e50b4033647ce0fe011821028d01e2
23d122211ed2226101711222d9abf55031d222621071103202ed068fd81f2fd1
1261503102ed048dd81f01922302090078e8019123010900b6e8336003882907
1ce11d4726d01bd119db07a91366f48f182123d02ba909004121017002715630
058f20c8d62f019d230df66daeeaf38f2364f1af336436a0936228060600d0ba
0c80018c0880018c0480018c030cd0ba0080018c040cd0ba010cd0ba4840018c
020cd0ba9d5a0d60000020000000484300006c430000803f00807ea444815fa0
0000008014805fa08c05018c8c705fa01080018cbc00008c1000a0ff1400a0ff
000070438362212101700271a630c28f0388f78d46302c8f66302c8b31210170
5888f38f027115d12792222114d215d1292115d33b2113662367e07713d518e3
52271043fc8f047711d30ce77223fc7310e772230fd708e3722101771043fb8f
047183060bd700e101e60195230508e3fadcc8af5362c6af736280001c815fa0
e040018ce0ffff03000000e0111111113c0000ffe0ffc0004000000064000000
00000000400100000e00000000000000100000000a0000000000000001000400
000004000300040001000c000100240001000400010000000200000000010000
000200000303000000017f80ff000000000000000100000002000000ffffff7f
0000008001000080ffffffff78563412efbeadde000001005345474120534547
414b4154414e4120000000000000000017b7d1380000000000000000ffffffff
000020440000000017b7d1380000803f00000000ffffffff000000000000f043
17b7d138000000000000803fffffffff
14805fa00000740100003f0000ff00ff8309ffe6622ca8d112611821018ba0a9
01e2a6d1126177e22631028d0171a3d21222a3d1a3d22221a3d1a4d22221a4d2
2261017112220ae22631018bafa90900a0d7a1d1141f131f00e8821f811f9fd1
122f00e69ed59fd10b4100e49ed182219ed28222047282220472822204728222
047282220472822204728222830198d1ffe2222197d112611821018bbea901e2
95d111611d6195d22031028994d101e2222194d112600820018bfca9090009e1
1630018b3faa0a8801708ed102218ed150e0fe055221047154e0fe0662211471
58e0fe077221087188d22221047188d2222188d111600d6087d111611f88028f
1d6137aa090085d685d240e1236740e361271043fc8f0277c8931041f68f3c32
c591f550163029027ed1088f22217ed17ed22221bc911030018b7dd1106162d1
62d2222177d112611821018924aaffe763deae9d77dbb41f77d1131f77daa21f
77dcc11f5dd9922f5ed8ffe700e6e3650b48d364b41f73d1131fa21f72d1111f
922f72d700e672d50b48d364b41f71d1131fa21f70d1111f922fffe76fd68994
0b48e3656ed1141f6ed1131f6ed1121fc11f922fffe700e66cd50b4800e46cd1
141f6cd1131f6cd1121f6cd1111f922fffe76bd66bd50b4808e443d16ad22221
42d26ad332220472e222047200e33222047267d3322204723222047232220472
3222830100e05adc62db63de136337da62d932d862d400e262d539aa04e162d1
222100e161d210220c720ae33022047210225fd1a0e220215ed25fd1206008c8
018f1041fa8b5bd1106008c8238d13e26871212100e221210ae3312121212121
212154d254d1206008c8018f1041fa8b50d1106008c811896871116211601162
116211614ad220620fc918401c610b214ad29dad12224ad1faaf090048d1f7af
090048d00b4000e492a00c1f0001030106018000880009002480018c2080018c
60805fa00000600144815fa0000000802c80018c0000ffff000080420000003f
00008020900d018c000000e0040000e014805fa03080018c280a78a41ff80000
1c80018c1880018c48805fa000007f020000df01140a70a4c80a70a400f80000
804070a42880018c68805fa00000c700010071a00000dc420000004300008c42
000000420000304300001043ffffff8000009080000090430000404300020030
00005c420000c0420000f0410000002000002f43000096430000fa4200007a43
00000e0c2400802020000080000000c00000803f00004343000057430c0000e0
100000e0180000e00880018c84705fa09c705fa018705fa0a08601000480018c
ffff0000e407018c61d00b4001e40c1f60d10b41090060d10b4110e45fd11262
20ad2a1fac9110301f8ff65dd82d1c895bd1a69332215bd1dc312a1f5ad21222
5ad112611821078df550226258d11032038f01c8cda00ae201c8018beca00900
54d155d212220fadf5508991f5501030d68fce71fe53fd5dd8331633298dff5d
4ed3dc337e911633298d48e0fe0008202a8df75d42d1769332212a1fff5d47d2
dc326f911632628d48e0fe000820618ff75dd82d618f4ce0fe000820028d40e0
94a00900fe011821278d13633cd1b5af3c3133d1589332213ad1afaf2a1f30d1
53933221daaf2a1fd82d0e8d5ce02cd1fe0002212a1ffe52fd5dd83242911632
30d19b8dff5dcaaf09002a1fabac01e123d13b922221efaffe52f9500820038d
f85d29d18aaf0c31d82d028927d185afdc31fb5dd82d028925d17fafdc31fc5d
d82d038d44e023d178afdc3101e1fe021732038f44e020d170af2c31fe000188
028913d16aaf09001cd167af09001cd164af09001bd161af09001bd15eaf0900
fa00e003c8001f7c007cff03007e0900e407018c0c06018c4c06018c0c00d8ff
10905fa00001d0ba4840018c1080018c0d600d600000400050805fa043c721fe
0008d0ba0200d0ba0009d0ba000ad0ba000bd0ba000dd0ba0007d0ba4d4d0d60
0300d0ba0400d0ba0500d0ba56d125af090056d11261c9712631128954d11261
1821138953d112629d911032028952d108a0090051d1126118210a8950d101a0
090050d150d2122216aff5504fd1f9af09004fd1f6af09004ed112af09002907
1ce61821028d6d4718a909004ad04bdb4bd61ca909000820048d1fe301902300
f550aaec47d240e131221041fc8f027245d146d2222146d1ffe2222145d10b41
090045d110600fc90688018bbcab090042d1126118211f892dd1126118211b8f
0820028d09e1daad01e27ce0160f7ce3fc3311133ad1126004e700e600e50b40
33647ce0fe011821028d01e223d122211ed22261017112229babf55031d22262
1071103202ed068fd81f2fd11261503102ed048dd81f019223020900cce70191
230109000ae83360038829071ce11d4726d01bd119dbbaa81366f48f182123d0
dea809004121017002715630058f20c8d62f019d230df66d02eaf38f2364f1af
336436a0936228060600d0ba0c80018c0880018c0480018c030cd0ba0080018c
040cd0ba010cd0ba4840018c020cd0ba9d5a0d60000020000000484300006c43
0000803f00807ea444815fa00000008014805fa08c05018c8c705fa01080018c
bc00008c1000a0ff1400a0ff000070438362212101700271a630c28f0388f78d
46302c8f66302c8b312101705888f38f027115d12792222114d215d1292115d3
3b2113662367e07713d518e352271043fc8f047711d30ce77223fc7310e77223
0fd708e3722101771043fb8f047183060bd700e101e60195230508e34edcc8af
5362c6af736280001c815fa0e040018ce0ffff03000000e0111111113c0000ff
e0ffc000400000006400000000000000400100000e0000000000000010000000
0a0000000000000001000400000004000300040001000c000100240001000400
010000000200000000010000000200000303000000017f80ff00000000000000
0100000002000000ffffff7f0000008001000080ffffffff78563412efbeadde
000001005345474120534547414b4154414e4120000000000000000017b7d138
0000000000000000ffffffff000020440000000017b7d1380000803f00000000
ffffffff000000000000f04317b7d138000000000000803fffffffff
""")
+19 -2
View File
@@ -473,12 +473,19 @@ static void ta_volume_triangle(u32 x0, u32 y0, u32 x1, u32 y1, u32 x2, u32 y2, u
* DMA writes cyan over the top half of the first and over all of the
* second, and a third, at frame 80, green over the 8 by 8 texture at
* DMA_TEXTURE that was blue and drawn since frame 64. The top right of the
* screen shows the three: cyan over yellow, cyan, green. */
* screen shows the three: cyan over yellow, cyan, green.
*
* And a fourth, 64 by 64 at DMA_SHAPE, rendered every frame - red for ten
* frames, blue after - and drawn as a texture of another size, 32 by 32:
* a texture made from the memory a render covers is made again when that
* memory is rendered to again, as when it is written. Blue, beside the
* green. */
#define DMA_HALF (RTT_ADDRESS + 0xE0000)
#define DMA_WHOLE (RTT_ADDRESS + 0xE4000)
#define DMA_TEXTURE (RTT_ADDRESS + 0xE8000)
#define DMA_SHAPE 0x600000
#define DMA_SOURCE 0xAC800000 /* what the DMAs copy, in main memory */
static u32 rtt_dma_done;
static u32 rtt_dma_done, rtt_shape_frames;
/* @len bytes from DMA_SOURCE to video memory at @to, by PVR-DMA */
static void pvr_dma(u32 to, u32 len)
@@ -819,6 +826,10 @@ static void ta_scene(void)
F(285.0f), F(5.0f), F(315.0f), F(35.0f));
ta_quad(TA_TEXTURED, TSP_PLAIN, (1u << 27) | (1u << 26) | (DMA_TEXTURE >> 3), 0xFFFFFFFF, F(0.5f),
F(250.0f), F(40.0f), F(280.0f), F(70.0f));
/* DMA_SHAPE's render, as a 32 by 32 texture */
if (rtt_shape_frames != 0)
ta_quad(TA_TEXTURED, TSP_PLAIN | (2u << 3) | 2u, (1u << 27) | (1u << 26) | (DMA_SHAPE >> 3), 0xFFFFFFFF, F(0.5f),
F(285.0f), F(40.0f), F(315.0f), F(70.0f));
#endif
#ifdef LIVE_CULL
/* With -DLIVE_CULL, on the left: two white polygons that take shadows,
@@ -928,6 +939,12 @@ static void render_to_texture(void)
else if (rtt_static_age < 120)
rtt_static_age++;
#ifdef LIVE_DMA
PVR(0x60) = 0x01000000 | DMA_SHAPE;
PVR(0x144) = 0x80000000; /* TA_LIST_INIT */
ta_quad(0, TSP_PLAIN, 0, ++rtt_shape_frames <= 10 ? 0xFFFF0000 : 0xFF0000FF, F(0.5f), F(0.0f), F(0.0f),
F(64.0f), F(64.0f));
ta_send(0, 0, 0, 0, 0, 0, 0, 0);
PVR(0x14) = 0xFFFFFFFF; /* STARTRENDER */
if (!rtt_dma_done)
{
rtt_dma_done = 1;