Re: [Mesa-dev] [RFC PATCH 46/65] st/mesa: disable per-context seamless cubemap when using texture handles

2017-05-24 Thread Samuel Pitoiset



On 05/23/2017 10:21 PM, Marek Olšák wrote:

What if a texture is used both as bindless and non-bindless? Wouldn't
HandleAllocated be true all the time? Instead perhaps
st_convert_sampler needs to know whether the current use is bindless,
not whether there is an existing handle somewhere in the context.


Yes, handles are only removed when the underlying texture is deleted. 
You are probably right.




Marek

On Fri, May 19, 2017 at 6:52 PM, Samuel Pitoiset
 wrote:

The ARB_bindless_texture spec say:

"If ARB_seamless_cubemap (or OpenGL 4.0, which includes it) is
 supported, the per-context seamless cubemap enable is ignored
 and treated as disabled when using texture handles."

"If AMD_seamless_cubemap_per_texture is supported, the seamless
 cube map texture parameter of the underlying texture does apply
 when texture handles are used."

Signed-off-by: Samuel Pitoiset 
---
  src/mesa/state_tracker/st_atom_sampler.c | 18 --
  1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_atom_sampler.c 
b/src/mesa/state_tracker/st_atom_sampler.c
index c6d992fbb0..116c5380cf 100644
--- a/src/mesa/state_tracker/st_atom_sampler.c
+++ b/src/mesa/state_tracker/st_atom_sampler.c
@@ -226,8 +226,22 @@ st_convert_sampler(const struct st_context *st,
sampler->compare_func = st_compare_func_to_pipe(msamp->CompareFunc);
 }

-   sampler->seamless_cube_map =
-  ctx->Texture.CubeMapSeamless || msamp->CubeMapSeamless;
+   if (msamp->HandleAllocated) {
+  /* The ARB_bindless_texture spec says:
+   *
+   * "If ARB_seamless_cubemap (or OpenGL 4.0, which includes it) is
+   *  supported, the per-context seamless cubemap enable is ignored and
+   *  treated as disabled when using texture handles."
+   *
+   * "If AMD_seamless_cubemap_per_texture is supported, the seamless cube
+   *  map texture parameter of the underlying texture does apply when
+   *  texture handles are used."
+   */
+  sampler->seamless_cube_map = msamp->CubeMapSeamless;
+   } else {
+  sampler->seamless_cube_map =
+ ctx->Texture.CubeMapSeamless || msamp->CubeMapSeamless;
+   }
  }

  /**
--
2.13.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [RFC PATCH 46/65] st/mesa: disable per-context seamless cubemap when using texture handles

2017-05-23 Thread Marek Olšák
What if a texture is used both as bindless and non-bindless? Wouldn't
HandleAllocated be true all the time? Instead perhaps
st_convert_sampler needs to know whether the current use is bindless,
not whether there is an existing handle somewhere in the context.

Marek

On Fri, May 19, 2017 at 6:52 PM, Samuel Pitoiset
 wrote:
> The ARB_bindless_texture spec say:
>
>"If ARB_seamless_cubemap (or OpenGL 4.0, which includes it) is
> supported, the per-context seamless cubemap enable is ignored
> and treated as disabled when using texture handles."
>
>"If AMD_seamless_cubemap_per_texture is supported, the seamless
> cube map texture parameter of the underlying texture does apply
> when texture handles are used."
>
> Signed-off-by: Samuel Pitoiset 
> ---
>  src/mesa/state_tracker/st_atom_sampler.c | 18 --
>  1 file changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_atom_sampler.c 
> b/src/mesa/state_tracker/st_atom_sampler.c
> index c6d992fbb0..116c5380cf 100644
> --- a/src/mesa/state_tracker/st_atom_sampler.c
> +++ b/src/mesa/state_tracker/st_atom_sampler.c
> @@ -226,8 +226,22 @@ st_convert_sampler(const struct st_context *st,
>sampler->compare_func = st_compare_func_to_pipe(msamp->CompareFunc);
> }
>
> -   sampler->seamless_cube_map =
> -  ctx->Texture.CubeMapSeamless || msamp->CubeMapSeamless;
> +   if (msamp->HandleAllocated) {
> +  /* The ARB_bindless_texture spec says:
> +   *
> +   * "If ARB_seamless_cubemap (or OpenGL 4.0, which includes it) is
> +   *  supported, the per-context seamless cubemap enable is ignored and
> +   *  treated as disabled when using texture handles."
> +   *
> +   * "If AMD_seamless_cubemap_per_texture is supported, the seamless cube
> +   *  map texture parameter of the underlying texture does apply when
> +   *  texture handles are used."
> +   */
> +  sampler->seamless_cube_map = msamp->CubeMapSeamless;
> +   } else {
> +  sampler->seamless_cube_map =
> + ctx->Texture.CubeMapSeamless || msamp->CubeMapSeamless;
> +   }
>  }
>
>  /**
> --
> 2.13.0
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [RFC PATCH 46/65] st/mesa: disable per-context seamless cubemap when using texture handles

2017-05-19 Thread Samuel Pitoiset
The ARB_bindless_texture spec say:

   "If ARB_seamless_cubemap (or OpenGL 4.0, which includes it) is
supported, the per-context seamless cubemap enable is ignored
and treated as disabled when using texture handles."

   "If AMD_seamless_cubemap_per_texture is supported, the seamless
cube map texture parameter of the underlying texture does apply
when texture handles are used."

Signed-off-by: Samuel Pitoiset 
---
 src/mesa/state_tracker/st_atom_sampler.c | 18 --
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_atom_sampler.c 
b/src/mesa/state_tracker/st_atom_sampler.c
index c6d992fbb0..116c5380cf 100644
--- a/src/mesa/state_tracker/st_atom_sampler.c
+++ b/src/mesa/state_tracker/st_atom_sampler.c
@@ -226,8 +226,22 @@ st_convert_sampler(const struct st_context *st,
   sampler->compare_func = st_compare_func_to_pipe(msamp->CompareFunc);
}
 
-   sampler->seamless_cube_map =
-  ctx->Texture.CubeMapSeamless || msamp->CubeMapSeamless;
+   if (msamp->HandleAllocated) {
+  /* The ARB_bindless_texture spec says:
+   *
+   * "If ARB_seamless_cubemap (or OpenGL 4.0, which includes it) is
+   *  supported, the per-context seamless cubemap enable is ignored and
+   *  treated as disabled when using texture handles."
+   *
+   * "If AMD_seamless_cubemap_per_texture is supported, the seamless cube
+   *  map texture parameter of the underlying texture does apply when
+   *  texture handles are used."
+   */
+  sampler->seamless_cube_map = msamp->CubeMapSeamless;
+   } else {
+  sampler->seamless_cube_map =
+ ctx->Texture.CubeMapSeamless || msamp->CubeMapSeamless;
+   }
 }
 
 /**
-- 
2.13.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev