Can Stage3d be used for parallel computing?

I used to program cards in AS3 like you, but then I took the Pixel Bender in my knee. Since then, I have used the Pixel Bender for parallel computing on arrays. Can Stage3D be used for this?

An example of using Pixel Bender to calculate:

http://wonderfl.net/c/eFp0/

My goal is to get the vector [x1, y1, x2, y,2 , . . ., xn, yn] [x1, y1, x2, y,2 , . . ., xn, yn] [x1, y1, x2, y,2 , . . ., xn, yn] and return the vector [f(x1), f(y1), f(x2), f(y2), . . . ,f(xn), f(yn)] [f(x1), f(y1), f(x2), f(y2), . . . ,f(xn), f(yn)] [f(x1), f(y1), f(x2), f(y2), . . . ,f(xn), f(yn)] . More like f(x1, y1).x , f(x1,y1).y . I'm sure you got the general idea.

What we usually call a map. Here is a detailed explanation.

http://en.wikipedia.org/wiki/Map_%28higher-order_function%29

I noticed that with the Pixel Bender, I can achieve this with a 10x speed increase. Is there a way to do the same with Stage3D.

+4
source share
1 answer

Unlike other languages, such as C ++, I don’t know how to direct assembly instructions on the GPU outside of Program3D fonts with Adobe Graphics .

Software bytecode can be created using Pixel Bender 3D offline tools. It can also be created dynamically. The AGALMiniAssembler class is a utility class that compiles AGAL assembler programs for AGAL bytecode. The class is not part of the runtime. When you load shader programs, the bytecode is compiled into your own shader language for the current device (for example, OpenGL or Direct3D). runtime checks for bytecode at boot time.

Programs run whenever the Context3D drawTriangles () method is called. A vertex program is executed once for each vertex in the list of triangles. The fragment program is executed once for each pixel on the surface of the triangle.

Without getting closer to the performance you get with Pixel Bender, you should note that you can use ActionScript Workers to parallelize your functors.

A work object is a work object that is a virtual instance of Flash runtime. Each instance of Worker monitors and provides access to the life cycle and shared data of one worker.

This ability to execute multiple sets of instruction code simultaneously is known as concurrency.

Thanks to the features of Adobe Premium, Alchemy / FlasCC, XC API, Pixel Bender and ActionScript Next, this is an exciting time for a fast-paced Flash platform.

+2
source

Source: https://habr.com/ru/post/1439587/


All Articles