[1/2] allow non-samplable formats can be renderable

Submitted by Erik Faye-Lund on July 9, 2018, 3:03 p.m.

Details

Message ID 20180709150337.2389-2-erik.faye-lund@collabora.com
State New
Headers show
Series "more accurate format capabilities" ( rev: 1 ) in Virgil 3D

Not browsing as part of any series.

Commit Message

Erik Faye-Lund July 9, 2018, 3:03 p.m.
OpenGL allows for formats that are non-samplable, yet can be
rendered to. It's not very likely to occur, but there's no reason
to artifically tie these two traits together.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
---
 src/vrend_renderer.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 23494a8..d0a53bf 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -7167,11 +7167,10 @@  static bool vrend_renderer_fill_caps_common(uint32_t set, UNUSED uint32_t versio
       uint32_t index = i % 32;
 
       if (tex_conv_table[i].internalformat != 0) {
-         if (vrend_format_can_sample(i)) {
+         if (vrend_format_can_sample(i))
             caps->v1.sampler.bitmask[offset] |= (1 << index);
-            if (vrend_format_can_render(i))
-               caps->v1.render.bitmask[offset] |= (1 << index);
-         }
+         if (vrend_format_can_render(i))
+            caps->v1.render.bitmask[offset] |= (1 << index);
       }
    }
 

Comments

"can be renderable" in the subject should have been "to be
renderable" of course. I've fixed this up locally.

On 09. juli 2018 17:03, Erik Faye-Lund wrote:
> OpenGL allows for formats that are non-samplable, yet can be
> rendered to. It's not very likely to occur, but there's no reason
> to artifically tie these two traits together.
>
> Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
> ---
>   src/vrend_renderer.c | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
> index 23494a8..d0a53bf 100644
> --- a/src/vrend_renderer.c
> +++ b/src/vrend_renderer.c
> @@ -7167,11 +7167,10 @@ static bool vrend_renderer_fill_caps_common(uint32_t set, UNUSED uint32_t versio
>         uint32_t index = i % 32;
>   
>         if (tex_conv_table[i].internalformat != 0) {
> -         if (vrend_format_can_sample(i)) {
> +         if (vrend_format_can_sample(i))
>               caps->v1.sampler.bitmask[offset] |= (1 << index);
> -            if (vrend_format_can_render(i))
> -               caps->v1.render.bitmask[offset] |= (1 << index);
> -         }
> +         if (vrend_format_can_render(i))
> +            caps->v1.render.bitmask[offset] |= (1 << index);
>         }
>      }
>