[Mesa-dev] [PATCH] gallium: remove set_shader_resources, add set_shader_buffers for untyped buffers
Aditya Avinash
adityaavinash1 at gmail.com
Wed Jan 7 06:59:51 PST 2015
Oh. So, we get better performance if we use atomic counters as buffers
rather than textures (images) [manipulating views are expensive].
Am I right?
On Wed, Jan 7, 2015 at 8:52 AM, Marek Olšák <maraeo at gmail.com> wrote:
> On Wed, Jan 7, 2015 at 3:44 PM, Aditya Avinash <adityaavinash1 at gmail.com>
> wrote:
> >
> >
> > On Wed, Jan 7, 2015 at 4:56 AM, Marek Olšák <maraeo at gmail.com> wrote:
> >>
> >> From: Marek Olšák <marek.olsak at amd.com>
> >>
> >> set_shader_resources is unused.
> >>
> >> set_shader_buffers should support shader atomic counter buffers and
> shader
> >> storage buffers from OpenGL.
> >>
> >> The plan is to use slots 0..15 for atomic counters and slots 16..31
> >> for storage buffers. Atomic counters are planned to be supported first.
> >>
> >> This doesn't add any interface for images. The documentation is added
> >> for future reference.
> >> ---
> >>
> >> This is the interface only. I don't plan to do anything else for now.
> >> Comments welcome.
> >>
> >> src/gallium/docs/source/context.rst | 16 ++++++++--------
> >> src/gallium/docs/source/screen.rst | 4 ++--
> >> src/gallium/drivers/galahad/glhd_context.c | 2 +-
> >> src/gallium/drivers/ilo/ilo_state.c | 2 +-
> >> src/gallium/drivers/nouveau/nouveau_buffer.c | 2 +-
> >> src/gallium/drivers/nouveau/nouveau_screen.c | 2 +-
> >> src/gallium/drivers/nouveau/nv50/nv50_formats.c | 2 +-
> >> src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 2 +-
> >> src/gallium/include/pipe/p_context.h | 20
> +++++++++++---------
> >> src/gallium/include/pipe/p_defines.h | 2 +-
> >> src/gallium/include/pipe/p_state.h | 10 ++++++++++
> >> 11 files changed, 38 insertions(+), 26 deletions(-)
> >>
> >> diff --git a/src/gallium/docs/source/context.rst
> >> b/src/gallium/docs/source/context.rst
> >> index 5861f46..73fd35f 100644
> >> --- a/src/gallium/docs/source/context.rst
> >> +++ b/src/gallium/docs/source/context.rst
> >> @@ -126,14 +126,14 @@ from a shader without an associated sampler. This
> >> means that they
> >> have no support for floating point coordinates, address wrap modes or
> >> filtering.
> >>
> >> -Shader resources are specified for all the shader stages at once using
> >> -the ``set_shader_resources`` method. When binding texture resources,
> >> -the ``level``, ``first_layer`` and ``last_layer`` pipe_surface fields
> >> -specify the mipmap level and the range of layers the texture will be
> >> -constrained to. In the case of buffers, ``first_element`` and
> >> -``last_element`` specify the range within the buffer that will be used
> >> -by the shader resource. Writes to a shader resource are only allowed
> >> -when the ``writable`` flag is set.
> >> +There are 2 types of shader resources: buffers and images.
> >> +
> >> +Buffers are specified using the ``set_shader_buffers`` method.
> >> +
> >> +Images are specified using the ``set_shader_images`` method. When
> binding
> >> +images, the ``level``, ``first_layer`` and ``last_layer``
> pipe_image_view
> >> +fields specify the mipmap level and the range of layers the image will
> be
> >> +constrained to.
> >>
> >> Surfaces
> >> ^^^^^^^^
> >
> >
> > set_shader_images are not defined in this patch.
> > Will it look similar to pipe_surface or pipe_sampler_view?
>
> There will be a separate view for images if this is approved.
>
> Marek
>
--
Regards,
*Aditya Atluri,*
*USA.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150107/b59982f3/attachment.html>
More information about the mesa-dev
mailing list