SoylentGraham
Posts: 12
Joined: Sun Nov 19, 2017 10:52 pm

v3d Thread 1 won't execute... VCD is idle?

Sun Nov 19, 2017 11:06 pm

So I've been trying to get bare metal in c/++ going using everyone's great examples :)

There has been a little discrepancy between the different sources I've been going through (the hackdriver, PeterLemon's ASM examples etc), so nothing has quite worked straight away, but I'm clearly close :)

I've got mailboxes working, I can setup the framebuffer and draw to it, easy peasy.

I've got a program setting up bin control (and clipping, viewport, triangle setup etc) loaded and execute on the first control list thread, and I check the thread has finished, no errors. (checking V3D_CT0CS 's bit 3)

I load another program on thread1, the render thread, which clears, sets framebuffer address, instructs to store the tile buffers, and if I understand right... execute code in each tile bin?) finishing with a flush/flush all state

Then I execute, and check the result... the thread is finished, but the error bit is set. The videocore IV documentation gets incredibly... spare here. I ASSUME I'm supposed to check V3D_ERRSTAT, so I do, and bit 12 is set, which the documentation says VCD Idle ... Is this good or bad? does it mean I didn't give the GPU anything to do? do I need to setup something for DMA to... finish? have I missed a command?

I can't find any other information on errors and diagnostics, so I'm a little stuck.
I can't find any examples of people doing ANY error checking (and 17 years of doing video game console work, this doesn't suprise me ;) so there's no help there!

Does anyone have any idea why the DMA being idle is bad?

SoylentGraham
Posts: 12
Joined: Sun Nov 19, 2017 10:52 pm

Re: v3d Thread 1 won't execute... VCD is idle?

Mon Nov 20, 2017 6:01 pm

I've managed to get past this error... at first... by AND'ing my framebuffer address with 0x3FFFFFFF to get the proper address the QPU needs (I think that's right :). I can write to it at either address to draw pixels on screen, so this didn't quite click that memory needs to be referenced in a certain space.

The memory I'm using for my programs, vertex data etc (addressed to the QPU scheduler) is global memory in my C program, so all around 0x8000 I believe (my linker script places text & bss sections from there)

Now, the FIRST tile clears. No error. But only one tile. I load my bin & render programs again, with a different clear colour, and no change on screen. (Maybe the QPU needs to be reset after an error? docs say just start again)

I realised my stride between bin-addresses to branch to wasn't spaced by 32 bytes, I was just spacing 32bit instructions. Silly mistake.

Now, I get about 6 tiles cleared (certainly not all of them) before I get the same error status and VCD Idle error code.

Also interestingly, changing certain bits of code, and some reboots (I normally short the RUN pins to reset every time I load a new kernel to the SDcard remotely) causes the error, and sometimes it doesn't.
This is leading me to think I'm trashing memory somewhere. I've seen examples where people are allocating GPU memory, and others are just loading straight from the ROM seemingly with okay results, so I guess it's not TOO important where this memory comes from? (alarm bells going off in my head)
so I guess data I'm giving to the QPU for bin state & bin data (instruction lists, right?) okay, but then the QPU falls over and gives me this error.
Maybe I need to zero/halt/nop all my bin data first? (I'm using the auto_initialise flag, but perhaps there's bad instructions in uninitialised memory)

Everything is aligned, and I'm pretty sure the memory I'm allocating(reserving) is large enough.

Maybe VCD Idle means, it has been stopped/aborted/needs resetting?

Any suggestions?

LdB
Posts: 826
Joined: Wed Dec 07, 2016 2:29 pm

Re: v3d Thread 1 won't execute... VCD is idle?

Tue Nov 21, 2017 5:27 am

Not sure your memory allocation worries me because you didn't lock it to the QPU from what you describe.
I assume it's important because Eric Anholt does it in his samples so I just followed.

In my sample when I started to rotate a large model (The default diskimg sample is a biplane with 12,000 faces)
https://github.com/LdB-ECM/Raspberry-Pi ... LES2_Model
I ran into the problem the primitive tile binning memory allocation wasn't big enough and that caused memory overruns.

I actually never did work out how you knew how much memory you needed all I noticed is as my models got bigger I would
get partial draws and a crash. So I would then just go and allocate more memory.

Not sure if any of that helps and it's probably easier if you showed us the full code.

SoylentGraham
Posts: 12
Joined: Sun Nov 19, 2017 10:52 pm

Re: v3d Thread 1 won't execute... VCD is idle?

Tue Nov 21, 2017 11:19 am

I'm not even allocating GPU side memory, I'll try switching to that. It seems (and would make sense) you need to lock the GPU memory if you're going to use it if the address are virtual and might get moved around.

> I actually never did work out how you knew how much memory you needed all I noticed is as my models got bigger I would
get partial draws and a crash. So I would then just go and allocate more memory.

This is odd. One's configuration explicitly states the bin size (command 112). Either 32, 64, 128, or 256 bytes. So which bit of memory do you think is overflowing? the instructions in the bin?
I guess you're not allocating more, but in this case reserving more,(still just 8mb) and moving the address of the render control instructions further back?

Code: Select all

#define BUFFER_TILE_DATA		0x6000
#define BUFFER_RENDER_CONTROL	0x1e200
I did wonder what happens if the GPU puts more commands in there than fits... But then I'm just doing a clear, it would seem odd to overflow that.

This is the code... it's grown a bit fast so messy, (refactoring now, hence commit link rather than master)
https://github.com/NewChromantics/PopPi ... .cpp#L1262

Things (ie, sprites which are being drawn straight from memory) only start to get corrupted I *think* when I start putting commands onto the QPU, and if it's overflowing my bin allocations, then that could easily be trashing my other globals.

Perhaps the GPU thinks it's okay to just write relative to (ie, past) the bin allocations if nothing else has been allocating GPU memory, and assumes any address I give it is in the GPU side... then again, GPU memory is surely dictated by the PI, not by videocore?

One other very strange thing is this global... which isn't being initialised correctly... so maybe I need to look at what GCC is compiling my C sections to...
https://github.com/NewChromantics/PopPi ... es.cpp#L82

Maybe time to implement a little memory manager and check over heaps to see what's getting written :/

LdB
Posts: 826
Joined: Wed Dec 07, 2016 2:29 pm

Re: v3d Thread 1 won't execute... VCD is idle?

Tue Nov 21, 2017 1:59 pm

SoylentGraham wrote:
Tue Nov 21, 2017 11:19 am
Perhaps the GPU thinks it's okay to just write relative to (ie, past) the bin allocations if nothing else has been allocating GPU memory, and assumes any address I give it is in the GPU side... then again, GPU memory is surely dictated by the PI, not by videocore?
There is a memory control on the GPU that is what the mailbox commands are about, Remember the GPU pinches half the memory space by default. It allocates you the memory address from it's GPU space and you convert it back to Pi address the same as you do for framebuffer. Again I just followed what Eric does.

Allocate Memory Tag: 0x0003000c
Allocates contiguous memory on the GPU. size and alignment are in bytes. flags contain:

Lock memory Tag: 0x0003000d
Lock buffer in place, and return a bus address. Must be done before memory can be accessed

Unlock memory Tag: 0x0003000e
Unlock buffer. It retains contents, but may move. Needs to be locked before next use. status=0 is success.

Release Memory: Tag: 0x0003000f
Free the memory buffer. status=0 is success

That is all clearly documented on the Pi Mailbox
https://github.com/raspberrypi/firmware ... -interface

SoylentGraham
Posts: 12
Joined: Sun Nov 19, 2017 10:52 pm

Re: v3d Thread 1 won't execute... VCD is idle?

Tue Nov 21, 2017 2:13 pm

Yeah, I read the GPU alloc docs and code. I even implemented it.

I've been trying this morning with explicit GPU allocations but haven't gotten much further. (2 tiles resolve before render thread gets an error status as before)

As I said, I've also seen implementations where Mailbox-allocated memory is NOT used. Again, ambiguity in what is required, and what is functional, and I'm trying to find some clarification. Maybe I'm confusing myself with what's cached, which memory is shared across the chips etc

There is also ambiguity as far as I can tell (only example code) where the addresses supplied to programs, control threads... I ASSUME the addresses are supposed to be in "GPU space", but then maybe they're supposed to be relative to the GPU base address?

What I haven't checked yet, are the base addresses I can fetch from the mailbox

Code: Select all

Get VC memory
Tag: 0x00010006
Get ARM memory
Tag: 0x00010005
Perhaps these will come back with unexpected values...

I'm still convinced I'm giving the QPU an address I shouldn't as sometimes things are being corrupted.

I realised (from comments in your code) I was pushing too many tiles (not rounding down - although you round up :)) for my framebuffer size, but that's not made any difference.

LdB
Posts: 826
Joined: Wed Dec 07, 2016 2:29 pm

Re: v3d Thread 1 won't execute... VCD is idle?

Tue Nov 21, 2017 6:51 pm

You probably notice I carry two addresses for every buffer a GPU locked one and the ARM reduction of that value so I don't confuse myself.

It's this gap that is the memory space I was talking about

Code: Select all

	#define BUFFER_TILE_DATA		0x6000
	#define BUFFER_RENDER_CONTROL	0x1e200
The size I used is 0x18200 and you set it in the binning data setup

Code: Select all

emit_uint8_t(&p, GL_TILE_BINNING_CONFIG);	// tile binning config control 
emit_uint32_t(&p, model->rendererDataVC4 + BUFFER_TILE_DATA);	  // tile allocation memory address

/* >>>>*******  THIS GUY ALLOCATES THE SPACE *****<<<<<< */

emit_uint32_t(&p, BUFFER_RENDER_CONTROL- BUFFER_TILE_DATA); // Space tiles can render into without overlapping data 


emit_uint32_t(&p, model->rendererDataVC4 + BUFFER_TILE_STATE); // Tile state data address
emit_uint8_t(&p, model->binWth); // renderWidth/64
emit_uint8_t(&p, model->binHt); // renderHt/64
emit_uint8_t(&p, 0x04); // config
I don't know how you know how much to allocate Eric and Peter in the triangle samples started with really small values of that buffer.
All I know is as I added triangles I had to allocate larger and larger buffers there or it would stop half way thru render.

So look at your tile binning config control and just make sure you have plenty of memory there.

I might ask Eric to clarify that he has answered a couple of other issues and doesn't seem to mind if I ask simple exact questions.

I got textures running with a bit of help but I still have to do the color conversion to 32bit from file images to release that .. another job.
The shader compiler is a nightmare you have to port the MESA code, yell when you get to it.

SoylentGraham
Posts: 12
Joined: Sun Nov 19, 2017 10:52 pm

Re: v3d Thread 1 won't execute... VCD is idle?

Tue Nov 21, 2017 7:23 pm

After a lot more debugging and verifying all the responses from the mailbox, it looks like the memory around my stack gets a bit messed up after I allocate a first chunk of GPU memory (I’m allocating the things I want separately, more on that in a moment).
This must be error on my part, maybe with my mailbox buffers (these are on the stack)

Changing code affects whether my 2nd or 3rd, 4th gpu allocations succeed which points more towards stack corruption.

I tried to check the base addresses with the mailbox command, (just because I’m on a pi zero) but these never succeed (Can’t remember if they give me an error, but the numbers change between boots or are clearly wrong).

When I cut the code down to just a GPU alloc, if I unlock the memory, I get 0 returned for my data size. Any subsequent GPU allocations fail (although handles often allocate okay, but won’t lock)

When I had code in a state it WAS allocating correct addresses for my GPU buffers, it also seemed like unlocking would fail... that’s a bit strange

I should try and compile your code I suppose, if that works I might as well abandon my stuff anyway and just get onto shader/texture stuff. (I will be needing that, it’s basically my end goal)

I’m basically thinking out loud at this point.
On a side note, pushing through some of the corruption, my whole screen is cleared, but to the wrong colour, or sometimes garbage... definitely moving forward, I can imagine I just have one small array I’m overflowing and breaking everything :)

LdB
Posts: 826
Joined: Wed Dec 07, 2016 2:29 pm

Re: v3d Thread 1 won't execute... VCD is idle?

Tue Nov 21, 2017 7:34 pm

I found your problem in your code ..

// Tile_Binning_Mode_Configuration
addbyte(&p, 112);
addword(&p, (uint32_t)TileBin );
addword(&p, sizeof(TileBin) ); /* No extra space ... needs extra space */
addword(&p, (uint32_t)TileState );
addbyte(&p, TileWidth);
addbyte(&p, TileHeight);
uint8_t Flags = AUTO_INIT_TILE_STATE_CMD;
addbyte(&p, Flags);

Because you haven't got any bin data space you can only render 1 triangle :-)
That is what I suspected, most of the samples kicking around only rendered 1 triangle.
You can imagine what happened when I tried to render 12,000.

If it expected only bin data size it would never need the size given to it, that was how I worked it out.
Last edited by LdB on Tue Nov 21, 2017 7:40 pm, edited 1 time in total.

SoylentGraham
Posts: 12
Joined: Sun Nov 19, 2017 10:52 pm

Re: v3d Thread 1 won't execute... VCD is idle?

Tue Nov 21, 2017 7:39 pm

That sizeof() was for an array, not a pointer. Or at least it should resolve to that... a static_asset() should prove that either way

Might not explain why it got up to like 12 tiles.

More recent code now allocs from GPU :)

LdB
Posts: 826
Joined: Wed Dec 07, 2016 2:29 pm

Re: v3d Thread 1 won't execute... VCD is idle?

Tue Nov 21, 2017 7:42 pm

Dam thought I had it :-(

Update: No that is the problem I am sure of it. Why you are getting 12 is you use this

MAX_TILE_WIDTH*MAX_TILE_HEIGHT*TILE_BIN_BLOCK_SIZE

I was thinking it was just bin width * height .. but you multiple x32 (TILE_BIN_BLOCK_SIZE)

I am telling you it needs to be a lot bigger than make the array much bigger multiply by 1K

Code: Select all

 
uint32_t TileBin[MAX_TILE_WIDTH * MAX_TILE_HEIGHT * 1024] __attribute__ ((aligned(16)));
Tell me if you get more triangles :-)

SoylentGraham
Posts: 12
Joined: Sun Nov 19, 2017 10:52 pm

Re: v3d Thread 1 won't execute... VCD is idle?

Tue Nov 21, 2017 10:50 pm

My first response was going to be... I'm not that far. I've rewound, I wasn't allocating data properly, getting errors from mailbox, and corruption.
Those things were related!

The code I had was (I assume) caching (either on hardware, or in the compiler) the results and not waiting correctly for the proper status'
Because of that, some requests worked, some must have had a delay and gave bad results. OR, ghost results, (it was suspect that a locked memory address was the same as the handle) OR, the asynchronously writing to the memory (which was on the stack, or as static/global) and corrupting things.

I've fixed that! No more corruption, all my memory is allocating without error, without crazy addresses!
Image
https://twitter.com/soylentgraham/statu ... 0106993664

LdB wrote:
Tue Nov 21, 2017 7:42 pm
Dam thought I had it :-(

Update: No that is the problem I am sure of it. Why you are getting 12 is you use this

MAX_TILE_WIDTH*MAX_TILE_HEIGHT*TILE_BIN_BLOCK_SIZE

I was thinking it was just bin width * height .. but you multiple x32 (TILE_BIN_BLOCK_SIZE)

I am telling you it needs to be a lot bigger than make the array much bigger multiply by 1K

Code: Select all

 
uint32_t TileBin[MAX_TILE_WIDTH * MAX_TILE_HEIGHT * 1024] __attribute__ ((aligned(16)));
Tell me if you get more triangles :-)
Now, onto this bit.

Can you explain the logic behind this?
If we know each tile bin is 32 bytes in size, why would I need them to be 1024 bytes large?
Okay, lets say the GPU needs more, (and we're not telling the configuration it's 32/64/128/256 bytes??) and it needs 1k per bin...

When we setup the render program, why are we setting up the tile branches 32 bytes apart still?

ANYWAY!, it's not rendering, no tiles being cleared at all, and stops after 22 iterations. (it did this before)
Digging through the code again, but at least I think everything is safe... even if it's not visible yet :)

LdB
Posts: 826
Joined: Wed Dec 07, 2016 2:29 pm

Re: v3d Thread 1 won't execute... VCD is idle?

Wed Nov 22, 2017 3:39 am

Again I only have limited knowledge of how the tiler works just like you.

I just followed the code in Eric's drm driver and it has these comments.
From what I gleen from it that buffer becomes tile state buffer per bin in the overflow

https://github.com/torvalds/linux/blob/ ... /vc4_v3d.c

This comment seems to make it quite clear you need overflow space

Code: Select all

/**
 * vc4_allocate_bin_bo() - allocates the memory that will be used for
 * tile binning.
 *
 * The binner has a limitation that the addresses in the tile state
 * buffer that point into the tile alloc buffer or binner overflow
 * memory only have 28 bits (256MB), and the top 4 on the bus for
 * tile alloc references end up coming from the tile state buffer's
 * address.
 *
 * To work around this, we allocate a single large buffer while V3D is
 * in use, make sure that it has the top 4 bits constant across its
 * entire extent, and then put the tile state, tile alloc, and binner
 * overflow memory inside that buffer.
 *
 * This creates a limitation where we may not be able to execute a job
 * if it doesn't fit within the buffer that we allocated up front.
 * However, it turns out that 16MB is "enough for anybody", and
 * real-world applications run into allocation failures from the
 * overall CMA pool before they make scenes complicated enough to run
 * out of bin space.
 */
Then inside the allocate we have this which seems to instruct us of the size we need to expect

Code: Select all

/* Set up for allocating 512KB chunks of
 * binner memory.  The biggest allocation we
 * need to do is for the initial tile alloc +
 * tile state buffer.  We can render to a
 * maximum of ((2048*2048) / (32*32) = 4096
 * tiles in a frame (until we do floating
 * point rendering, at which point it would be
 * 8192).  Tile state is 48b/tile (rounded to
 * a page), and tile alloc is 32b/tile
 * (rounded to a page), plus a page of extra,
 * for a total of 320kb for our worst-case.
 * We choose 512kb so that it divides evenly
 * into our 16MB, and the rest of the 512kb
 * will be used as storage for the overflow
 * from the initial 32b CL per bin.
 */
The key point being
=====> the rest of the 512kb will be used as storage for the overflow from the initial 32b CL per bin

>>>>> We need to obviously expect some overflow from our defined bin description <<<<<<

It didn't make much sense to me I just followed what it said and messed around with the values,
because it doesn't seem to shed light on how much overflow to expect. Only later messing around
did I work out more triangles equals more overflow.

If you have some idea what it's doing I would be interested, as I said I am just following what the
linux driver code does.

You can also see why I have the buffer the way I have because that is what Eric does he states it
=> tile state, tile alloc, and binner overflow memory inside that buffer.
I don't know if it's important I just followed it, I can't see any reason the memory can't be spread out.

SoylentGraham
Posts: 12
Joined: Sun Nov 19, 2017 10:52 pm

Re: v3d Thread 1 won't execute... VCD is idle?

Thu Nov 23, 2017 8:11 pm

Okay, after a whole bunch more debugging, it seemed there were some stupid mistakes. (I can only blame myself, rather than lack of sleep :)

1) My code was giving me 0,0 for tile width and height. This may be a main cause of nothing happening. My memory dumps (see 2) were all zeros for commands (very suspicious)

Code: Select all

//dumb mistake
(mWidth % 64)/64
2) I did memory dumps of the tile bins after setting up the bins and executing to tell where the alignment is. 32 bytes per bin, as we'd expect (I'm just clearing at this point, so presumably not worrying about overflow)

3) Setup multiple heaps to easily switch between large split allocations, static allocs, gpu allocs. (TLDR, all of them work!)

4) Code was now executing, no errors, nothing on screen. No errors made me think maybe it's drawing and failing. I was drawing BGRA(0,255,255,255).. maybe this was wrong (changed to all white)
What else stops GPU's from drawing... flushes

5) I played with flushes/flush all and nops/halts on the programs.
Flush/Flush+State a t the end of the Bin control is required.
Flushes on the render thread, cause render thread error.
Adding NOP/HALT to the render thread makes no difference.
Adding NOP/HALT to the Bin thread causes render thread error.

I now have a clearing screen! Even if it's not super fast yet.
Works from GPU memory, (one big allocation, or many small ones), or CPU allocated.

I'm not masking any memory addresses other than the screen buffer (and 0x3FFFFFFF)

In case anyone is curious, another c++ take on the system :)
https://github.com/NewChromantics/PopPi ... 89ed48ba6e

Now to try triangles!

SoylentGraham
Posts: 12
Joined: Sun Nov 19, 2017 10:52 pm

Re: v3d Thread 1 won't execute... VCD is idle?

Fri Nov 24, 2017 5:57 pm

The shader compiler is a nightmare you have to port the MESA code, yell when you get to it.
After a lot of faff, I have triangles!
Basically, the renderer will hang if I mix the wrong frag shader (which does or does not reference varyings) with a vertex layout.
So I'm using the colour-interpolated frag shader with the hackdriver vertex (x/y, z, w, r, g, b) and I can't do any other combinations, so...

I need to look into compiling shaders now (other than being restricted to this one shader)

Got any useful directions?

LdB
Posts: 826
Joined: Wed Dec 07, 2016 2:29 pm

Re: v3d Thread 1 won't execute... VCD is idle?

Mon Nov 27, 2017 4:46 pm

Basically you have four choices depending what you want to do

1.) Use a NIR byte code or LLVM to make GPU code from your shader code

The best source of that is MESA on Eric's Github
https://github.com/anholt/mesa/tree/master/src/compiler
You want shader -> NIR - >VC4
Image

The advantage is it's hardware and fast but it's a lot of code

2.) Microsoft has a ROS VC4 compiler for the IOT development they opened up
https://github.com/Microsoft/graphics-d ... oscompiler

3.) Use a simple software shader/render

I have one in C++ which I worked up from Dmitry Sokolov
https://github.com/LdB-ECM/Tiny-Renderer

Slower but very easy to write.

4.) Compile your shader code on linux on the Pi and Save the compiled binary.

It's dangerous but doable.

SoylentGraham
Posts: 12
Joined: Sun Nov 19, 2017 10:52 pm

Re: v3d Thread 1 won't execute... VCD is idle?

Mon Nov 27, 2017 7:24 pm

Ah thanks, despite searching all weekend you’ve managed to come up with 4 whole approaches I haven’t seen :)

I started with the approach of all the vc4 assemblers around, especially when the example projects have basically assembler with them (in the comments).
My big hurdle there was that I couldn’t find one single example that would compile(assemble :) for a frag shader. The bytexode in the examples had the code in comments, but I’ve been unable to get them to work (eg. They contain mov’s Which the assemblers I found don’t accept). So bit of a non starter with no working examples.
I got the all-white frag shader working after a bit of reading and attempted interpretation of the byte code (it needed some nops around the instructions it seemed). But I’m no assembler expert (certainly not machine code)

If I could write frag shaders in assembler that would be fine (assembler is all we had for vertex shaders back in 2005!) but couldn’t get them going.

Is your “software rasteriser” approach still on gpu? Just manually implementing everything like sampling, projection, interpolation of frags on triangles etc?

Will have a dig into these approaches anyway and report back (perhaps a new thread is in order as we’re way past not getting the renderer to execute)

Thanks!

LdB
Posts: 826
Joined: Wed Dec 07, 2016 2:29 pm

Re: v3d Thread 1 won't execute... VCD is idle?

Tue Nov 28, 2017 4:54 am

I haven't tried it there is a simple color frag shader in
qpuasm.js from github.com/hermanhermitage/videocoreiv-qpu
have you tried it?
Just you sound like you had already been going down that path.

Code: Select all

.global entry

entry:
        mov r0, vary; mov r3.8d, 1.0          # Load red varying AB partial to r0; set colour alpha to 1.0
        fadd r0, r0, r5; mov r1, vary; sbwait # add C component of red varying (r5); load green varying AB partial; Request access to tile buffer
        fadd r1, r1, r5; mov r2, vary         # add C component of green varying; load blue varying AB partial
        fadd r2, r2, r5; mov r3.8a, r0        # add C component of blue varying; pack red varying to color
        nop; mov r3.8b, r1                    # pack green varying to color
        nop; mov r3.8c, r2                    # pack blue varying to color
	mov tlbc, r3; nop; thrend             # write pixel colour to tile buffer; signal end of thread
        nop
        nop; nop; sbdone                      # Signal that we are finished with tile buffer

SoylentGraham
Posts: 12
Joined: Sun Nov 19, 2017 10:52 pm

Re: v3d Thread 1 won't execute... VCD is idle?

Tue Nov 28, 2017 8:35 am

That’s exactly the example assembler I had been hunting for!

Where did you find it? I couldn’t see it in the repository, (still can’t) and I can’t see it inside the .js...

Either way, thanks, this looks like what I need to get going! THEN onto textures!

SoylentGraham
Posts: 12
Joined: Sun Nov 19, 2017 10:52 pm

Re: v3d Thread 1 won't execute... VCD is idle?

Tue Nov 28, 2017 8:16 pm

Perfect @LDB! thanks for finding that example. It was just what I needed to get going.

Added some extra formatting for C/++ to fit into my pipeline

Code: Select all

/* Assembled Program */
const uint32_t Frag_Colours[] __attribute__ ((aligned(16))) =
{
/* entry: */
/* 0x00000000: */ 0x958e0dbf, 0xd1724823, /* mov r0, vary; mov r3.8d, 1.0 */
/* 0x00000008: */ 0x818e7176, 0x40024821, /* fadd r0, r0, r5; mov r1, vary; sbwait */
/* 0x00000010: */ 0x818e7376, 0x10024862, /* fadd r1, r1, r5; mov r2, vary */
/* 0x00000018: */ 0x819e7540, 0x114248a3, /* fadd r2, r2, r5; mov r3.8a, r0 */
/* 0x00000020: */ 0x809e7009, 0x115049e3, /* nop; mov r3.8b, r1 */
/* 0x00000028: */ 0x809e7012, 0x116049e3, /* nop; mov r3.8c, r2 */
/* 0x00000030: */ 0x159e76c0, 0x30020ba7, /* mov tlbc, r3; nop; thrend */
/* 0x00000038: */ 0x009e7000, 0x100009e7, /* nop */
/* 0x00000040: */ 0x009e7000, 0x500009e7, /* nop; nop; sbdone */
};
https://github.com/NewChromantics/video ... Formatting

So time to make this do something, and onto textures! (I'll open a new thread when I get stuck there :)

Return to “Bare metal, Assembly language”

Who is online

Users browsing this forum: No registered users and 2 guests