aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorasuonpaa <34128694+asuonpaa@users.noreply.github.com>2019-12-04 20:12:17 +0200
committerdan sinclair <dsinclair@google.com>2019-12-04 13:12:17 -0500
commit3a57f61b12eb87a92f278d5fb9224ccf302c64d0 (patch)
treecff523a6e8b8eadf96d56c62bd477f5ddd5a4a45 /docs
parent12a78a80080cb744a7b64e293ef007522e1e5eac (diff)
downloadamber-3a57f61b12eb87a92f278d5fb9224ccf302c64d0.tar.gz
Mipmap support (#731)
Fixes #714
Diffstat (limited to 'docs')
-rw-r--r--docs/amber_script.md64
1 files changed, 64 insertions, 0 deletions
diff --git a/docs/amber_script.md b/docs/amber_script.md
index 5b7841b..783dc39 100644
--- a/docs/amber_script.md
+++ b/docs/amber_script.md
@@ -143,6 +143,10 @@ BUFFER {name} DATA_TYPE {type} {STD140|STD430} WIDTH {w} HEIGHT {h} \
# buffers are used as image and depth buffers in the `PIPELINE` commands.
# The buffer will be sized based on the `RENDER_SIZE` of the `PIPELINE`.
BUFFER {name} FORMAT {format_string}
+
+# Creates a buffer intended to be used as a color buffer or a texture with
+# a number of mip levels.
+BUFFER {name} FORMAT {format_string} MIP_LEVELS {mip_levels}
```
#### Buffer Initializers
@@ -168,6 +172,51 @@ SERIES_FROM _start_ INC_BY _inc_
COPY {buffer_from} TO {buffer_to}
```
+### Samplers
+
+Samplers are used for sampling buffers that are bound to a pipeline as
+sampled image or combined image sampler.
+
+All sampler parameters are optional. Filters will default to nearest, address
+modes to repeat, min LOD to 0, max LOD to 1, and border color to float
+transparent black.
+
+The samplers use normalized coordinates in the range of [0..1].
+
+#### Filter types
+ * `nearest`
+ * `linear`
+
+#### Address modes
+ * `repeat`
+ * `mirrored_repeat`
+ * `clamp_to_edge`
+ * `clamp_to_border`
+ * `mirrored_clamp_to_edge`
+
+#### Border colors
+ * `float_transparent_black`
+ * `int_transparent_black`
+ * `float_opaque_black`
+ * `int_opaque_black`
+ * `float_opaque_white`
+ * `int_opaque_white`
+
+```groovy
+
+# Creates a sampler |name| with |magfilter| and |minfilter| using filter type,
+# |modeu| and |modev| address mode, and |color| being one of the border
+# color options. Both |minlod| and |maxlod| are floating point values,
+# where |maxlod| >= |minlod|.
+SAMPLER {name} MAG_FILTER {magfilter} \
+ MIN_FILTER {minfilter} \
+ ADDRESS_MODE_U {modeu} \
+ ADDRESS_MODE_V {modev} \
+ BORDER_COLOR {color} \
+ MIN_LOD {minlod} \
+ MAX_LOD {maxlod}
+```
+
### Pipelines
#### Pipeline type
@@ -252,6 +301,10 @@ contain image attachment content, depth/stencil content, uniform buffers, etc.
# for graphics pipelines.
BIND BUFFER {buffer_name} AS color LOCATION _idx_
+ # Attach |buffer_name| as an output color attachment at location |idx|,
+ # and output color buffer contents to a mip level |level|.
+ BIND BUFFER {buffer_name} AS color LOCATION _idx_ BASE_MIP_LEVEL _level_
+
# Attach |buffer_name| as the depth/stencil buffer. The provided buffer must
# be a `FORMAT` buffer. If no depth/stencil buffer is specified a default
# buffer of format `D32_SFLOAT_S8_UINT` will be created for graphics
@@ -270,13 +323,24 @@ contain image attachment content, depth/stencil content, uniform buffers, etc.
# Attach |buffer_name| as a storage image.
BIND BUFFER {buffer_name} AS storage_image
+ # Attach |buffer_name| as a storage image using |level| as a base mip level.
+ BIND BUFFER {buffer_name} AS storage_image BASE_MIP_LEVEL _level_
+
# Attach |buffer_name| as a sampled image.
BIND BUFFER {buffer_name} AS sampled_image
+ # Attach |buffer_name| as a sampled image using |level| as a base mip level.
+ BIND BUFFER {buffer_name} AS sampled_image BASE_MIP_LEVEL _level_
+
# Attach |buffer_name| as a combined image sampler. A sampler |sampler_name|
# must also be specified.
BIND BUFFER {buffer_name} AS combined_image_sampler SAMPLER {sampler_name}
+ # Attach |buffer_name| as a combined image sampler using |level| as a base
+ # mip level.
+ BIND BUFFER {buffer_name} AS combined_image_sampler SAMPLER {sampler_name} \
+ BASE_MIP_LEVEL _level_
+
# Bind the sampler at the given descriptor set and binding.
BIND SAMPLER {sampler_name} DESCRIPTOR_SET _id_ BINDING _id_