<div dir="ltr"><div>Oh. So, we get better performance if we use atomic counters as buffers rather than textures (images) [manipulating views are expensive].<br><br></div>Am I right?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 7, 2015 at 8:52 AM, Marek Olšák <span dir="ltr"><<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Wed, Jan 7, 2015 at 3:44 PM, Aditya Avinash <<a href="mailto:adityaavinash1@gmail.com">adityaavinash1@gmail.com</a>> wrote:<br>
><br>
><br>
> On Wed, Jan 7, 2015 at 4:56 AM, Marek Olšák <<a href="mailto:maraeo@gmail.com">maraeo@gmail.com</a>> wrote:<br>
>><br>
>> From: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>><br>
>><br>
>> set_shader_resources is unused.<br>
>><br>
>> set_shader_buffers should support shader atomic counter buffers and shader<br>
>> storage buffers from OpenGL.<br>
>><br>
>> The plan is to use slots 0..15 for atomic counters and slots 16..31<br>
>> for storage buffers. Atomic counters are planned to be supported first.<br>
>><br>
>> This doesn't add any interface for images. The documentation is added<br>
>> for future reference.<br>
>> ---<br>
>><br>
>> This is the interface only. I don't plan to do anything else for now.<br>
>> Comments welcome.<br>
>><br>
>>  src/gallium/docs/source/context.rst             | 16 ++++++++--------<br>
>>  src/gallium/docs/source/screen.rst              |  4 ++--<br>
>>  src/gallium/drivers/galahad/glhd_context.c      |  2 +-<br>
>>  src/gallium/drivers/ilo/ilo_state.c             |  2 +-<br>
>>  src/gallium/drivers/nouveau/nouveau_buffer.c    |  2 +-<br>
>>  src/gallium/drivers/nouveau/nouveau_screen.c    |  2 +-<br>
>>  src/gallium/drivers/nouveau/nv50/nv50_formats.c |  2 +-<br>
>>  src/gallium/drivers/nouveau/nvc0/nvc0_state.c   |  2 +-<br>
>>  src/gallium/include/pipe/p_context.h            | 20 +++++++++++---------<br>
>>  src/gallium/include/pipe/p_defines.h            |  2 +-<br>
>>  src/gallium/include/pipe/p_state.h              | 10 ++++++++++<br>
>>  11 files changed, 38 insertions(+), 26 deletions(-)<br>
>><br>
>> diff --git a/src/gallium/docs/source/context.rst<br>
>> b/src/gallium/docs/source/context.rst<br>
>> index 5861f46..73fd35f 100644<br>
>> --- a/src/gallium/docs/source/context.rst<br>
>> +++ b/src/gallium/docs/source/context.rst<br>
>> @@ -126,14 +126,14 @@ from a shader without an associated sampler.  This<br>
>> means that they<br>
>>  have no support for floating point coordinates, address wrap modes or<br>
>>  filtering.<br>
>><br>
>> -Shader resources are specified for all the shader stages at once using<br>
>> -the ``set_shader_resources`` method.  When binding texture resources,<br>
>> -the ``level``, ``first_layer`` and ``last_layer`` pipe_surface fields<br>
>> -specify the mipmap level and the range of layers the texture will be<br>
>> -constrained to.  In the case of buffers, ``first_element`` and<br>
>> -``last_element`` specify the range within the buffer that will be used<br>
>> -by the shader resource.  Writes to a shader resource are only allowed<br>
>> -when the ``writable`` flag is set.<br>
>> +There are 2 types of shader resources: buffers and images.<br>
>> +<br>
>> +Buffers are specified using the ``set_shader_buffers`` method.<br>
>> +<br>
>> +Images are specified using the ``set_shader_images`` method. When binding<br>
>> +images, the ``level``, ``first_layer`` and ``last_layer`` pipe_image_view<br>
>> +fields specify the mipmap level and the range of layers the image will be<br>
>> +constrained to.<br>
>><br>
>>  Surfaces<br>
>>  ^^^^^^^^<br>
><br>
><br>
> set_shader_images are not defined in this patch.<br>
> Will it look similar to pipe_surface or pipe_sampler_view?<br>
<br>
</div></div>There will be a separate view for images if this is approved.<br>
<span class="HOEnZb"><font color="#888888"><br>
Marek<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div><font style="font-family:trebuchet ms,sans-serif">Regards,<br></font></div><font style="font-family:trebuchet ms,sans-serif"><b style="background-color:rgb(255,255,255);color:rgb(0,0,153)">Aditya Atluri,<br></b></font></div><div><font style="font-family:trebuchet ms,sans-serif"><b style="background-color:rgb(255,255,255);color:rgb(0,0,153)">USA.<br></b></font></div><font style="font-family:trebuchet ms,sans-serif"><b style="background-color:rgb(255,255,255);color:rgb(0,0,153)"></b><span style="background-color:rgb(255,255,255);color:rgb(0,0,153)"></span></font><br></div></div>
</div>