summaryrefslogtreecommitdiff
path: root/src/gallium/docs
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-02-02 21:10:44 +0100
committerNicolai Hähnle <nicolai.haehnle@amd.com>2017-04-05 10:37:04 +0200
commitd6e6fa01a51f3c9328c4cfdc1d7b3b448de11b84 (patch)
treecbced671242be91fd6d1bc6a69139f9c724fcb61 /src/gallium/docs
parent4e6feacf6aa589574da3b70f32ed4e87494c7000 (diff)
gallium: add sparse buffer interface and capability
v2: - explain the resource_commit interface in more detail Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'src/gallium/docs')
-rw-r--r--src/gallium/docs/source/context.rst25
-rw-r--r--src/gallium/docs/source/screen.rst3
2 files changed, 28 insertions, 0 deletions
diff --git a/src/gallium/docs/source/context.rst b/src/gallium/docs/source/context.rst
index a053193722..5949ff23c9 100644
--- a/src/gallium/docs/source/context.rst
+++ b/src/gallium/docs/source/context.rst
@@ -618,6 +618,31 @@ are set.
+.. _resource_commit:
+
+resource_commit
+%%%%%%%%%%%%%%%
+
+This function changes the commit state of a part of a sparse resource. Sparse
+resources are created by setting the ``PIPE_RESOURCE_FLAG_SPARSE`` flag when
+calling ``resource_create``. Initially, sparse resources only reserve a virtual
+memory region that is not backed by memory (i.e., it is uncommitted). The
+``resource_commit`` function can be called to commit or uncommit parts (or all)
+of a resource. The driver manages the underlying backing memory.
+
+The contents of newly committed memory regions are undefined. Calling this
+function to commit an already committed memory region is allowed and leaves its
+content unchanged. Similarly, calling this function to uncommit an already
+uncommitted memory region is allowed.
+
+For buffers, the given box must be aligned to multiples of
+``PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE``. As an exception to this rule, if the size
+of the buffer is not a multiple of the page size, changing the commit state of
+the last (partial) page requires a box that ends at the end of the buffer
+(i.e., box->x + box->width == buffer->width0).
+
+
+
.. _pipe_transfer:
PIPE_TRANSFER
diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst
index 8685fb728b..f1b91363d6 100644
--- a/src/gallium/docs/source/screen.rst
+++ b/src/gallium/docs/source/screen.rst
@@ -381,6 +381,9 @@ The integer capabilities:
PIPE_POLYGON_MODE_FILL_RECTANGLE mode is supported for
``pipe_rasterizer_state::fill_front`` and
``pipe_rasterizer_state::fill_back``.
+* ``PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE``: The page size of sparse buffers in
+ bytes, or 0 if sparse buffers are not supported. The page size must be at
+ most 64KB.
.. _pipe_capf: