intel: Use specified alignment for writes into the upload buffer
[mesa.git] / src / mesa / drivers / dri / intel / intel_buffer_objects.h
index 8164407f07954ca382962f8713ee98258008247b..3ec3a521382d1c4546a7e12216c7ac2e8c6955d9 100644 (file)
@@ -41,24 +41,50 @@ struct gl_buffer_object;
 struct intel_buffer_object
 {
    struct gl_buffer_object Base;
-   dri_bo *buffer;     /* the low-level buffer manager's buffer handle */
+   drm_intel_bo *buffer;     /* the low-level buffer manager's buffer handle */
+   GLuint offset;            /* any offset into that buffer */
+
    /** System memory buffer data, if not using a BO to store the data. */
    void *sys_buffer;
 
    struct intel_region *region; /* Is there a zero-copy texture
                                    associated with this (pixel)
                                    buffer object? */
+
+   drm_intel_bo *range_map_bo;
+   void *range_map_buffer;
+   unsigned int range_map_offset;
+   GLsizei range_map_size;
+
    GLboolean mapped_gtt;
+   GLboolean source;
 };
 
 
 /* Get the bm buffer associated with a GL bufferobject:
  */
-dri_bo *intel_bufferobj_buffer(struct intel_context *intel,
-                              struct intel_buffer_object
-                              *obj, GLuint flag);
+drm_intel_bo *intel_bufferobj_buffer(struct intel_context *intel,
+                                    struct intel_buffer_object *obj,
+                                    GLuint flag);
+drm_intel_bo *intel_bufferobj_source(struct intel_context *intel,
+                                    struct intel_buffer_object *obj,
+                                    GLuint *offset);
+
+void intel_upload_data(struct intel_context *intel,
+                      const void *ptr, GLuint size, GLuint align,
+                      drm_intel_bo **return_bo,
+                      GLuint *return_offset);
+
+void *intel_upload_map(struct intel_context *intel,
+                      GLuint size, GLuint align);
+void intel_upload_unmap(struct intel_context *intel,
+                       const void *ptr, GLuint size, GLuint align,
+                       drm_intel_bo **return_bo,
+                       GLuint *return_offset);
+
+void intel_upload_finish(struct intel_context *intel);
 
-/* Hook the bufferobject implementation into mesa: 
+/* Hook the bufferobject implementation into mesa:
  */
 void intelInitBufferObjectFuncs(struct dd_function_table *functions);