shithub: gpufs

ref: 8b6238bf263ac5d1f357c0f4a4d0e113b83f1570
dir: /vm.h/

View raw version
void vmrun(u32int *ptr);
void runstack(u32int *ptr);
void retstack(void);
int runshader(vlong id, char *entrypoint);

enum {
	BUFFER,
	SHADER,
};

// object id
vlong genshader(void);
vlong genbuffer(long size);

vlong getnumobjects(void);
vlong getobjectid(vlong num);
long getshaderlength(vlong id);
long getbufferlength(vlong id);
int getobjecttype(vlong id);

// length data written, success
int writeshader(vlong id, void *data, long n, long offset);
int writebuffer(vlong id, void *data, long n, long offset);
int compileshader(vlong id);

// length data written
int readshader(vlong id, void *data, long n, long offset);
int readbuffer(vlong id, void *data, long n, long offset);

char* getobjectinfo(vlong id);

// descriptor sets
int gendescpool(int numsets);
int getnumdescpools(void);
char* getpoolinfo(void);
int allocdescset(int pool, int set, int numbindings);
int binduniform(vlong id, int pool, int set, int binding);
int bindshader(vlong id, int pool);