|
@@ -1,4 +1,5 @@
|
|
return {
|
|
return {
|
|
|
|
+ deprecated = true,
|
|
tag = 'graphics-objects',
|
|
tag = 'graphics-objects',
|
|
summary = 'Get a temporary Pass.',
|
|
summary = 'Get a temporary Pass.',
|
|
description = 'Creates and returns a temporary Pass object.',
|
|
description = 'Creates and returns a temporary Pass object.',
|
|
@@ -40,32 +41,9 @@ return {
|
|
name = 'texture',
|
|
name = 'texture',
|
|
type = 'Texture',
|
|
type = 'Texture',
|
|
description = 'A Texture to use as the depth buffer. Takes precedence over `format`.'
|
|
description = 'A Texture to use as the depth buffer. Takes precedence over `format`.'
|
|
- },
|
|
|
|
- {
|
|
|
|
- name = 'clear',
|
|
|
|
- type = 'number',
|
|
|
|
- default = '0',
|
|
|
|
- description = [[
|
|
|
|
- How to clear the depth buffer at the beginning of the pass. Can be a floating point
|
|
|
|
- number to clear each pixel to, `true` to do a "fast clear" that clears to random
|
|
|
|
- data, or `false` to not clear at all and instead load the depth texture's pixels.
|
|
|
|
- ]]
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- {
|
|
|
|
- name = 'clear',
|
|
|
|
- type = '*',
|
|
|
|
- description = [[
|
|
|
|
- How to clear the color textures at the beginning of the pass. If this is a boolean or a
|
|
|
|
- color, that value will be used for all color textures. It can also be a table of colors
|
|
|
|
- or booleans, one for each color texture. Colors may be provided as `Vec3`, `Vec4`,
|
|
|
|
- hexcodes, or tables of numbers. Note that tables of hexcode colors are ambiguous and
|
|
|
|
- therefore unsupported. When using a boolean, `true` means to do a "fast clear" that
|
|
|
|
- clears the texture to random data, and `false` means to not clear at all and instead
|
|
|
|
- load the texture's existing pixels.
|
|
|
|
- ]]
|
|
|
|
- },
|
|
|
|
{
|
|
{
|
|
name = 'samples',
|
|
name = 'samples',
|
|
type = 'number',
|
|
type = 'number',
|
|
@@ -74,15 +52,6 @@ return {
|
|
The number of multisamples to use. Can be 4 for antialiasing, or 1 to disable
|
|
The number of multisamples to use. Can be 4 for antialiasing, or 1 to disable
|
|
antialiasing.
|
|
antialiasing.
|
|
]]
|
|
]]
|
|
- },
|
|
|
|
- {
|
|
|
|
- name = 'mipmap',
|
|
|
|
- type = 'boolean',
|
|
|
|
- default = [[false]],
|
|
|
|
- description = [[
|
|
|
|
- Whether mipmaps for the color and depth textures should be regenerated after the pass is
|
|
|
|
- finished.
|
|
|
|
- ]]
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -95,7 +64,7 @@ return {
|
|
},
|
|
},
|
|
variants = {
|
|
variants = {
|
|
{
|
|
{
|
|
- description = 'Create a compute or transfer pass.',
|
|
|
|
|
|
+ description = 'Create a compute pass.',
|
|
arguments = { 'type' },
|
|
arguments = { 'type' },
|
|
returns = { 'pass' }
|
|
returns = { 'pass' }
|
|
},
|
|
},
|
|
@@ -120,18 +89,16 @@ return {
|
|
allowing each layer to be rendered from a different viewpoint. This enables fast stereo
|
|
allowing each layer to be rendered from a different viewpoint. This enables fast stereo
|
|
rendering, but can also be used to efficiently render to cubemaps. The `ViewIndex` variable
|
|
rendering, but can also be used to efficiently render to cubemaps. The `ViewIndex` variable
|
|
can also be used in shaders to set up any desired per-view behavior.
|
|
can also be used in shaders to set up any desired per-view behavior.
|
|
- - If `mipmap` is true, then any textures with mipmaps must have the `transfer` `TextureUsage`.
|
|
|
|
|
|
+ - Mipmaps will automatically be generated for textures at the end of the render pass.
|
|
- It's okay to have zero color textures, but in this case there must be a depth texture.
|
|
- It's okay to have zero color textures, but in this case there must be a depth texture.
|
|
- - Setting `clear` to `false` for textures is usually very slow on mobile GPUs.
|
|
|
|
- It's possible to render to a specific mipmap level of a Texture, or a subset of its layers, by
|
|
- It's possible to render to a specific mipmap level of a Texture, or a subset of its layers, by
|
|
rendering to texture views, see `Texture:newView`.
|
|
rendering to texture views, see `Texture:newView`.
|
|
|
|
|
|
- For `compute` and `transfer` passes, all of the commands in the pass act as though they run in
|
|
|
|
- parallel. This means that writing to the same element of a buffer twice, or writing to it and
|
|
|
|
- reading from it again is not guaranteed to work properly on all GPUs. LÖVR is not currently
|
|
|
|
- able to check for this. If compute or transfers need to be sequenced, multiple passes should be
|
|
|
|
- used. It is, however, completely fine to read and write to non-overlapping regions of the same
|
|
|
|
- buffer or texture.
|
|
|
|
|
|
+ For `compute` passes, all of the commands in the pass act as though they run in parallel. This
|
|
|
|
+ means that writing to the same element of a buffer twice, or writing to it and reading from it
|
|
|
|
+ again is not guaranteed to work properly on all GPUs. If compute or transfers need to be
|
|
|
|
+ sequenced, multiple passes should be used. It is, however, completely fine to read and write to
|
|
|
|
+ non-overlapping regions of the same buffer or texture.
|
|
]],
|
|
]],
|
|
related = {
|
|
related = {
|
|
'lovr.graphics.submit',
|
|
'lovr.graphics.submit',
|