Update synth.c to build with new chai-notes
authorCafe <cafe@not.applicable>
Tue, 1 Aug 2017 20:08:32 +0000 (20:08 +0000)
committerCafe <cafe@not.applicable>
Tue, 1 Aug 2017 20:08:32 +0000 (20:08 +0000)
src/synthesise.c

index 83b5f1ca36ec2cfb90c5b950407a8a1265730f34..921f858efff1c9bd44dfb6c75c9cea895538e9f5 100644 (file)
@@ -170,17 +170,17 @@ uint64_t import_shader(int fd, uint8_t *shader, size_t sz, bool fragment)
 
 uint32_t upload_vertices(float *vertices, size_t sz)
 {
-       struct vertex_buffer *vb;
-       vb = (struct vertex_buffer*) galloc(sizeof(*vb));
+       struct attribute_buffer *vb;
+       vb = (struct attribute_buffer*) galloc(sizeof(*vb));
        
        float *verts = (float*) galloc(sz);
        memcpy(verts, vertices, sz);
-       vb->vertices = (uint64_t) (uint32_t) verts;
+       vb->elements = (uint64_t) (uintptr_t) verts;
 
-       vb->vertex_size = sizeof(float) * XYZ_COMPONENT_COUNT; 
-       vb->size = sz;
+       vb->element_size = sizeof(float) * XYZ_COMPONENT_COUNT; 
+       vb->total_size = sz;
 
-       vb->vertices |= 1; /* TODO flags */
+       vb->elements |= 1; /* TODO flags */
        
        return (uint32_t) vb;
 }
@@ -215,8 +215,8 @@ struct job_descriptor_header* vertex_tiler_helper(int fd, bool tiler,
                .null2 = 0,
                .unknown2 = (uint32_t) galloc(32),
                .shader = (uint32_t) galloc(sizeof(struct shader_meta)),
-               .vertices = vertex_buffer,
-               .unknown4 = (uint32_t) galloc(16),
+               .attributes = vertex_buffer,
+               .attribute_meta = (uint32_t) galloc(16), /* TODO */
                .unknown5 = (uint32_t) galloc(32),
                .unknown6 = (uint32_t) galloc(64),
                .nullForVertex = tiler ? (uint32_t) galloc(64) : 0,
@@ -254,11 +254,12 @@ struct job_descriptor_header* vertex_tiler_helper(int fd, bool tiler,
                s->unknown2 = 0x0000000000420002;
        }
 
-       /* I have *no* idea */
-
-       uint32_t *p = (uint32_t*) payload.unknown4;
+       /* TODO: Generate on the fly (see trace.c) */
+       uint32_t *p = (uint32_t*) payload.attribute_meta;
        *p = 0x2DEA2200;
 
+       /* I have *no* idea */
+
        uint64_t pi[] = {
                0x0000000017E49000, 0x0000000017E49000, 
                0x0000000017E49000, 0x0000000017E49000, 
@@ -335,8 +336,8 @@ struct job_descriptor_header* vertex_tiler_helper(int fd, bool tiler,
 
                payload.unknown1 = 0x5AB02A00;
                payload.unknown2 = 0x5AB03A00;
-               payload.vertices = 0x5AB04A00;
-               payload.unknown4 = 0x5AB05A00;
+               payload.attributes = 0x5AB04A00;
+               payload.attribute_meta = 0x5AB05A00;
                payload.unknown5 = 0x5AB06A00;
                payload.unknown6 = 0x5AB07A00;
                payload.unknown7 = 0x5AB0DA00;
@@ -384,8 +385,8 @@ uint32_t job_chain_vertex_tiler(int fd,
                                zero_buffer, mode,
                                fragment_shader, fs_sz);
 
-       set->next_job = (uint32_t) vertex;
-       vertex->next_job = (uint32_t) tiler;
+       set->next_job._32 = (uint32_t) vertex;
+       vertex->next_job._32 = (uint32_t) tiler;
 
        /* TODO: Determine if these numbers are meaningful */
        set->job_index = 3;