예제 #1
0
/* XXX: Thread safety?
 */
GLubyte *intel_region_map(struct intel_context *intel, struct intel_region *region)
{
   DBG("%s\n", __FUNCTION__);
   if (!region->map_refcount++) {
      region->map = bmMapBuffer(intel, region->buffer, 0);
      if (!region->map)
	 region->map_refcount--;
   }

   return region->map;
}
예제 #2
0
/**
 * Called via glMapBufferARB().
 */
static void *intel_bufferobj_map( GLcontext *ctx,
                                  GLenum target,
                                  GLenum access,
                                  struct gl_buffer_object *obj )
{
    struct intel_context *intel = intel_context(ctx);
    struct intel_buffer_object *intel_obj = intel_buffer_object(obj);

    /* XXX: Translate access to flags arg below:
     */
    assert(intel_obj);
    obj->Pointer = bmMapBuffer(intel->bm, intel_obj->buffer, 0);
    return obj->Pointer;
}