intel: Use specified alignment for writes into the upload buffer
[mesa.git] / src / mesa / drivers / dri / intel / intel_buffer_objects.h
index 06a8ab9824c0358e8d641caf4e9991928318739b..3ec3a521382d1c4546a7e12216c7ac2e8c6955d9 100644 (file)
@@ -41,7 +41,9 @@ 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;
 
@@ -50,20 +52,39 @@ struct intel_buffer_object
                                    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);
-
-/* Hook the bufferobject implementation into mesa: 
+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:
  */
 void intelInitBufferObjectFuncs(struct dd_function_table *functions);