diff options
author | Niklas Haas <git@haasn.xyz> | 2017-09-08 06:13:55 +0200 |
---|---|---|
committer | Niklas Haas <git@haasn.xyz> | 2017-09-26 17:25:35 +0200 |
commit | ca85a153b4a201c7f6d600f861639ef68c1edfa3 (patch) | |
tree | 328594163e35181d10396e651c78f393cff38530 /video/out/gpu/ra.h | |
parent | ed345ffc2f3373743d74a5e0a1dc73c012389273 (diff) | |
download | mpv-ca85a153b4a201c7f6d600f861639ef68c1edfa3.tar.bz2 mpv-ca85a153b4a201c7f6d600f861639ef68c1edfa3.tar.xz |
vo_gpu: vulkan: add support for push constants
Can in theory avoid updating the uniform buffer every frame
Diffstat (limited to 'video/out/gpu/ra.h')
-rw-r--r-- | video/out/gpu/ra.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/video/out/gpu/ra.h b/video/out/gpu/ra.h index 7a2fa0e11c..15fa782bdd 100644 --- a/video/out/gpu/ra.h +++ b/video/out/gpu/ra.h @@ -26,6 +26,9 @@ struct ra { // time. size_t max_shmem; + // Maximum push constant size. Set by the RA backend at init time. + size_t max_pushc_size; + // Set of supported texture formats. Must be added by RA backend at init time. // If there are equivalent formats with different caveats, the preferred // formats should have a lower index. (E.g. GLES3 should put rg8 before la.) @@ -245,6 +248,7 @@ struct ra_renderpass_params { // Uniforms, including texture/sampler inputs. struct ra_renderpass_input *inputs; int num_inputs; + size_t push_constants_size; // must be <= ra.max_pushc_size and a multiple of 4 // Highly implementation-specific byte array storing a compiled version // of the program. Can be used to speed up shader compilation. A backend @@ -317,6 +321,7 @@ struct ra_renderpass_run_params { // even if they do not change. struct ra_renderpass_input_val *values; int num_values; + void *push_constants; // must be set if params.push_constants_size > 0 // --- pass->params.type==RA_RENDERPASS_TYPE_RASTER only @@ -387,6 +392,10 @@ struct ra_fns { // but must be implemented if RA_CAP_BUF_RO is supported. struct ra_layout (*uniform_layout)(struct ra_renderpass_input *inp); + // Returns the layout requirements of a push constant element. Optional, + // but must be implemented if ra.max_pushc_size > 0. + struct ra_layout (*push_constant_layout)(struct ra_renderpass_input *inp); + // Clear the dst with the given color (rgba) and within the given scissor. // dst must have dst->params.render_dst==true. Content outside of the // scissor is preserved. |