 }@@
 
 @@{
-rtcMapBuffer(EXPR geom,EXPR type)
-=>
-rtcGetGeometryBufferData(geom,type) /* FIXME: check if this should be rtcNewBuffer */
-}@@
-
-
-@@{
-rtcSetIndexBuffer(EXPR geom, RTC_USER_VERTEX_BUFFER_(EXPR vertexSlot) , RTC_INDEX_BUFFER_(EXPR indexSlot));
+rtcMapBuffer(EXPR geom,EXPR type,EXPR slot)
+=>
+rtcGetGeometryBufferData(geom,type,slot) /* FIXME: check if this should be rtcNewBuffer */
+}@@
+
+
+@@{
+rtcSetIndexBuffer(EXPR geom, RTC_BUFFER(RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE,EXPR vertexSlot) , RTC_BUFFER(RTC_BUFFER_TYPE_INDEX,EXPR indexSlot));
 =>
 rtcSetGeometryVertexAttributeTopology(geom, vertexSlot, indexSlot);
 }@@

=>
uniform RTCGeometry geom = rtcNewCurveGeometry (device,type,flags,numPrimitives,numVertices,numTimeSteps);
@@{
rtcMapBuffer(EXPR geom,RTC_INDEX_BUFFER)
=>
rtcNewBuffer(geom,RTC_INDEX_BUFFER,sizeof(uniform int),numPrimitives)
}@@
@@{
rtcSetBuffer(EXPR geom,RTC_INDEX_BUFFER,EXPR ptr,EXPR offset,EXPR stride)
=>
rtcSetBuffer(geom,RTC_INDEX_BUFFER,ptr,offset,stride,numPrimitives)
}@@
@@{
rtcMapBuffer(EXPR geom,REGEXPR(vertex_buffer,RTC_VERTEX_BUFFER.*))
=>
rtcNewBuffer(geom,vertex_buffer,4*sizeof(uniform float),numVertices)
}@@
@@{
rtcSetBuffer(EXPR geom,REGEXPR(vertex_buffer,RTC_VERTEX_BUFFER.*),EXPR ptr,EXPR offset,EXPR stride)
=>
rtcSetBuffer(geom,vertex_buffer,ptr,offset,stride,numVertices)
}@@
@@{
rtcSetBuffer(EXPR geom,REGEXPR(user_vertex_buffer,RTC_USER_VERTEX_BUFFER.*),EXPR ptr,EXPR offset,EXPR stride)
=>
rtcSetBuffer(geom,user_vertex_buffer,ptr,offset,stride,numVertices)
}@@
}@@

@@{
rtcSetBuffer(EXPR geom,EXPR type,EXPR ptr,EXPR offset,EXPR stride)
=>
rtcSetBuffer(geom,type,ptr,offset,stride,/* put buffer size here */)
}@@

@@{

// rtcore_geometry.h

@@{
RTC_MAX_TIME_STEPS
=>
RTC_MAX_TIME_STEP_COUNT
}@@

@@{
RTC_MAX_USER_VERTEX_BUFFERS
=>
65536
}@@

@@{
RTC_MAX_INDEX_BUFFERS
=>
65536
}@@

@@{
RTC_INDEX_BUFFER0
=>
RTC_INDEX_BUFFER
}@@

@@{
(RTCBufferType)(RTC_INDEX_BUFFER+EXPR t)
=>
RTC_INDEX_BUFFER_(t)
}@@

@@{
RTCBufferType(RTC_INDEX_BUFFER+EXPR t)
=>
RTC_INDEX_BUFFER_(t)
}@@

@@{
RTC_INDEX_BUFFER
=>
RTC_BUFFER(RTC_BUFFER_TYPE_INDEX,0)
}@@

@@{
RTC_INDEX_BUFFER1
=>
RTC_BUFFER(RTC_BUFFER_TYPE_INDEX,1)
}@@

@@{
RTC_INDEX_BUFFER_(EXPR slot)
=>
RTC_BUFFER(RTC_BUFFER_TYPE_INDEX,slot)
}@@


@@{
RTC_VERTEX_BUFFER0
=>
RTC_VERTEX_BUFFER
}@@

@@{
(RTCBufferType)(RTC_VERTEX_BUFFER+EXPR t)
=>
RTC_VERTEX_BUFFER_(t)
}@@

@@{
RTCBufferType(RTC_VERTEX_BUFFER+EXPR t)
=>
RTC_VERTEX_BUFFER_(t)
}@@

@@{
RTC_VERTEX_BUFFER
=>
RTC_BUFFER(RTC_BUFFER_TYPE_VERTEX,0)
}@@

@@{
RTC_VERTEX_BUFFER1
=>
RTC_BUFFER(RTC_BUFFER_TYPE_VERTEX,1)
}@@

@@{
RTC_VERTEX_BUFFER_(EXPR slot)
=>
RTC_BUFFER(RTC_BUFFER_TYPE_VERTEX,slot)
}@@


@@{
RTC_USER_VERTEX_BUFFER0
=>
RTC_USER_VERTEX_BUFFER
}@@

@@{
(RTCBufferType)(RTC_USER_VERTEX_BUFFER+EXPR t)
=>
RTC_USER_VERTEX_BUFFER_(t)
}@@

@@{
RTCBufferType(RTC_USER_VERTEX_BUFFER+EXPR t)
=>
RTC_USER_VERTEX_BUFFER_(t)
}@@

@@{
RTC_USER_VERTEX_BUFFER
=>
RTC_BUFFER(RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE,0)
}@@

@@{
RTC_USER_VERTEX_BUFFER1
=>
RTC_BUFFER(RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE,1)
}@@

@@{
RTC_USER_VERTEX_BUFFER_(EXPR slot)
=>
RTC_BUFFER(RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE,slot)
}@@


@@{
RTC_FACE_BUFFER
=>
RTC_BUFFER(RTC_BUFFER_TYPE_FACE,0)
}@@

@@{
RTC_LEVEL_BUFFER
=>
RTC_BUFFER(RTC_BUFFER_TYPE_LEVEL,0)
}@@

@@{
RTC_EDGE_CREASE_INDEX_BUFFER
=>
RTC_BUFFER(RTC_BUFFER_TYPE_EDGE_CREASE_INDEX,0)
}@@

@@{
RTC_EDGE_CREASE_WEIGHT_BUFFER
=>
RTC_BUFFER(RTC_BUFFER_TYPE_EDGE_CREASE_WEIGHT,0)
}@@

@@{
RTC_VERTEX_CREASE_INDEX_BUFFER
=>
RTC_BUFFER(RTC_BUFFER_TYPE_VERTEX_CREASE_INDEX,0)
}@@

@@{
RTC_VERTEX_CREASE_WEIGHT_BUFFER
=>
RTC_BUFFER(RTC_BUFFER_TYPE_VERTEX_CREASE_WEIGHT,0)
}@@

@@{
RTC_HOLE_BUFFER
=>
RTC_BUFFER(RTC_BUFFER_TYPE_HOLE,0)
}@@


@@{
RTC_GEOMETRY_STATIC
