On Thu, 2014-07-24 at 06:35 -0700, Tom Stellard wrote:
> On Thu, Jul 24, 2014 at 01:09:49PM +0200, Marek Olšák wrote:
> > Isn't this redundant with get_shader_param(PIPE_SHADER_COMPUTE,
> > PIPE_SHADER_CAP_MAX_CONSTS) * 16?
> > 
> 
> This is what clover was using, but I was confused about what the value
> was supposed to represent.  Now, I think I understand (number of 4 x 32-bit
> constants).  I can use this instead.

Is the value for r600 hw misreported then? The manuals for R600/EG/NI
say there are 512 such registers. Yet the driver reports 4096.
See the attached patch.

Jan

> 
> -Tom
> > Marek
> > 
> > On Thu, Jul 24, 2014 at 3:05 AM, Tom Stellard <thomas.stell...@amd.com> 
> > wrote:
> > > ---
> > >  src/gallium/docs/source/screen.rst   | 2 ++
> > >  src/gallium/include/pipe/p_defines.h | 3 ++-
> > >  2 files changed, 4 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/src/gallium/docs/source/screen.rst 
> > > b/src/gallium/docs/source/screen.rst
> > > index 830a1a5..219c9f9 100644
> > > --- a/src/gallium/docs/source/screen.rst
> > > +++ b/src/gallium/docs/source/screen.rst
> > > @@ -334,6 +334,8 @@ pipe_screen::get_compute_param.
> > >    Value type: ``uint32_t``
> > >  * ``PIPE_COMPUTE_CAP_IMAGES_SUPPORTED``: Whether images are supported
> > >    non-zero means yes, zero means no. Value type: ``uint32_t``
> > > +* ``PIPE_COMPUTE_CAP_MAX_CONSTANT_BUFFER_SIZE``: The maximum size in 
> > > bytes
> > > +  of a constant buffer.  Value type: ``uint64_t``
> > >
> > >  .. _pipe_bind:
> > >
> > > diff --git a/src/gallium/include/pipe/p_defines.h 
> > > b/src/gallium/include/pipe/p_defines.h
> > > index 43bb1f5..78709b9 100644
> > > --- a/src/gallium/include/pipe/p_defines.h
> > > +++ b/src/gallium/include/pipe/p_defines.h
> > > @@ -651,7 +651,8 @@ enum pipe_compute_cap
> > >     PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE,
> > >     PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY,
> > >     PIPE_COMPUTE_CAP_MAX_COMPUTE_UNITS,
> > > -   PIPE_COMPUTE_CAP_IMAGES_SUPPORTED
> > > +   PIPE_COMPUTE_CAP_IMAGES_SUPPORTED,
> > > +   PIPE_COMPUTE_CAP_MAX_CONSTANT_BUFFER_SIZE
> > >  };
> > >
> > >  /**
> > > --
> > > 1.8.1.5
> > >
> > > _______________________________________________
> > > mesa-dev mailing list
> > > mesa-dev@lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev

-- 
Jan Vesely <jan.ves...@rutgers.edu>
From 48536e44883f8f3f4846235dc60982328cfc6805 Mon Sep 17 00:00:00 2001
From: Jan Vesely <jan.ves...@rutgers.edu>
Date: Thu, 24 Jul 2014 09:58:40 -0400
Subject: [PATCH 1/1] r600g: Fix number of reported constant regs.

See table 2.6 of R600 and table 2.9 of EG/NI manual

Signed-off-by: Jan Vesely <jan.ves...@rutgers.edu>
---
 src/gallium/drivers/r600/r600_pipe.c | 2 +-
 src/gallium/drivers/r600/r600_pipe.h | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index ee6a416..d9636ee 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -420,7 +420,7 @@ static int r600_get_shader_param(struct pipe_screen* pscreen, unsigned shader, e
 		/* XXX Isn't this equal to TEMPS? */
 		return 1; /* Max native address registers */
 	case PIPE_SHADER_CAP_MAX_CONSTS:
-		return R600_MAX_CONST_BUFFER_SIZE;
+		return 512;
 	case PIPE_SHADER_CAP_MAX_CONST_BUFFERS:
 		return R600_MAX_USER_CONST_BUFFERS;
 	case PIPE_SHADER_CAP_MAX_PREDS:
diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h
index 4585ace..f01134c 100644
--- a/src/gallium/drivers/r600/r600_pipe.h
+++ b/src/gallium/drivers/r600/r600_pipe.h
@@ -54,8 +54,6 @@
 #define R600_BUFFER_INFO_CONST_BUFFER (R600_MAX_USER_CONST_BUFFERS + 2)
 #define R600_GS_RING_CONST_BUFFER (R600_MAX_USER_CONST_BUFFERS + 3)
 
-#define R600_MAX_CONST_BUFFER_SIZE 4096
-
 #ifdef PIPE_ARCH_BIG_ENDIAN
 #define R600_BIG_ENDIAN 1
 #else
-- 
1.9.3

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to