Re: [Mesa-dev] [RFC PATCH 25/65] gallium: add ARB_bindless_texture interface

2017-05-25 Thread Samuel Pitoiset



On 05/25/2017 07:36 PM, Marek Olšák wrote:

On Thu, May 25, 2017 at 3:53 PM, Marek Olšák  wrote:

On Wed, May 24, 2017 at 1:52 PM, Nicolai Hähnle  wrote:

On 19.05.2017 18:52, Samuel Pitoiset wrote:


Signed-off-by: Samuel Pitoiset 
---
   src/gallium/include/pipe/p_context.h | 16 
   1 file changed, 16 insertions(+)

diff --git a/src/gallium/include/pipe/p_context.h
b/src/gallium/include/pipe/p_context.h
index 4b75386a65..83eb1c9b08 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -766,6 +766,22 @@ struct pipe_context {
 unsigned last_level,
 unsigned first_layer,
 unsigned last_layer);
+
+   /**
+* Bindless texture/image handles interface.
+*/
+   uint64_t (*create_texture_handle)(struct pipe_context *ctx,
+ struct pipe_resource *res,
+ struct pipe_sampler_view *view,
+ const struct pipe_sampler_state
*state);
+   void (*delete_texture_handle)(struct pipe_context *ctx, uint64_t
handle);
+   void (*make_texture_handle_resident)(struct pipe_context *ctx,
+uint64_t handle, bool resident);
+   uint64_t (*create_image_handle)(struct pipe_context *ctx,
+   const struct pipe_image_view *image);
+   void (*delete_image_handle)(struct pipe_context *ctx, uint64_t
handle);
+   void (*make_image_handle_resident)(struct pipe_context *ctx, uint64_t
handle,
+  unsigned access, bool resident);



Should the create/delete functions be pipe_screen functions? Handles are
shared across a GL share group, so the current implementation with a
per-context hash of handles is definitely wrong. I still need to go over it
in detail.


BTW, shaders and sampler views are shared across a GL share group too.
I think this is the same as sampler views. radeonsi is OK with that. I
don't think any other drivers except nouveau will want to support
bindless textures.


Also, the way he wrote it is that the pipe_sampler_view parameter is
not a template, it's a real sampler view object. The "res" parameter
is unused and is planned to be removed. I don't know if it's a good
idea. Conceptually it's not, because it's not intuitive. However,
using a real sampler object makes the code deltas smaller, because
si_sampler_view contains everything and so create_texture_handle
doesn't have to do much. Opinions welcome.


Right, I removed the "res" parameter from texture_create_handle() 
locally. Though, I'm not sure myself if the Gallium interface needs to 
be changed or not. Like Marek, I'm open to any suggestions. Thanks.




Marek


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


Re: [Mesa-dev] [RFC PATCH 25/65] gallium: add ARB_bindless_texture interface

2017-05-25 Thread Marek Olšák
On Thu, May 25, 2017 at 3:53 PM, Marek Olšák  wrote:
> On Wed, May 24, 2017 at 1:52 PM, Nicolai Hähnle  wrote:
>> On 19.05.2017 18:52, Samuel Pitoiset wrote:
>>>
>>> Signed-off-by: Samuel Pitoiset 
>>> ---
>>>   src/gallium/include/pipe/p_context.h | 16 
>>>   1 file changed, 16 insertions(+)
>>>
>>> diff --git a/src/gallium/include/pipe/p_context.h
>>> b/src/gallium/include/pipe/p_context.h
>>> index 4b75386a65..83eb1c9b08 100644
>>> --- a/src/gallium/include/pipe/p_context.h
>>> +++ b/src/gallium/include/pipe/p_context.h
>>> @@ -766,6 +766,22 @@ struct pipe_context {
>>> unsigned last_level,
>>> unsigned first_layer,
>>> unsigned last_layer);
>>> +
>>> +   /**
>>> +* Bindless texture/image handles interface.
>>> +*/
>>> +   uint64_t (*create_texture_handle)(struct pipe_context *ctx,
>>> + struct pipe_resource *res,
>>> + struct pipe_sampler_view *view,
>>> + const struct pipe_sampler_state
>>> *state);
>>> +   void (*delete_texture_handle)(struct pipe_context *ctx, uint64_t
>>> handle);
>>> +   void (*make_texture_handle_resident)(struct pipe_context *ctx,
>>> +uint64_t handle, bool resident);
>>> +   uint64_t (*create_image_handle)(struct pipe_context *ctx,
>>> +   const struct pipe_image_view *image);
>>> +   void (*delete_image_handle)(struct pipe_context *ctx, uint64_t
>>> handle);
>>> +   void (*make_image_handle_resident)(struct pipe_context *ctx, uint64_t
>>> handle,
>>> +  unsigned access, bool resident);
>>
>>
>> Should the create/delete functions be pipe_screen functions? Handles are
>> shared across a GL share group, so the current implementation with a
>> per-context hash of handles is definitely wrong. I still need to go over it
>> in detail.
>
> BTW, shaders and sampler views are shared across a GL share group too.
> I think this is the same as sampler views. radeonsi is OK with that. I
> don't think any other drivers except nouveau will want to support
> bindless textures.

Also, the way he wrote it is that the pipe_sampler_view parameter is
not a template, it's a real sampler view object. The "res" parameter
is unused and is planned to be removed. I don't know if it's a good
idea. Conceptually it's not, because it's not intuitive. However,
using a real sampler object makes the code deltas smaller, because
si_sampler_view contains everything and so create_texture_handle
doesn't have to do much. Opinions welcome.

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


Re: [Mesa-dev] [RFC PATCH 25/65] gallium: add ARB_bindless_texture interface

2017-05-25 Thread Marek Olšák
On Wed, May 24, 2017 at 1:52 PM, Nicolai Hähnle  wrote:
> On 19.05.2017 18:52, Samuel Pitoiset wrote:
>>
>> Signed-off-by: Samuel Pitoiset 
>> ---
>>   src/gallium/include/pipe/p_context.h | 16 
>>   1 file changed, 16 insertions(+)
>>
>> diff --git a/src/gallium/include/pipe/p_context.h
>> b/src/gallium/include/pipe/p_context.h
>> index 4b75386a65..83eb1c9b08 100644
>> --- a/src/gallium/include/pipe/p_context.h
>> +++ b/src/gallium/include/pipe/p_context.h
>> @@ -766,6 +766,22 @@ struct pipe_context {
>> unsigned last_level,
>> unsigned first_layer,
>> unsigned last_layer);
>> +
>> +   /**
>> +* Bindless texture/image handles interface.
>> +*/
>> +   uint64_t (*create_texture_handle)(struct pipe_context *ctx,
>> + struct pipe_resource *res,
>> + struct pipe_sampler_view *view,
>> + const struct pipe_sampler_state
>> *state);
>> +   void (*delete_texture_handle)(struct pipe_context *ctx, uint64_t
>> handle);
>> +   void (*make_texture_handle_resident)(struct pipe_context *ctx,
>> +uint64_t handle, bool resident);
>> +   uint64_t (*create_image_handle)(struct pipe_context *ctx,
>> +   const struct pipe_image_view *image);
>> +   void (*delete_image_handle)(struct pipe_context *ctx, uint64_t
>> handle);
>> +   void (*make_image_handle_resident)(struct pipe_context *ctx, uint64_t
>> handle,
>> +  unsigned access, bool resident);
>
>
> Should the create/delete functions be pipe_screen functions? Handles are
> shared across a GL share group, so the current implementation with a
> per-context hash of handles is definitely wrong. I still need to go over it
> in detail.

BTW, shaders and sampler views are shared across a GL share group too.
I think this is the same as sampler views. radeonsi is OK with that. I
don't think any other drivers except nouveau will want to support
bindless textures.

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


Re: [Mesa-dev] [RFC PATCH 25/65] gallium: add ARB_bindless_texture interface

2017-05-24 Thread Nicolai Hähnle

On 19.05.2017 18:52, Samuel Pitoiset wrote:

Signed-off-by: Samuel Pitoiset 
---
  src/gallium/include/pipe/p_context.h | 16 
  1 file changed, 16 insertions(+)

diff --git a/src/gallium/include/pipe/p_context.h 
b/src/gallium/include/pipe/p_context.h
index 4b75386a65..83eb1c9b08 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -766,6 +766,22 @@ struct pipe_context {
unsigned last_level,
unsigned first_layer,
unsigned last_layer);
+
+   /**
+* Bindless texture/image handles interface.
+*/
+   uint64_t (*create_texture_handle)(struct pipe_context *ctx,
+ struct pipe_resource *res,
+ struct pipe_sampler_view *view,
+ const struct pipe_sampler_state *state);
+   void (*delete_texture_handle)(struct pipe_context *ctx, uint64_t handle);
+   void (*make_texture_handle_resident)(struct pipe_context *ctx,
+uint64_t handle, bool resident);
+   uint64_t (*create_image_handle)(struct pipe_context *ctx,
+   const struct pipe_image_view *image);
+   void (*delete_image_handle)(struct pipe_context *ctx, uint64_t handle);
+   void (*make_image_handle_resident)(struct pipe_context *ctx, uint64_t 
handle,
+  unsigned access, bool resident);


Should the create/delete functions be pipe_screen functions? Handles are 
shared across a GL share group, so the current implementation with a 
per-context hash of handles is definitely wrong. I still need to go over 
it in detail.


Cheers,
Nicolai
--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [RFC PATCH 25/65] gallium: add ARB_bindless_texture interface

2017-05-22 Thread Samuel Pitoiset



On 05/22/2017 01:26 AM, Roland Scheidegger wrote:

Clearly, you forgot the doc bits...


Yes, some doc bits could be helpful. :)



Roland

Am 19.05.2017 um 18:52 schrieb Samuel Pitoiset:

Signed-off-by: Samuel Pitoiset 
---
  src/gallium/include/pipe/p_context.h | 16 
  1 file changed, 16 insertions(+)

diff --git a/src/gallium/include/pipe/p_context.h 
b/src/gallium/include/pipe/p_context.h
index 4b75386a65..83eb1c9b08 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -766,6 +766,22 @@ struct pipe_context {
unsigned last_level,
unsigned first_layer,
unsigned last_layer);
+
+   /**
+* Bindless texture/image handles interface.
+*/
+   uint64_t (*create_texture_handle)(struct pipe_context *ctx,
+ struct pipe_resource *res,
+ struct pipe_sampler_view *view,
+ const struct pipe_sampler_state *state);
+   void (*delete_texture_handle)(struct pipe_context *ctx, uint64_t handle);
+   void (*make_texture_handle_resident)(struct pipe_context *ctx,
+uint64_t handle, bool resident);
+   uint64_t (*create_image_handle)(struct pipe_context *ctx,
+   const struct pipe_image_view *image);
+   void (*delete_image_handle)(struct pipe_context *ctx, uint64_t handle);
+   void (*make_image_handle_resident)(struct pipe_context *ctx, uint64_t 
handle,
+  unsigned access, bool resident);
  };
  
  




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


Re: [Mesa-dev] [RFC PATCH 25/65] gallium: add ARB_bindless_texture interface

2017-05-21 Thread Roland Scheidegger
Clearly, you forgot the doc bits...

Roland

Am 19.05.2017 um 18:52 schrieb Samuel Pitoiset:
> Signed-off-by: Samuel Pitoiset 
> ---
>  src/gallium/include/pipe/p_context.h | 16 
>  1 file changed, 16 insertions(+)
> 
> diff --git a/src/gallium/include/pipe/p_context.h 
> b/src/gallium/include/pipe/p_context.h
> index 4b75386a65..83eb1c9b08 100644
> --- a/src/gallium/include/pipe/p_context.h
> +++ b/src/gallium/include/pipe/p_context.h
> @@ -766,6 +766,22 @@ struct pipe_context {
>unsigned last_level,
>unsigned first_layer,
>unsigned last_layer);
> +
> +   /**
> +* Bindless texture/image handles interface.
> +*/
> +   uint64_t (*create_texture_handle)(struct pipe_context *ctx,
> + struct pipe_resource *res,
> + struct pipe_sampler_view *view,
> + const struct pipe_sampler_state *state);
> +   void (*delete_texture_handle)(struct pipe_context *ctx, uint64_t handle);
> +   void (*make_texture_handle_resident)(struct pipe_context *ctx,
> +uint64_t handle, bool resident);
> +   uint64_t (*create_image_handle)(struct pipe_context *ctx,
> +   const struct pipe_image_view *image);
> +   void (*delete_image_handle)(struct pipe_context *ctx, uint64_t handle);
> +   void (*make_image_handle_resident)(struct pipe_context *ctx, uint64_t 
> handle,
> +  unsigned access, bool resident);
>  };
>  
>  
> 

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


[Mesa-dev] [RFC PATCH 25/65] gallium: add ARB_bindless_texture interface

2017-05-19 Thread Samuel Pitoiset
Signed-off-by: Samuel Pitoiset 
---
 src/gallium/include/pipe/p_context.h | 16 
 1 file changed, 16 insertions(+)

diff --git a/src/gallium/include/pipe/p_context.h 
b/src/gallium/include/pipe/p_context.h
index 4b75386a65..83eb1c9b08 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -766,6 +766,22 @@ struct pipe_context {
   unsigned last_level,
   unsigned first_layer,
   unsigned last_layer);
+
+   /**
+* Bindless texture/image handles interface.
+*/
+   uint64_t (*create_texture_handle)(struct pipe_context *ctx,
+ struct pipe_resource *res,
+ struct pipe_sampler_view *view,
+ const struct pipe_sampler_state *state);
+   void (*delete_texture_handle)(struct pipe_context *ctx, uint64_t handle);
+   void (*make_texture_handle_resident)(struct pipe_context *ctx,
+uint64_t handle, bool resident);
+   uint64_t (*create_image_handle)(struct pipe_context *ctx,
+   const struct pipe_image_view *image);
+   void (*delete_image_handle)(struct pipe_context *ctx, uint64_t handle);
+   void (*make_image_handle_resident)(struct pipe_context *ctx, uint64_t 
handle,
+  unsigned access, bool resident);
 };
 
 
-- 
2.13.0

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