From f0b6860d62bf2c59be589a56750b2a95666a7564 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Sat, 10 Nov 2018 11:27:03 +0100 Subject: vo_gpu: index desc namespaces by ra No reason to require them be constant. This allows them to depend on runtime characteristics of the `ra`. --- video/out/d3d11/ra_d3d11.c | 2 +- video/out/gpu/ra.h | 2 +- video/out/gpu/shader_cache.c | 2 +- video/out/opengl/ra_gl.c | 2 +- video/out/vulkan/ra_vk.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'video/out') diff --git a/video/out/d3d11/ra_d3d11.c b/video/out/d3d11/ra_d3d11.c index 1d2455853b..98c2d7d418 100644 --- a/video/out/d3d11/ra_d3d11.c +++ b/video/out/d3d11/ra_d3d11.c @@ -1241,7 +1241,7 @@ static void blit(struct ra *ra, struct ra_tex *dst, struct ra_tex *src, } } -static int desc_namespace(enum ra_vartype type) +static int desc_namespace(struct ra *ra, enum ra_vartype type) { // Images and SSBOs both use UAV bindings if (type == RA_VARTYPE_IMG_W) diff --git a/video/out/gpu/ra.h b/video/out/gpu/ra.h index 748b485c95..f35489e25d 100644 --- a/video/out/gpu/ra.h +++ b/video/out/gpu/ra.h @@ -445,7 +445,7 @@ struct ra_fns { // Returns an abstract namespace index for a given renderpass input type. // This will always be a value >= 0 and < RA_VARTYPE_COUNT. This is used to // figure out which inputs may share the same value of `binding`. - int (*desc_namespace)(enum ra_vartype type); + int (*desc_namespace)(struct ra *ra, enum ra_vartype type); // 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 diff --git a/video/out/gpu/shader_cache.c b/video/out/gpu/shader_cache.c index fa4560597f..18986f20b7 100644 --- a/video/out/gpu/shader_cache.c +++ b/video/out/gpu/shader_cache.c @@ -254,7 +254,7 @@ static struct sc_uniform *find_uniform(struct gl_shader_cache *sc, static int gl_sc_next_binding(struct gl_shader_cache *sc, enum ra_vartype type) { - return sc->next_binding[sc->ra->fns->desc_namespace(type)]++; + return sc->next_binding[sc->ra->fns->desc_namespace(sc->ra, type)]++; } void gl_sc_uniform_dynamic(struct gl_shader_cache *sc) diff --git a/video/out/opengl/ra_gl.c b/video/out/opengl/ra_gl.c index 1101f44c49..e4c9c36562 100644 --- a/video/out/opengl/ra_gl.c +++ b/video/out/opengl/ra_gl.c @@ -693,7 +693,7 @@ static void gl_blit(struct ra *ra, struct ra_tex *dst, struct ra_tex *src, gl->BindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); } -static int gl_desc_namespace(enum ra_vartype type) +static int gl_desc_namespace(struct ra *ra, enum ra_vartype type) { return type; } diff --git a/video/out/vulkan/ra_vk.c b/video/out/vulkan/ra_vk.c index 0516664e79..3e4ba28ac4 100644 --- a/video/out/vulkan/ra_vk.c +++ b/video/out/vulkan/ra_vk.c @@ -1837,7 +1837,7 @@ static void vk_clear(struct ra *ra, struct ra_tex *tex, float color[4], } } -static int vk_desc_namespace(enum ra_vartype type) +static int vk_desc_namespace(struct ra *ra, enum ra_vartype type) { return 0; } -- cgit v1.2.3