Re: [Mesa3d-dev] mesa_7_7_branch - master merges

2010-01-26 Thread Michel Dänzer
On Mon, 2010-01-25 at 18:14 +, José Fonseca wrote: 
 
 But automated infrastructures aside, my worry with reviewing merges is
 the actual constraints that git has. For example, let's suppose the
 following scenario:
 
 1) Developer A merges a stable branch into master.
 2) After spending a bunch of time fixing conflicts the best he can, he
 emails the patch to mesa3d-dev for peer review.
 3) Developer B checks in a change into master.
 4) Developer A takes feedback from list, updates the code, and commits.
 5) Developer A cannot push because remote head has moved.
 
 So what can Developer A do now?
 
 a) Redo the merge, using the new master head.

FWIW, having rerere.enabled set in the Git configuration (see the
git-rerere manpage) should help somewhat with this - at least Developer
A shouldn't need to resolve the same conflicts over and over again.

 b) Rebase the merge on top of the new head (I'm not sure it works, or
 that it preserves branch history)

Probably not, IME merge commits lose their merge characteristics on
modification.

 c) Double merge, i.e., merge its local head with the new master head.

Which would be mostly a cosmetic problem for the revision history?

 Note that this problem is not specific to reviews -- pushing merges can
 always lead to this same situation --, but reviews of merges increase
 the probability of this problem from unlikely to guaranteed.

Agreed, seems like more trouble than it's worth.


-- 
Earthling Michel Dänzer   |http://www.vmware.com
Libre software enthusiast |  Debian, X and DRI developer

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] [PATCH] hack around commas in macro argument

2010-01-26 Thread Marvin

Jose, Brian,

 Marc,
 
 Why is this necessary? It has been working fine so far. Which gcc version
  are you using? What commas are you referring to?

the PIPE_ALIGN_TYPE macro is so far only used in the cell driver in 
src/gallium/drivers/cell/spu/spu_main.c  (this is probably why no one noticed 
it).

The marco takes a type, a stuct in this case, which can include commas:

PIPE_ALIGN_TYPE(16,
struct spu_framebuffer
{
   void *color_start;  /** addr of color surface in main memory */
   void *depth_start;  /** addr of depth surface in main memory */
   enum pipe_format color_format;
   enum pipe_format depth_format;
   uint width, height; /** size in pixels */
^^^

   uint width_tiles, height_tiles; /** width and height in tiles */
  ^^^

   uint color_clear_value;
   uint depth_clear_value;

   uint zsize; /** 0, 2 or 4 bytes per Z */
   float zscale;   /** 65535.0, 2^24-1 or 2^32-1 */
});

This will cause a problem, as the macro will thread each comma as an argument 
seperator and thus the number of arguments is larger than 2.

 Variadic macros aren't portable. This change would break MSVC build.

As it is only used by cell for now, the msvc macro does not need to be changed. 
But 
there should be some portable solution.

 It seems that there is some code that's trying to pass more than 2 args to
  PIPE_ALIGN_TYPE. That sounds wrong. And making PIPE_ALIGN_TYPE take a
  variable number of args just a bandaid for a deeper problem.

I was looking for the least invasive solution and found this (I'm not a C 
coder).
The other method would be to concatenate the struct first by a second macro 
to a 
single argument, but I don't know how to do this.

I read that variadic macros are part of ISO C99, but the form I used is 
probably a 
gcc extension. Maybe

#define PIPE_ALIGN_TYPE(_alignment,
...) __VA_ARGS__ __attribute__((aligned(_alignment)))

is more portable.

Marc

 Jose
 
 
 From: Brian Paul [bri...@vmware.com]
 Sent: Tuesday, January 26, 2010 0:05
 To: Marc Dietrich
 Cc: mesa3d-dev@lists.sourceforge.net
 Subject: Re: [Mesa3d-dev] [PATCH] hack around commas in macro argument
 
 Marc Dietrich wrote:
  this is needed at least for gcc. dunno about the other compilers.
  ---
   src/gallium/include/pipe/p_compiler.h |6 +++---
   1 files changed, 3 insertions(+), 3 deletions(-)
 
  diff --git a/src/gallium/include/pipe/p_compiler.h
  b/src/gallium/include/pipe/p_compiler.h index 272d030..cdda20c 100644
  --- a/src/gallium/include/pipe/p_compiler.h
  +++ b/src/gallium/include/pipe/p_compiler.h
  @@ -144,7 +144,7 @@ typedef unsigned char boolean;
   #if defined(__GNUC__) || (defined(__SUNPRO_C)  (__SUNPRO_C = 0x590))
 
   /* See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Type-Attributes.html
  */ -#define PIPE_ALIGN_TYPE(_alignment, _type) _type
  __attribute__((aligned(_alignment))) +#define PIPE_ALIGN_TYPE(_alignment,
  _type...) _type __attribute__((aligned(_alignment)))
 
   /* See
  http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Variable-Attributes.html */
  #define PIPE_ALIGN_VAR(_alignment) __attribute__((aligned(_alignment)))
  @@ -158,14 +158,14 @@ typedef unsigned char boolean;
   #elif defined(_MSC_VER)
 
   /* See http://msdn.microsoft.com/en-us/library/83ythb65.aspx */
  -#define PIPE_ALIGN_TYPE(_alignment, _type) __declspec(align(_alignment))
  _type +#define PIPE_ALIGN_TYPE(_alignment, _type...)
  __declspec(align(_alignment)) _type #define PIPE_ALIGN_VAR(_alignment)
  __declspec(align(_alignment))
 
   #define PIPE_ALIGN_STACK
 
   #elif defined(SWIG)
 
  -#define PIPE_ALIGN_TYPE(_alignment, _type) _type
  +#define PIPE_ALIGN_TYPE(_alignment, _type...) _type
   #define PIPE_ALIGN_VAR(_alignment)
 
   #define PIPE_ALIGN_STACK
 
 With your patch I'm seeing new warnings that I didn't get before:
 
 ../../src/gallium/include/pipe/p_compiler.h:147:42: warning: ISO C
 does not permit named variadic macros
 
 I'm using gcc 4.3.2
 
 Also, if you didn't test other compilers, the patch probably should
 not change PIPE_ALIGN_TYPE for MSVC or SWIG, right?
 
 -Brian
 
 ---
 --- The Planet: dedicated and managed hosting, cloud storage, colocation
  Stay online with enterprise data centers and the best network in the
  business Choose flexible plans and management services without long-term
  contracts Personal 24x7 support from experience hosting pros just a phone
  call away. http://p.sf.net/sfu/theplanet-com
 ___
 Mesa3d-dev mailing list
 Mesa3d-dev@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
 

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business

[Mesa3d-dev] gallium: ARB_half_float_vertex

2010-01-26 Thread Dave Airlie

Since the whole patent mess can't apply to floating vertices here are some 
gallium patches.

First adds a new screen interface for is_vertex_format_supported and also
we seems to have some GPUs with a single R16 and some with R16X16 so allow 
or this.

second is just i965g patch.

If these are okay, I can look at softpipe support via translate. Not sure 
exposing this extension always and using translate always makes sense as 
it defeats the purpose of this extension.

Dave.
From b8ea9848a61fe2469ae87bdc8ba44ea40b25b8ef Mon Sep 17 00:00:00 2001
From: Dave Airlie airl...@linux.ie
Date: Tue, 26 Jan 2010 19:12:36 +1000
Subject: [PATCH 2/2] i965g: add support for ARB_half_float_vertex

This adds the format bits to the 965g vertex emission. Untested
due to 965g appearing to smash my GPU currently.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 src/gallium/drivers/i965/brw_draw_upload.c |9 +
 src/gallium/drivers/i965/brw_screen.c  |   21 +
 2 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/i965/brw_draw_upload.c b/src/gallium/drivers/i965/brw_draw_upload.c
index a27da5f..4ca75e0 100644
--- a/src/gallium/drivers/i965/brw_draw_upload.c
+++ b/src/gallium/drivers/i965/brw_draw_upload.c
@@ -170,6 +170,15 @@ static unsigned brw_translate_surface_format( unsigned id )
case PIPE_FORMAT_R8G8B8A8_SSCALED:
   return BRW_SURFACEFORMAT_R8G8B8A8_SSCALED;
 
+   case PIPE_FORMAT_R16_FLOAT:
+  return BRW_SURFACEFORMAT_R16_FLOAT;
+   case PIPE_FORMAT_R16G16_FLOAT:
+  return BRW_SURFACEFORMAT_R16G16_FLOAT;
+   case PIPE_FORMAT_R16G16B16X16_FLOAT:
+  return BRW_SURFACEFORMAT_R16G16B16X16_FLOAT;
+   case PIPE_FORMAT_R16G16B16A16_FLOAT:
+  return BRW_SURFACEFORMAT_R16G16B16A16_FLOAT;
+
default:
   assert(0);
   return 0;
diff --git a/src/gallium/drivers/i965/brw_screen.c b/src/gallium/drivers/i965/brw_screen.c
index 0ecacac..d3505cb 100644
--- a/src/gallium/drivers/i965/brw_screen.c
+++ b/src/gallium/drivers/i965/brw_screen.c
@@ -203,6 +203,26 @@ brw_get_paramf(struct pipe_screen *screen, int param)
 }
 
 static boolean
+brw_is_vertex_format_supported(struct pipe_screen *screen,
+			   enum pipe_format format)
+{
+   static const GLuint pipe_format_extra[] = {
+  PIPE_FORMAT_R16_FLOAT,
+  PIPE_FORMAT_R16G16_FLOAT,
+  PIPE_FORMAT_R16G16B16X16_FLOAT,
+  PIPE_FORMAT_R16G16B16A16_FLOAT,
+  PIPE_FORMAT_NONE,
+   };
+   int i;
+
+   for (i = 0; pipe_format_extra[i] != PIPE_FORMAT_NONE; i++) {
+  if (pipe_format_extra[i] == format)
+	 return TRUE;
+   }
+   return FALSE;
+}
+
+static boolean
 brw_is_format_supported(struct pipe_screen *screen,
  enum pipe_format format, 
  enum pipe_texture_target target,
@@ -387,6 +407,7 @@ brw_create_screen(struct brw_winsys_screen *sws, uint pci_id)
bscreen-base.get_vendor = brw_get_vendor;
bscreen-base.get_param = brw_get_param;
bscreen-base.get_paramf = brw_get_paramf;
+   bscreen-base.is_vertex_format_supported = brw_is_vertex_format_supported;
bscreen-base.is_format_supported = brw_is_format_supported;
bscreen-base.fence_reference = brw_fence_reference;
bscreen-base.fence_signalled = brw_fence_signalled;
-- 
1.6.5.2

From 0b0624f0530c9825f72bf1e1af1993d2749c5ce5 Mon Sep 17 00:00:00 2001
From: Dave Airlie airl...@linux.ie
Date: Tue, 26 Jan 2010 19:10:06 +1000
Subject: [PATCH 1/2] gallium: add support for ARB_half_float_vertex

This adds a new screen interface, is_vertex_format_supported which we
used to query for the different half float vertex types, from Luca's reading
of NV30 docs it appears we need an R16X16 as well as R16.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 src/gallium/include/pipe/p_format.h|6 ++
 src/gallium/include/pipe/p_screen.h|9 +
 src/mesa/state_tracker/st_draw.c   |   14 +-
 src/mesa/state_tracker/st_draw.h   |2 ++
 src/mesa/state_tracker/st_extensions.c |   13 +
 5 files changed, 43 insertions(+), 1 deletions(-)

diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h
index 6bfff1c..d3af65a 100644
--- a/src/gallium/include/pipe/p_format.h
+++ b/src/gallium/include/pipe/p_format.h
@@ -166,6 +166,12 @@ enum pipe_format {
PIPE_FORMAT_DXT3_SRGBA= 108,
PIPE_FORMAT_DXT5_SRGBA= 109,
 
+   /* based on DX formats + R16X16 for nv30 */
+   PIPE_FORMAT_R16_FLOAT = 110,
+   PIPE_FORMAT_R16X16_FLOAT  = 111,
+   PIPE_FORMAT_R16G16_FLOAT  = 112,
+   PIPE_FORMAT_R16G16B16X16_FLOAT= 113,
+   PIPE_FORMAT_R16G16B16A16_FLOAT= 114,
PIPE_FORMAT_COUNT
 };
 
diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h
index b8e001a..887d527 100644
--- a/src/gallium/include/pipe/p_screen.h
+++ b/src/gallium/include/pipe/p_screen.h
@@ -87,6 +87,15 @@ struct pipe_screen {
float (*get_paramf)( 

Re: [Mesa3d-dev] gallium docs

2010-01-26 Thread Uros Nedic


 In fact most of my interaction with you seems based around you getting a 
 job from some company, this is not how you enter a community and I've felt 
 you've at least to me come across with all the wrong reasons for wanting 
 to do this.
I really do not want to waste my time on topics like this. I spent lot ofenergy 
for nothing. I just would like to stress this:
* I fitted very well into OpenSolaris community* I fitted very well into 
NetBeans community* I fitted very well into GNOME community
On all those three communities I contributed code on a voluntary basis.(as you 
could see I do not use @company_name email but @public_email_name)Another thing 
that is important for me is that I started to learn XWinSysand Gallium and 
found very little documentation about that.
Only persons that wanted to help me were SUN engineers. Then I started todig 
who is actually contributing something into source code base and I sawthat 
majority (more than 95%!) of email are @some_company. I started tothink that 
I'm only person on this world who is spending my spare time tocontribute 
something without demanding anything for that. Even some personsasked me on IRC 
if I work for SUN (!?). If you remember when I contacted youvia IRC I asked you 
mostly how to develop radeon drivers and about overallDRI architecture. We 
chatted about two hours and that was all.
After that you just did not want to spend time giving me hints. Then Irealized 
that maybe the best option is to ask you for job or any othercompany. In that 
case, maybe I'll receive more information since I'd workon some specific 
project. Obviously, it was mistake. I'll not discuss onthis topic anymore.
All I could say - ok guys stay close and I wish you best!
Uros
 
 To work on 3D drivers and Gallium, the main entry point I think nearly 
 everyone who works on the codebase shares is fixing bugs on a system they 
 have access to. So if you have Intel hw, trying to pick up i965g driver 
 and fixing the bugs in it, or similiar for radeon/nouveau with thier 
 gallium drivers. Most of the drivers also maintain TODO lists. Also there 
 are Mesa GL3.0 todo lists for gallium, I recently added 
 GL_ARB_half_float_vertex that was a pretty simple entry level, I haven't 
 done the gallium suppor tfor this yet.
 
 Dave.
 
  
_
Windows Live: Keep your friends up to date with what you do online.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_1:092010--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] mesa_7_7_branch - master merges

2010-01-26 Thread Keith Whitwell
On Mon, 2010-01-25 at 11:04 -0800, tom fogal wrote:
 I think we've touched on a core git workflow issue here, and its likely
 others have hit this  have a solution, so I've added the git ML to
 the CC list.
 
 Git: the situation in this repo is a fast-moving master that is
 including many changes to internal interfaces.  Stable branches just
 get bugfixes, and are periodically merged to master.  However, the more
 the heads diverge, the more difficult it is for a bugfix to merge into
 the head.  The major issue is that more experienced developers should
 really weigh in on these merges, because they tend to automagically
 undo some of the interface changes.  Yet during such a delay, master
 inevitably moves, and the bugfixer has to do even more work to redo
 the merge (and potentially get more review!).
 
 Of course, if there are two bugfixers trying to make separate changes
 in the same time period, this gets worse.
 
 Is there a workflow that can solve this issue?
 

Speaking from the Mesa side, I think part of our problem is that it's
not easy to build the entire mesa tree, which means that the developer
doing the merge cannot even compile-test the result, meaning that many
trivial failures go unnoticed.

I'd argue that if we had a maximal mesa build target that compiled
*everything*, regardless of whether it produced drivers or not, we'd
have a much better chance of catching bogus merge droppings.

Despite Jose's valid concerns, I'd still argue that the situation we
have now is superior to what came before - where people were supposed to
be cherry-picking bugfixes but more likely they were forgotten or it
fell on Brian's shoulders to do manually.

Keith


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] [PATCH 3/7] tgsi: add properties for fragment coord conventions

2010-01-26 Thread Keith Whitwell
Luca,

I would have expected fragment coord conventions to be device state, not
a part of the shader.

It seems like these new flags are really peers (or replacements?) of the
gl_rasterization_rules flag in pipe_rasterizer_state, and that the
shaders should remain unchanged.

Keith

On Wed, 2010-01-20 at 22:38 -0800, Luca Barbieri wrote:
 This adds two TGSI fragment program properties that indicate the
 fragment coord conventions.
 
 The properties behave as described in the extension spec for
 GL_ARB_fragment_coord_conventions, but the default origin in
 upper left instead of lower left as in OpenGL.
 
 The syntax is:
 PROPERTY FS_COORD_ORIGIN [UPPER_LEFT|LOWER_LEFT]
 PROPERTY FS_COORD_PIXEL_CENTER [HALF_INTEGER|INTEGER]
 
 The names have been chosen for consistency with the GS properties
 and the OpenGL extension spec.
 
 The defaults are of course the previously assumed conventions:
 UPPER_LEFT and HALF_INTEGER.
 
 It also adds 4 caps to indicate support of each of the conventios.
 These caps should be a temporary measure until all drivers support
 all conventions.
 
 Until then, the state tracker will use them to adjust WPOS and provide
 the driver something it supports.
 
 These caps include two negative caps indicating lack of support for
 the default DX9/DX10 upper left origin convention, and lack of support
 for the default OpenGL/DX10 half integer center convention.
 
 These are an even more a temporary measure until drivers are fixed.
 ---
  src/gallium/auxiliary/tgsi/tgsi_dump.c |   22 +-
  src/gallium/auxiliary/tgsi/tgsi_text.c |   63 
 +++-
  src/gallium/auxiliary/tgsi/tgsi_ureg.c |   32 ++
  src/gallium/auxiliary/tgsi/tgsi_ureg.h |7 +++
  src/gallium/include/pipe/p_defines.h   |4 ++
  src/gallium/include/pipe/p_shader_tokens.h |   10 -
  6 files changed, 135 insertions(+), 3 deletions(-)
 
 diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump.c 
 b/src/gallium/auxiliary/tgsi/tgsi_dump.c
 index d7ff262..5494467 100644
 --- a/src/gallium/auxiliary/tgsi/tgsi_dump.c
 +++ b/src/gallium/auxiliary/tgsi/tgsi_dump.c
 @@ -159,7 +159,9 @@ static const char *property_names[] =
  {
 GS_INPUT_PRIMITIVE,
 GS_OUTPUT_PRIMITIVE,
 -   GS_MAX_OUTPUT_VERTICES
 +   GS_MAX_OUTPUT_VERTICES,
 +   FS_COORD_ORIGIN,
 +   FS_COORD_PIXEL_CENTER
  };
 
  static const char *primitive_names[] =
 @@ -176,6 +178,18 @@ static const char *primitive_names[] =
 POLYGON
  };
 
 +static const char *fs_coord_origin_names[] =
 +{
 +   UPPER_LEFT,
 +   LOWER_LEFT
 +};
 +
 +static const char *fs_coord_pixel_center_names[] =
 +{
 +   HALF_INTEGER,
 +   INTEGER
 +};
 +
 
  static void
  _dump_register_decl(
 @@ -373,6 +387,12 @@ iter_property(
case TGSI_PROPERTY_GS_OUTPUT_PRIM:
   ENM(prop-u[i].Data, primitive_names);
   break;
 +  case TGSI_PROPERTY_FS_COORD_ORIGIN:
 + ENM(prop-u[i].Data, fs_coord_origin_names);
 + break;
 +  case TGSI_PROPERTY_FS_COORD_PIXEL_CENTER:
 + ENM(prop-u[i].Data, fs_coord_pixel_center_names);
 + break;
default:
   SID( prop-u[i].Data );
   break;
 diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c 
 b/src/gallium/auxiliary/tgsi/tgsi_text.c
 index 9fcffed..42832ea 100644
 --- a/src/gallium/auxiliary/tgsi/tgsi_text.c
 +++ b/src/gallium/auxiliary/tgsi/tgsi_text.c
 @@ -1116,7 +1116,9 @@ static const char *property_names[] =
  {
 GS_INPUT_PRIMITIVE,
 GS_OUTPUT_PRIMITIVE,
 -   GS_MAX_OUTPUT_VERTICES
 +   GS_MAX_OUTPUT_VERTICES,
 +   FS_COORD_ORIGIN,
 +   FS_COORD_PIXEL_CENTER
  };
 
  static const char *primitive_names[] =
 @@ -1133,6 +1135,19 @@ static const char *primitive_names[] =
 POLYGON
  };
 
 +static const char *fs_coord_origin_names[] =
 +{
 +   UPPER_LEFT,
 +   LOWER_LEFT
 +};
 +
 +static const char *fs_coord_pixel_center_names[] =
 +{
 +   HALF_INTEGER,
 +   INTEGER
 +};
 +
 +
  static boolean
  parse_primitive( const char **pcur, uint *primitive )
  {
 @@ -1150,6 +1165,40 @@ parse_primitive( const char **pcur, uint *primitive )
 return FALSE;
  }
 
 +static boolean
 +parse_fs_coord_origin( const char **pcur, uint *fs_coord_origin )
 +{
 +   uint i;
 +
 +   for (i = 0; i  sizeof(fs_coord_origin_names) / 
 sizeof(fs_coord_origin_names[0]); i++) {
 +  const char *cur = *pcur;
 +
 +  if (str_match_no_case( cur, fs_coord_origin_names[i])) {
 + *fs_coord_origin = i;
 + *pcur = cur;
 + return TRUE;
 +  }
 +   }
 +   return FALSE;
 +}
 +
 +static boolean
 +parse_fs_coord_pixel_center( const char **pcur, uint *fs_coord_pixel_center )
 +{
 +   uint i;
 +
 +   for (i = 0; i  sizeof(fs_coord_pixel_center_names) / 
 sizeof(fs_coord_pixel_center_names[0]); i++) {
 +  const char *cur = *pcur;
 +
 +  if (str_match_no_case( cur, fs_coord_pixel_center_names[i])) {
 + *fs_coord_pixel_center = i;
 + *pcur = cur;
 + return TRUE;
 +  }
 +   }
 +   return FALSE;
 +}
 +

[Mesa3d-dev] Mesa dri2: memory leak at dri2_glx.c

2010-01-26 Thread Rodolfo Ribeiro Gomes
Hello,

the function dri2CreateScreen() at src/glx/x11/dri2_glx.c (from
MesaLib package 7.6.1 and 7.7 at least) has memory leak.
It returns without free the __GLXDRIscreen *psp variable on errors.

A less intrusive modification is below. Maybe it would be better if
the drivername and devicename had been free as soon as they become
useless.

*** dri2_glx.c  2010-01-25 10:28:35.0 -0200
--- dri2_glx-modified.c 2010-01-25 10:33:21.0 -0200
***
*** 438,444 
--- 438,447 

if (!DRI2Connect(psc-dpy, RootWindow(psc-dpy, screen),
 driverName, deviceName))
+{
+   XFree(psp):
   return NULL;
+}

psc-driver = driOpenDriver(driverName);
if (psc-driver == NULL) {
***
*** 467,483 
psc-fd = open(deviceName, O_RDWR);
if (psc-fd  0) {
   ErrorMessageF(failed to open drm device: %s\n, strerror(errno));
!   return NULL;
}

if (drmGetMagic(psc-fd, magic)) {
   ErrorMessageF(failed to get magic\n);
!   return NULL;
}

if (!DRI2Authenticate(psc-dpy, RootWindow(psc-dpy, screen), magic)) {
   ErrorMessageF(failed to authenticate magic %d\n, magic);
!   return NULL;
}

/* If the server does not support the protocol for
--- 470,486 
psc-fd = open(deviceName, O_RDWR);
if (psc-fd  0) {
   ErrorMessageF(failed to open drm device: %s\n, strerror(errno));
!   goto handle_error;
}

if (drmGetMagic(psc-fd, magic)) {
   ErrorMessageF(failed to get magic\n);
!   goto handle_error;
}

if (!DRI2Authenticate(psc-dpy, RootWindow(psc-dpy, screen), magic)) {
   ErrorMessageF(failed to authenticate magic %d\n, magic);
!   goto handle_error;
}

/* If the server does not support the protocol for
***
*** 491,497 

if (psc-__driScreen == NULL) {
   ErrorMessageF(failed to create dri screen\n);
!   return NULL;
}

driBindExtensions(psc, 1);
--- 494,500 

if (psc-__driScreen == NULL) {
   ErrorMessageF(failed to create dri screen\n);
!   goto handle_error;
}

driBindExtensions(psc, 1);
***
*** 521,526 
--- 524,532 
  handle_error:
Xfree(driverName);
Xfree(deviceName);
+
+XFree(psp):
+

/* FIXME: clean up here */


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


[Mesa3d-dev] [Bug 26240] New: OML_sync_control broken with older DRI2 servers

2010-01-26 Thread bugzilla-daemon
http://bugs.freedesktop.org/show_bug.cgi?id=26240

   Summary: OML_sync_control broken with older DRI2 servers
   Product: Mesa
   Version: git
  Platform: Other
OS/Version: All
Status: NEW
  Severity: normal
  Priority: medium
 Component: GLX
AssignedTo: mesa3d-dev@lists.sourceforge.net
ReportedBy: pierre-bugzi...@ossman.eu


Commit daf7fe69f7bd0caa955d30b43fc35b7ce0069b6b changed mesa to use new DRI2
operations to implement the OML_sync_control extension. Unfortunately it broke
the extension when using mesa with a server that doesn't support those latest
extensions to DRI2 (e.g. current Xorg 1.7.x).


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


[Mesa3d-dev] [Bug 26240] OML_sync_control broken with older DRI2 servers

2010-01-26 Thread bugzilla-daemon
http://bugs.freedesktop.org/show_bug.cgi?id=26240


Pierre Ossman pierre-bugzi...@ossman.eu changed:

   What|Removed |Added

 CC||jbar...@virtuousgeek.org,
   ||pierre-bugzi...@ossman.eu




--- Comment #1 from Pierre Ossman pierre-bugzi...@ossman.eu  2010-01-26 
03:45:43 PST ---
Adding Jesse Barnes as cc as he made the relevant change.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] pipe_vertex_buffer and format translate

2010-01-26 Thread Keith Whitwell
I've had a week away, plus evolution melted down and ate my mail, so I'm
catching up on old threads that need followup.

 

On Mon, 2010-01-18 at 13:24 -0800, Corbin Simpson wrote:
 So, with half-float vert attribs looming on the horizon, I want to
 address, hopefully with some finality, vertex attrib formats.
 
 Basically, should drivers be expected to use aux/translate on
 pipe_vertex_buffers that have pipe_vertex_elements not supported in
 HW?

This is a difficult question.  Certainly for formats which are not
optional in the GL spec, the answer is yes.

For new formats that aren't exposed by default in GL, there is more
wiggle room.  For instance for half-float, it makes sense to not
advertise this to applications if it is really a slow path for the
driver, so we'd want a query/cap-bit to tell the state-tracker whether
to expose it.

 If so, then there's probably a bit more code that can be built up to
 automate the process. Also it kind of sucks because we can't translate
 on bind (the st could remap and change VBO data behind our backs) and
 so we must translate on every single draw.

Agree that translate on draw is poor. Translate on bind is better, but
best of all would be to translate on *first* bind.

  Obviously there's ways to
 alleviate this, but they all require a tad more typing than I'm going
 to commit to right now.
 
 If not, then can we add a new target/usage/whatever to
 is_format_supported, or rename it to is_texture_format_supported and
 add is_vertex_format_supported? Let the state tracker worry about this
 nonsense.

This sounds again like the sort of task that we don't want to do in
either all state trackers or in all drivers - ie. something which would
be most conveniently handled in an intermediate layer between the two.

This is something which has been discussed before, and I'm happy with
the idea providing it is something pulled in by the driver and the
overall entity continues to expose the existing pipe_screen/pipe_context
interfaces to the state-tracker.

That said, it's not hugely difficult to get this to work in any driver
with access the draw module with basically zero effort.  I know you'd
prefer to avoid the draw module, but solving this type of problem is one
of the reasons it exists.

 Either way, I anticipate having to build a function that, given a
 pipe_vertex_element and pipe_vertex_buffer, and a list of acceptable
 pipe_formats, internally magically modifies things inside so that all
 resulting VBOs are safe for HW.

This sounds like a useful utility.

Keith


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] gallium docs

2010-01-26 Thread José Fonseca
On Mon, 2010-01-25 at 23:28 -0800, Uros Nedic wrote:
 First of all I consider myself as experienced C/C++/Java programmer.
 Even tough I know other languages this is my primary area of
 expertise.
 Also I have very good background in CS, mathematics, etc.
 
 
 What I wanted to say is that rapidly-changing GPU architectures market
 is not possible to track if you are not spending significant amount
 of time to learn about it and to keep informed. Learning curve is just
 to high.
 
 
 At the same time guys from Gallium started one really nice project,
 where I found myself. I saw that in Windows world something similar
 is happening. Ultimately, it is industry trend.
 
 
 I wanted to join to gallium community and asked one of leaders to
 tell me number of people, etc. His conversation with me was rather
 tough than welcomed. All I got is that I have to write to mesa3d-dev
 and hope that anyone would respond.
 
 
 Exactly as one developer noticed - I had to hijack thread in hope
 that anyone would read it. It looks like my idea succeeded. We are
 talking about that now.
 
 
 Another thing that bother me, is that gallium community is very small
 but worse thing is that some of people who are working on gallium are
 very hard to approach, even arrogant. This is certainly not way how to
 build successful society, for sure. It looks like that they consider
 themselves as that they have some mission and stuffs like community
 are not important at all.
 
 
 Documentation, as an example, fits perfectly into my story. There is
 no
 successful community if there aren't good documentation. I really do
 not know how do you imagine to develop any large-scale project if
 you do not develop documentation concurrently with code!?
 Documentation
 is at least important as source code is (read Donald Knuth!).
 
 
 But if some developers (I do not want to say all!) consider themselves
 as a higher class then they will get corresponding community
 response.
 
 
 I would like to start contributing to gallium community but behavior
 of some developers and luck of documentation simply rejects me from
 that.
 This is my final call that you make revision of your current policy
 to the rest of the world (community), and to apologize and start to
 communicate.
 
 
 Regards,
 Uros Nedic, MSc

Uros,

You're right went you say documentation would increase community size.
More importantly, the life of the already existing developer community
would be easier if there was more documentation. We all agree on this,
and things have lately been going in the right direction, as a spec is
being written.

But documentation is not an absolute requirement to join. I complained
about lack of documentation 8 years ago, but I didn't stop -- I analyzed
the whole archive of mesa3d-dev and dri-dev mailing lists, created FAQs,
glossaries, a wiki. A lot of that material is in todays' DRI wiki still.

The problem is here is developer's time. And once in a while you see a
newbie demanding documentation, personalized help, or pushing their
vision of what the architecture should look like. And we really have no
time to produce that documentation immediately, explaining basic stuff,
or argue why things are as they are. Probably you're better than one of
them, but unfortunately you sounded like one, and that's probably why
this harsh reaction.

In summary, it is not our intention to be elitist and put the entry bar
high to avoid newbies, but we simply do not have the time to lower the
bar ourselves. If newbies are really serious about participating and
joining development, they will have to surpass the hurdles themselves
and hopefully help lower the entry bar while they still remember how
difficult it is to get started on this.

Jose



--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


[Mesa3d-dev] One more memory leak:

2010-01-26 Thread Rodolfo Ribeiro Gomes
At Mesa 7.6.1 , src/glx/x11/glxcurrent.c line 369:

  __GLXDRIdrawable *pdraw = FetchDRIDrawable(dpy, draw, gc);
  __GLXDRIdrawable *pread = FetchDRIDrawable(dpy, read, gc);

  if ((pdraw == NULL) || (pread == NULL)) {
 __glXGenerateError(dpy, gc, (pdraw == NULL) ? draw : read,
GLXBadDrawable, X_GLXMakeContextCurrent);
  ///
 // If one of pdraw or pread is not NULL, they'll be not freed.
 ///
 return False;
  }

Anyway, how is it supposed to be freed in a normal situation?
I mean, I create a context (glXCreateContext), make it current 
(MakeContextCurrent).
At the end of program, I do another glXMakeCurrent(display, None, NULL) 
and destroy
my context (glXDestroyContext(display, context)). But the pdraw is not 
freed...

Regards,
Rodolfo

PS: Using Mesa 7.6.1 and radeon r300 driver with dri


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


[Mesa3d-dev] [Bug 23884] Unigine Tropics demo requires GL_ARB_half_float_vertex

2010-01-26 Thread bugzilla-daemon
http://bugs.freedesktop.org/show_bug.cgi?id=23884





--- Comment #5 from Sven Arvidsson s...@whiz.se  2010-01-26 05:53:22 PST ---
GL_EXT_framebuffer_multisample already seems to have been merged, but I guess
it's not implemented or possibly not supported by i965?


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] Supporting cards with OpenGL-like WPOS in hardware?

2010-01-26 Thread Keith Whitwell
On Wed, 2010-01-20 at 17:28 -0800, Luca Barbieri wrote:

  For nv, could this be exposed as a hardware capability which the
  state-tracker could take advantage of, and if not present fall back to
  the current shader modification in the state-tracker?
 
 Yes, this is the easiest fix, but it means that TGSI semantics start
 to be driver-dependent.
 For instance, you wouldn't be able to store a TGSI shader using
 POSITION to disk and have it produce the same results on all drivers.
 This seems contrary to the principles embodied by the current design.

The result of executing a shader has always been dependent on the state
of the pipe_context doing the execution, and also the currently bound
vertex/constant buffers.

You can only expect the same results from a shader to be identical if
you execute the shader on identically set up contexts.  That would
extend to these new bits of state.

Keith


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] [PATCH] hack around commas in macro argument

2010-01-26 Thread Roland Scheidegger
On 26.01.2010 09:18, Marvin wrote:
 Jose, Brian,
 
 Marc,

 Why is this necessary? It has been working fine so far. Which gcc version
  are you using? What commas are you referring to?
 
 the PIPE_ALIGN_TYPE macro is so far only used in the cell driver in 
 src/gallium/drivers/cell/spu/spu_main.c  (this is probably why no one noticed 
 it).
 
 The marco takes a type, a stuct in this case, which can include commas:
 
 PIPE_ALIGN_TYPE(16,
 struct spu_framebuffer
 {
void *color_start;  /** addr of color surface in main memory 
 */
void *depth_start;  /** addr of depth surface in main memory 
 */
enum pipe_format color_format;
enum pipe_format depth_format;
uint width, height; /** size in pixels */
 ^^^
 
uint width_tiles, height_tiles; /** width and height in tiles */
   ^^^
 
uint color_clear_value;
uint depth_clear_value;
 
uint zsize; /** 0, 2 or 4 bytes per Z */
float zscale;   /** 65535.0, 2^24-1 or 2^32-1 */
 });
 
 This will cause a problem, as the macro will thread each comma as an argument 
 seperator and thus the number of arguments is larger than 2.

Hmm, maybe could just avoid the problem by not using commas in the
struct declaration?

Roland


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


[Mesa3d-dev] [Bug 23884] Unigine Tropics demo requires GL_ARB_half_float_vertex

2010-01-26 Thread bugzilla-daemon
http://bugs.freedesktop.org/show_bug.cgi?id=23884





--- Comment #6 from Roland Scheidegger srol...@tungstengraphics.com  
2010-01-26 06:01:46 PST ---
(In reply to comment #5)
 GL_EXT_framebuffer_multisample already seems to have been merged, but I guess
 it's not implemented or possibly not supported by i965?

i965 can't do multisampling at all.
I haven't looked too closely at the extension, but I think it could probably be
supported just like ARB_multisample is - that is, it's pretty much an empty
implementation which won't really do anything since there simply are no multi
sample buffers available.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


[Mesa3d-dev] Another memory leak : glXChooseVisual

2010-01-26 Thread Rodolfo Ribeiro Gomes
Hello again.

When creating a screen, my apps follow these steps (valgrind output):

==4307==by 0x4E6F77D: XF86DRIGetDeviceInfo (XF86dri.c:596)
==4307==by 0x4E6EBE6: driCreateScreen (dri_glx.c:386)
==4307==by 0x4E4E5C1: __glXInitialize (glxext.c:627)
==4307==by 0x4E4965C: GetGLXPrivScreenConfig (glxcmds.c:188)
==4307==by 0x4E4A5CE: glXChooseVisual (glxcmds.c:1403)
==4307==by 0x4016DD: createWindow (teste-x11.c:123)


The non-freed memory is from here, the framebuffer.dev_priv (dri_glx.c:386).
   if (!XF86DRIGetDeviceInfo(dpy, scrn, hFB, junk,
 framebuffer.size, framebuffer.stride,
 framebuffer.dev_priv_size,
 framebuffer.dev_priv)) {
  ErrorMessageF(XF86DRIGetDeviceInfo failed);
  goto handle_error;
   }

And it is called from glXChooseVisual (glxcmds.c)

   if (GetGLXPrivScreenConfig(dpy, screen, priv, psc) != Success) {
  return None;
   }

The psc (PrivScreenConfig structure) contains the non-freed data.

Maybe it should be freed at the end of glXChooseVisual() ?

Regards,
Rodolfo

PS: I'm using Mesa 7.6.1 and dri.



--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


[Mesa3d-dev] perrtblend merge

2010-01-26 Thread Roland Scheidegger
Hi,

I'm planning on merging this branch to master soon.
This will make it possible to do per render target blend enables,
colormasks, and also per rendertarget blend funcs (with a different CAP
bit for the latter, and this one isn't actually used in mesa state
tracker yet).
None of the drivers other than softpipe implement any of it, but they
were adapted to the interface changes so should continue to run.
Apparently, that functionality is only interesting for drivers
supporting multiple render targets, and the hw probably needs to be
quite new (I know that i965 could support it (well not the multiple
blend funcs but the rest), but the driver currently only supports 1
render target).

Roland

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] [PATCH 3/7] tgsi: add properties for fragment coord conventions

2010-01-26 Thread Christoph Bumiller
On 26.01.2010 12:11, Keith Whitwell wrote:
 Luca,

 I would have expected fragment coord conventions to be device state, not
 a part of the shader.

   
In OpenGL you specify the convention in the shader source,
e.g. with layout(...) in vec4 gl_FragCoord, so they _are_ part
of the shader; I don't know about D3D.
In any case, they are independent of the rasterization rules.
 It seems like these new flags are really peers (or replacements?) of the
 gl_rasterization_rules flag in pipe_rasterizer_state, and that the
 shaders should remain unchanged.

   
Also gl_rasterization_rules is set to 1 in the mesa state tracker,
and yet it expects FragCoord to need inversion ... that doesn't
add up.

Adding a property could be avoided if we specify the input to
always be Y_0_TOP, but we might end up with double inversion
in some cases.

Christoph
 Keith

 On Wed, 2010-01-20 at 22:38 -0800, Luca Barbieri wrote:
   
 This adds two TGSI fragment program properties that indicate the
 fragment coord conventions.

 The properties behave as described in the extension spec for
 GL_ARB_fragment_coord_conventions, but the default origin in
 upper left instead of lower left as in OpenGL.

 The syntax is:
 PROPERTY FS_COORD_ORIGIN [UPPER_LEFT|LOWER_LEFT]
 PROPERTY FS_COORD_PIXEL_CENTER [HALF_INTEGER|INTEGER]

 The names have been chosen for consistency with the GS properties
 and the OpenGL extension spec.

 The defaults are of course the previously assumed conventions:
 UPPER_LEFT and HALF_INTEGER.

 It also adds 4 caps to indicate support of each of the conventios.
 These caps should be a temporary measure until all drivers support
 all conventions.

 Until then, the state tracker will use them to adjust WPOS and provide
 the driver something it supports.

 These caps include two negative caps indicating lack of support for
 the default DX9/DX10 upper left origin convention, and lack of support
 for the default OpenGL/DX10 half integer center convention.

 These are an even more a temporary measure until drivers are fixed.
 ---
  src/gallium/auxiliary/tgsi/tgsi_dump.c |   22 +-
  src/gallium/auxiliary/tgsi/tgsi_text.c |   63 
 +++-
  src/gallium/auxiliary/tgsi/tgsi_ureg.c |   32 ++
  src/gallium/auxiliary/tgsi/tgsi_ureg.h |7 +++
  src/gallium/include/pipe/p_defines.h   |4 ++
  src/gallium/include/pipe/p_shader_tokens.h |   10 -
  6 files changed, 135 insertions(+), 3 deletions(-)

 diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump.c 
 b/src/gallium/auxiliary/tgsi/tgsi_dump.c
 index d7ff262..5494467 100644
 --- a/src/gallium/auxiliary/tgsi/tgsi_dump.c
 +++ b/src/gallium/auxiliary/tgsi/tgsi_dump.c
 @@ -159,7 +159,9 @@ static const char *property_names[] =
  {
 GS_INPUT_PRIMITIVE,
 GS_OUTPUT_PRIMITIVE,
 -   GS_MAX_OUTPUT_VERTICES
 +   GS_MAX_OUTPUT_VERTICES,
 +   FS_COORD_ORIGIN,
 +   FS_COORD_PIXEL_CENTER
  };

  static const char *primitive_names[] =
 @@ -176,6 +178,18 @@ static const char *primitive_names[] =
 POLYGON
  };

 +static const char *fs_coord_origin_names[] =
 +{
 +   UPPER_LEFT,
 +   LOWER_LEFT
 +};
 +
 +static const char *fs_coord_pixel_center_names[] =
 +{
 +   HALF_INTEGER,
 +   INTEGER
 +};
 +

  static void
  _dump_register_decl(
 @@ -373,6 +387,12 @@ iter_property(
case TGSI_PROPERTY_GS_OUTPUT_PRIM:
   ENM(prop-u[i].Data, primitive_names);
   break;
 +  case TGSI_PROPERTY_FS_COORD_ORIGIN:
 + ENM(prop-u[i].Data, fs_coord_origin_names);
 + break;
 +  case TGSI_PROPERTY_FS_COORD_PIXEL_CENTER:
 + ENM(prop-u[i].Data, fs_coord_pixel_center_names);
 + break;
default:
   SID( prop-u[i].Data );
   break;
 diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c 
 b/src/gallium/auxiliary/tgsi/tgsi_text.c
 index 9fcffed..42832ea 100644
 --- a/src/gallium/auxiliary/tgsi/tgsi_text.c
 +++ b/src/gallium/auxiliary/tgsi/tgsi_text.c
 @@ -1116,7 +1116,9 @@ static const char *property_names[] =
  {
 GS_INPUT_PRIMITIVE,
 GS_OUTPUT_PRIMITIVE,
 -   GS_MAX_OUTPUT_VERTICES
 +   GS_MAX_OUTPUT_VERTICES,
 +   FS_COORD_ORIGIN,
 +   FS_COORD_PIXEL_CENTER
  };

  static const char *primitive_names[] =
 @@ -1133,6 +1135,19 @@ static const char *primitive_names[] =
 POLYGON
  };

 +static const char *fs_coord_origin_names[] =
 +{
 +   UPPER_LEFT,
 +   LOWER_LEFT
 +};
 +
 +static const char *fs_coord_pixel_center_names[] =
 +{
 +   HALF_INTEGER,
 +   INTEGER
 +};
 +
 +
  static boolean
  parse_primitive( const char **pcur, uint *primitive )
  {
 @@ -1150,6 +1165,40 @@ parse_primitive( const char **pcur, uint *primitive )
 return FALSE;
  }

 +static boolean
 +parse_fs_coord_origin( const char **pcur, uint *fs_coord_origin )
 +{
 +   uint i;
 +
 +   for (i = 0; i  sizeof(fs_coord_origin_names) / 
 sizeof(fs_coord_origin_names[0]); i++) {
 +  const char *cur = *pcur;
 +
 +  if (str_match_no_case( cur, fs_coord_origin_names[i])) {
 + 

Re: [Mesa3d-dev] [PATCH] glx: Build GLX normally.

2010-01-26 Thread Brian Paul
Chia-I Wu wrote:
[...]
 If I find some time, I want to move main/dispatch.c to glapi/ and move
 glapi/dispatch.h to main/.  dispatch.c is a glapi source and it is weird to
 have it in main/;  On the other hand, dispatch.h is a core mesa header and it
 is also weird to have it in glapi/.  It will be more clear that core mesa is
 the sole user of IN_DRI_DRIVER after the change.

Sounds good.  The dispatch code has been redesigned and reorganized a 
few times over the years.  I think it's ripe for a clean-up so 
anything you can do simplify and clean it up is great.

-Brian

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] perrtblend merge

2010-01-26 Thread Roland Scheidegger
Oh, I should have added the PIPE_CAP bits (even if not supported) to all
drivers. Good catch. I'll do that for the other drivers now.

Roland

(btw, I think r500 could do separate colormasks, but not separate blend
enables, and there might be more hardware like that. However, this is
not exposed by GL, it might be supported by some DX9 cap bit, but it
didn't seem worthwile to add a separate gallium cap bit for supporting
per-rt blend enables and colormasks, respectively.)

On 26.01.2010 16:37, Corbin Simpson wrote:
 Yeah, r300 doesn't but r600 does. I've read through the branch, and
 the r300g patch looks perfect. I've pushed another patch on top for
 the pipe caps, to avoid post-merge cleanups for myself.
 
 On Tue, Jan 26, 2010 at 7:00 AM, Alex Deucher alexdeuc...@gmail.com wrote:
 On Tue, Jan 26, 2010 at 9:44 AM, Roland Scheidegger srol...@vmware.com 
 wrote:
 Hi,

 I'm planning on merging this branch to master soon.
 This will make it possible to do per render target blend enables,
 colormasks, and also per rendertarget blend funcs (with a different CAP
 bit for the latter, and this one isn't actually used in mesa state
 tracker yet).
 None of the drivers other than softpipe implement any of it, but they
 were adapted to the interface changes so should continue to run.
 Apparently, that functionality is only interesting for drivers
 supporting multiple render targets, and the hw probably needs to be
 quite new (I know that i965 could support it (well not the multiple
 blend funcs but the rest), but the driver currently only supports 1
 render target).
 FWIW, AMD R6xx+ hw supports MRTs and per-MRT blends as well, although
 at the moment the driver also only supports 1 RT.

 Alex

 --
 The Planet: dedicated and managed hosting, cloud storage, colocation
 Stay online with enterprise data centers and the best network in the business
 Choose flexible plans and management services without long-term contracts
 Personal 24x7 support from experience hosting pros just a phone call away.
 http://p.sf.net/sfu/theplanet-com
 ___
 Mesa3d-dev mailing list
 Mesa3d-dev@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

 
 
 


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] perrtblend merge

2010-01-26 Thread Alex Deucher
On Tue, Jan 26, 2010 at 11:03 AM, Roland Scheidegger srol...@vmware.com wrote:
 Oh, I should have added the PIPE_CAP bits (even if not supported) to all
 drivers. Good catch. I'll do that for the other drivers now.

 Roland

 (btw, I think r500 could do separate colormasks, but not separate blend
 enables, and there might be more hardware like that. However, this is
 not exposed by GL, it might be supported by some DX9 cap bit, but it
 didn't seem worthwile to add a separate gallium cap bit for supporting
 per-rt blend enables and colormasks, respectively.)

Seems fine.  It would be easy to add later if the need arises.

Alex


 On 26.01.2010 16:37, Corbin Simpson wrote:
 Yeah, r300 doesn't but r600 does. I've read through the branch, and
 the r300g patch looks perfect. I've pushed another patch on top for
 the pipe caps, to avoid post-merge cleanups for myself.

 On Tue, Jan 26, 2010 at 7:00 AM, Alex Deucher alexdeuc...@gmail.com wrote:
 On Tue, Jan 26, 2010 at 9:44 AM, Roland Scheidegger srol...@vmware.com 
 wrote:
 Hi,

 I'm planning on merging this branch to master soon.
 This will make it possible to do per render target blend enables,
 colormasks, and also per rendertarget blend funcs (with a different CAP
 bit for the latter, and this one isn't actually used in mesa state
 tracker yet).
 None of the drivers other than softpipe implement any of it, but they
 were adapted to the interface changes so should continue to run.
 Apparently, that functionality is only interesting for drivers
 supporting multiple render targets, and the hw probably needs to be
 quite new (I know that i965 could support it (well not the multiple
 blend funcs but the rest), but the driver currently only supports 1
 render target).
 FWIW, AMD R6xx+ hw supports MRTs and per-MRT blends as well, although
 at the moment the driver also only supports 1 RT.

 Alex

 --
 The Planet: dedicated and managed hosting, cloud storage, colocation
 Stay online with enterprise data centers and the best network in the 
 business
 Choose flexible plans and management services without long-term contracts
 Personal 24x7 support from experience hosting pros just a phone call away.
 http://p.sf.net/sfu/theplanet-com
 ___
 Mesa3d-dev mailing list
 Mesa3d-dev@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mesa3d-dev







--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


[Mesa3d-dev] [PATCH] Don't bind DRAW/READ_FRAMEBUFFER separately without FBO blit support

2010-01-26 Thread Erik Wien
Hi. Attached is a patch fixing a GL-Error when deleting the currently
bound framebuffer without the GL_EXT_framebuffer-blit extension enabled.

- Erik
From f3d8345a5cbbc46480d1fae5f908d77761b09adb Mon Sep 17 00:00:00 2001
From: Erik Wien e...@wien-systems.no
Date: Tue, 26 Jan 2010 16:48:57 +0100
Subject: [PATCH] mesa: Don't bind DRAW/READ_FRAMEBUFFER separately without FBO blit support.

If GL_EXT_framebuffer_blit was not supported _mesa_DeleteFramebuffersEXT
would raise an error when deleting the currently bound framebuffer. This
because it tried to bind the default DRAW- and READ_FRAMEBUFFER separately.
This patch binds the default FRAMEBUFFER instead in that case.

Encountered in the fbo/fbo-copyteximage piglit test on R600.
---
 src/mesa/main/fbobject.c |   28 
 1 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 0556f16..c3c9aad 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1353,15 +1353,27 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers)
 ASSERT(fb == DummyFramebuffer || fb-Name == framebuffers[i]);
 
 /* check if deleting currently bound framebuffer object */
-if (fb == ctx-DrawBuffer) {
-   /* bind default */
-   ASSERT(fb-RefCount = 2);
-   _mesa_BindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
+if (!ctx-Extensions.EXT_framebuffer_blit) {
+   /* if FBO blit is not available, binding DRAW_FRAMEBUFFER or
+  READ_FRAMEBUFFER directly will raise an error in
+  BindFramebuffer. Use FRAMEBUFFER in that case: */
+   if (fb == ctx-DrawBuffer || fb == ctx-ReadBuffer) {
+  /* bind default */
+  ASSERT(fb-RefCount = 2);
+  _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+   }
 }
-if (fb == ctx-ReadBuffer) {
-   /* bind default */
-   ASSERT(fb-RefCount = 2);
-   _mesa_BindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0);
+else {
+   if (fb == ctx-DrawBuffer) {
+  /* bind default */
+  ASSERT(fb-RefCount = 2);
+  _mesa_BindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
+   }
+   if (fb == ctx-ReadBuffer) {
+  /* bind default */
+  ASSERT(fb-RefCount = 2);
+  _mesa_BindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0);
+   }
 }
 
 	/* remove from hash table immediately, to free the ID */
-- 
1.6.5

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] gallium docs

2010-01-26 Thread Corbin Simpson
A large part of the bar being so high is that this is not easy! GPUs
are tough, fickle beasts to master, requiring more code than just
about any other bit of dedicated HW to setup and use. Each GPU is
different, and the documentation on each GPU (when it exists) often
lacks the deep details needed to actually pull all the functionality
together. This kind of information is, more often than not, put
directly into the source code, and if it's weird enough, it'll get a
comment too, but we don't maintain exhaustive lists of errata or
tricky things like some other communities do, because they're
unfixable and unchangeable. In my experience, other communities
document these things primarily so they can get fixed later, but GPUs
can't be changed.

We *do* answer questions when we have the time. However, the amateurs
are busy with other things (for example, I'm a full-time student,
part-time coder, part-time musician) and the pros are either working
for distros, in which case they aren't paid to answer your questions,
or they're TG/VMWare, in which case they probably can't help as much
as you'd like with GPU-specific questions. Additionally, the community
really has two halves. The mailing list is great for Mesa/Gallium
questions, as all the Gallium designers are on here, but you won't get
much help with a chipset-specific query. For that, you've gotta go to
IRC; the Big Three all have channels dedicated to GPU development:
#intel-gfx, #nouveau, and #radeon, all on Freenode.

The bar's getting lower all the time, but spending a couple hours on
Wikipedia learning about rasterizer-driven pipelines and the basics of
computer graphics will go a long way towards understanding what's
going on in the code.

On Tue, Jan 26, 2010 at 4:33 AM, José Fonseca jfons...@vmware.com wrote:
 On Mon, 2010-01-25 at 23:28 -0800, Uros Nedic wrote:
 First of all I consider myself as experienced C/C++/Java programmer.
 Even tough I know other languages this is my primary area of
 expertise.
 Also I have very good background in CS, mathematics, etc.


 What I wanted to say is that rapidly-changing GPU architectures market
 is not possible to track if you are not spending significant amount
 of time to learn about it and to keep informed. Learning curve is just
 to high.


 At the same time guys from Gallium started one really nice project,
 where I found myself. I saw that in Windows world something similar
 is happening. Ultimately, it is industry trend.


 I wanted to join to gallium community and asked one of leaders to
 tell me number of people, etc. His conversation with me was rather
 tough than welcomed. All I got is that I have to write to mesa3d-dev
 and hope that anyone would respond.


 Exactly as one developer noticed - I had to hijack thread in hope
 that anyone would read it. It looks like my idea succeeded. We are
 talking about that now.


 Another thing that bother me, is that gallium community is very small
 but worse thing is that some of people who are working on gallium are
 very hard to approach, even arrogant. This is certainly not way how to
 build successful society, for sure. It looks like that they consider
 themselves as that they have some mission and stuffs like community
 are not important at all.


 Documentation, as an example, fits perfectly into my story. There is
 no
 successful community if there aren't good documentation. I really do
 not know how do you imagine to develop any large-scale project if
 you do not develop documentation concurrently with code!?
 Documentation
 is at least important as source code is (read Donald Knuth!).


 But if some developers (I do not want to say all!) consider themselves
 as a higher class then they will get corresponding community
 response.


 I would like to start contributing to gallium community but behavior
 of some developers and luck of documentation simply rejects me from
 that.
 This is my final call that you make revision of your current policy
 to the rest of the world (community), and to apologize and start to
 communicate.


 Regards,
 Uros Nedic, MSc

 Uros,

 You're right went you say documentation would increase community size.
 More importantly, the life of the already existing developer community
 would be easier if there was more documentation. We all agree on this,
 and things have lately been going in the right direction, as a spec is
 being written.

 But documentation is not an absolute requirement to join. I complained
 about lack of documentation 8 years ago, but I didn't stop -- I analyzed
 the whole archive of mesa3d-dev and dri-dev mailing lists, created FAQs,
 glossaries, a wiki. A lot of that material is in todays' DRI wiki still.

 The problem is here is developer's time. And once in a while you see a
 newbie demanding documentation, personalized help, or pushing their
 vision of what the architecture should look like. And we really have no
 time to produce that documentation immediately, explaining basic stuff,
 or argue why things 

Re: [Mesa3d-dev] perrtblend merge

2010-01-26 Thread Christoph Bumiller
On 26.01.2010 17:03, Roland Scheidegger wrote:
 Oh, I should have added the PIPE_CAP bits (even if not supported) to all
 drivers. Good catch. I'll do that for the other drivers now.

   
Ohhh sorry, I wanted to push the nv50 support for separate blend
to the perrtblend branch and accidentally created a new one ...
Can this somehow be cleansed ?
 Roland

 (btw, I think r500 could do separate colormasks, but not separate blend
 enables, and there might be more hardware like that. However, this is
 not exposed by GL, it might be supported by some DX9 cap bit, but it
 didn't seem worthwile to add a separate gallium cap bit for supporting
 per-rt blend enables and colormasks, respectively.)

 On 26.01.2010 16:37, Corbin Simpson wrote:
   
 Yeah, r300 doesn't but r600 does. I've read through the branch, and
 the r300g patch looks perfect. I've pushed another patch on top for
 the pipe caps, to avoid post-merge cleanups for myself.

 On Tue, Jan 26, 2010 at 7:00 AM, Alex Deucher alexdeuc...@gmail.com wrote:
 
 On Tue, Jan 26, 2010 at 9:44 AM, Roland Scheidegger srol...@vmware.com 
 wrote:
   
 Hi,

 I'm planning on merging this branch to master soon.
 This will make it possible to do per render target blend enables,
 colormasks, and also per rendertarget blend funcs (with a different CAP
 bit for the latter, and this one isn't actually used in mesa state
 tracker yet).
 None of the drivers other than softpipe implement any of it, but they
 were adapted to the interface changes so should continue to run.
 Apparently, that functionality is only interesting for drivers
 supporting multiple render targets, and the hw probably needs to be
 quite new (I know that i965 could support it (well not the multiple
 blend funcs but the rest), but the driver currently only supports 1
 render target).
 
 FWIW, AMD R6xx+ hw supports MRTs and per-MRT blends as well, although
 at the moment the driver also only supports 1 RT.

 Alex

 --
 The Planet: dedicated and managed hosting, cloud storage, colocation
 Stay online with enterprise data centers and the best network in the 
 business
 Choose flexible plans and management services without long-term contracts
 Personal 24x7 support from experience hosting pros just a phone call away.
 http://p.sf.net/sfu/theplanet-com
 ___
 Mesa3d-dev mailing list
 Mesa3d-dev@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

   


 

 --
 The Planet: dedicated and managed hosting, cloud storage, colocation
 Stay online with enterprise data centers and the best network in the business
 Choose flexible plans and management services without long-term contracts
 Personal 24x7 support from experience hosting pros just a phone call away.
 http://p.sf.net/sfu/theplanet-com
 ___
 Mesa3d-dev mailing list
 Mesa3d-dev@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
   


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] perrtblend merge

2010-01-26 Thread Jakob Bornecrantz
On 26 jan 2010, at 17.05, Christoph Bumiller wrote:
 On 26.01.2010 17:03, Roland Scheidegger wrote:
 Oh, I should have added the PIPE_CAP bits (even if not supported)  
 to all
 drivers. Good catch. I'll do that for the other drivers now.


 Ohhh sorry, I wanted to push the nv50 support for separate blend
 to the perrtblend branch and accidentally created a new one ...
 Can this somehow be cleansed ?

First get the change to the branch you want it to land in.

Then do git push origin :separate_blend that is, push nothing to  
branch separate_blend, which is how you delete branches in git.

Cheers Jakob.

[SNIP]

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] perrtblend merge

2010-01-26 Thread Keith Whitwell
On Tue, 2010-01-26 at 09:05 -0800, Christoph Bumiller wrote:
 On 26.01.2010 17:03, Roland Scheidegger wrote:
  Oh, I should have added the PIPE_CAP bits (even if not supported) to all
  drivers. Good catch. I'll do that for the other drivers now.
 

 Ohhh sorry, I wanted to push the nv50 support for separate blend
 to the perrtblend branch and accidentally created a new one ...
 Can this somehow be cleansed ?

Maybe wait until after the real branch is merged so there are no
mistakes, but eventually do:

  git push origin :name-of-branch-to-kill

Note the leading colon.

Keith


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] perrtblend merge

2010-01-26 Thread Christoph Bumiller
On 26.01.2010 18:16, Keith Whitwell wrote:
 On Tue, 2010-01-26 at 09:05 -0800, Christoph Bumiller wrote:
   
 On 26.01.2010 17:03, Roland Scheidegger wrote:
 
 Oh, I should have added the PIPE_CAP bits (even if not supported) to all
 drivers. Good catch. I'll do that for the other drivers now.

   
   
 Ohhh sorry, I wanted to push the nv50 support for separate blend
 to the perrtblend branch and accidentally created a new one ...
 Can this somehow be cleansed ?
 
 Maybe wait until after the real branch is merged so there are no
 mistakes, but eventually do:

   git push origin :name-of-branch-to-kill

 Note the leading colon.

 Keith
   
Thank you.
I seem to have pushed to the correct branch now, and will
remove my ... mistake (which even has a confusing name)
after perrtblend is merged.
I think I'm becoming paranoid now too ... sorry again.

Christoph

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


[Mesa3d-dev] [Bug 23884] Unigine Tropics demo requires GL_ARB_half_float_vertex

2010-01-26 Thread bugzilla-daemon
http://bugs.freedesktop.org/show_bug.cgi?id=23884





--- Comment #7 from Ian Romanick i...@freedesktop.org  2010-01-26 10:16:51 
PST ---
(In reply to comment #6)
 (In reply to comment #5)
  GL_EXT_framebuffer_multisample already seems to have been merged, but I 
  guess
  it's not implemented or possibly not supported by i965?
 
 i965 can't do multisampling at all.
 I haven't looked too closely at the extension, but I think it could probably 
 be
 supported just like ARB_multisample is - that is, it's pretty much an empty
 implementation which won't really do anything since there simply are no multi
 sample buffers available.

Since GL_EXT_framebuffer_multisample is part of GL_ARB_framebuffer_object and
i965 supports that, I expect this is probably true.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


[Mesa3d-dev] [PATCH] glxgears: Support GLX_EXT_swap_control for querying the current swap interval.

2010-01-26 Thread Aaron Plattner
Signed-off-by: Aaron Plattner aplatt...@nvidia.com
---
 progs/xdemos/glxgears.c |   13 ++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/progs/xdemos/glxgears.c b/progs/xdemos/glxgears.c
index 2993c82..92c75ca 100644
--- a/progs/xdemos/glxgears.c
+++ b/progs/xdemos/glxgears.c
@@ -35,6 +35,7 @@
 #include X11/keysym.h
 #include GL/gl.h
 #include GL/glx.h
+#include GL/glxext.h
 
 #ifndef GLX_MESA_swap_control
 #define GLX_MESA_swap_control 1
@@ -586,11 +587,17 @@ is_glx_extension_supported(Display *dpy, const char 
*query)
  * Attempt to determine whether or not the display is synched to vblank.
  */
 static void
-query_vsync(Display *dpy)
+query_vsync(Display *dpy, GLXDrawable drawable)
 {
int interval = 0;
 
-
+#if defined(GLX_EXT_swap_control)
+   if (is_glx_extension_supported(dpy, GLX_EXT_swap_control)) {
+   unsigned int tmp = -1;
+   glXQueryDrawable(dpy, drawable, GLX_SWAP_INTERVAL_EXT, tmp);
+   interval = tmp;
+   } else
+#endif
if (is_glx_extension_supported(dpy, GLX_MESA_swap_control)) {
   PFNGLXGETSWAPINTERVALMESAPROC pglXGetSwapIntervalMESA =
   (PFNGLXGETSWAPINTERVALMESAPROC)
@@ -749,7 +756,7 @@ main(int argc, char *argv[])
make_window(dpy, glxgears, x, y, winWidth, winHeight, win, ctx);
XMapWindow(dpy, win);
glXMakeCurrent(dpy, win, ctx);
-   query_vsync(dpy);
+   query_vsync(dpy, win);
 
if (printInfo) {
   printf(GL_RENDERER   = %s\n, (char *) glGetString(GL_RENDERER));
-- 
1.6.3.3


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


[Mesa3d-dev] [PATCH 3/4] st/mesa: Gallium support for ARB_fragment_coord_conventions (v3)

2010-01-26 Thread Luca Barbieri
Changes in v3:
- Use positive caps instead of negative ones

Changes in v2:
- Updated formatting

The state tracker will use the TGSI convention properties if the hardware
exposes the appropriate capability, and otherwise adjust WPOS itself.

This will also fix some drivers that were previously broken due to their
incorrect, inadvertent, use of conventions other than upper_left+half_integer.
---
 src/mesa/state_tracker/st_extensions.c   |1 +
 src/mesa/state_tracker/st_mesa_to_tgsi.c |   74 -
 2 files changed, 72 insertions(+), 3 deletions(-)

diff --git a/src/mesa/state_tracker/st_extensions.c 
b/src/mesa/state_tracker/st_extensions.c
index 60732f3..982a1fb 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -147,6 +147,7 @@ void st_init_extensions(struct st_context *st)
 * Extensions that are supported by all Gallium drivers:
 */
ctx-Extensions.ARB_copy_buffer = GL_TRUE;
+   ctx-Extensions.ARB_fragment_coord_conventions = GL_TRUE;
ctx-Extensions.ARB_fragment_program = GL_TRUE;
ctx-Extensions.ARB_half_float_vertex = GL_TRUE;
ctx-Extensions.ARB_map_buffer_range = GL_TRUE;
diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c 
b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index 05b56c9..366729a 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -34,8 +34,10 @@
 #include pipe/p_compiler.h
 #include pipe/p_shader_tokens.h
 #include pipe/p_state.h
+#include pipe/p_context.h
 #include tgsi/tgsi_ureg.h
 #include st_mesa_to_tgsi.h
+#include st_context.h
 #include shader/prog_instruction.h
 #include shader/prog_parameter.h
 #include shader/prog_print.h
@@ -665,6 +667,22 @@ compile_instruction(
}
 }
 
+/**
+ * Emit the TGSI instructions to adjust the WPOS pixel center convention
+ */
+static void
+emit_adjusted_wpos( struct st_translate *t,
+const struct gl_program *program, GLfloat value)
+{
+   struct ureg_program *ureg = t-ureg;
+   struct ureg_dst wpos_temp = ureg_DECL_temporary(ureg);
+   struct ureg_src wpos_input = t-inputs[t-inputMapping[FRAG_ATTRIB_WPOS]];
+
+   ureg_ADD(ureg, ureg_writemask(wpos_temp, TGSI_WRITEMASK_X | 
TGSI_WRITEMASK_Y),
+  wpos_input, ureg_imm1f(ureg, value));
+
+   t-inputs[t-inputMapping[FRAG_ATTRIB_WPOS]] = ureg_src(wpos_temp);
+}
 
 /**
  * Emit the TGSI instructions for inverting the WPOS y coordinate.
@@ -690,12 +708,17 @@ emit_inverted_wpos( struct st_translate *t,
winSizeState);
 
struct ureg_src winsize = ureg_DECL_constant( ureg, winHeightConst );
-   struct ureg_dst wpos_temp = ureg_DECL_temporary( ureg );
+   struct ureg_dst wpos_temp;
struct ureg_src wpos_input = t-inputs[t-inputMapping[FRAG_ATTRIB_WPOS]];
 
/* MOV wpos_temp, input[wpos]
 */
-   ureg_MOV( ureg, wpos_temp, wpos_input );
+   if (wpos_input.File == TGSI_FILE_TEMPORARY)
+  wpos_temp = ureg_dst(wpos_input);
+   else {
+  wpos_temp = ureg_DECL_temporary( ureg );
+  ureg_MOV( ureg, wpos_temp, wpos_input );
+   }
 
/* SUB wpos_temp.y, winsize_const, wpos_input
 */
@@ -801,6 +824,7 @@ st_translate_mesa_program(
 * Declare input attributes.
 */
if (procType == TGSI_PROCESSOR_FRAGMENT) {
+  struct gl_fragment_program* fp = (struct gl_fragment_program*)program;
   for (i = 0; i  numInputs; i++) {
  t-inputs[i] = ureg_DECL_fs_input(ureg,
inputSemanticName[i],
@@ -812,7 +836,51 @@ st_translate_mesa_program(
  /* Must do this after setting up t-inputs, and before
   * emitting constant references, below:
   */
- emit_inverted_wpos( t, program );
+ struct pipe_screen* pscreen = st_context(ctx)-pipe-screen;
+ int invert = 0;
+
+ if (!fp-OriginUpperLeft) {
+if (pscreen-get_param(pscreen, 
PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT))
+   ureg_property_fs_coord_origin(ureg, 
TGSI_FS_COORD_ORIGIN_LOWER_LEFT);
+else if (pscreen-get_param(pscreen, 
PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT))
+   invert = 1;
+else
+   assert(0);
+ }
+ else {
+if (pscreen-get_param(pscreen, 
PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT)) {
+}
+else if (pscreen-get_param(pscreen, 
PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT)) {
+   ureg_property_fs_coord_origin(ureg, 
TGSI_FS_COORD_ORIGIN_LOWER_LEFT);
+   invert = 1;
+}
+else
+   assert(0);
+ }
+
+ if (fp-PixelCenterInteger) {
+if (pscreen-get_param(pscreen, 
PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER))
+   ureg_property_fs_coord_pixel_center(ureg, 
TGSI_FS_COORD_PIXEL_CENTER_INTEGER);
+else if (pscreen-get_param(pscreen, 

[Mesa3d-dev] [PATCH 2/4] tgsi: add caps for fragment coord conventions (v2)

2010-01-26 Thread Luca Barbieri
Changes in v2:
- Split from properties patch
- Use positive caps instead of negative caps

This adds 4 caps to indicate support of each of the fragment coord
conventions.

All drivers are also modifed to add the appropriate caps (3 lines each).

Some drivers were incorrectly using non-Gallium-default conventions,
and caps for them have them set so that they will behave correctly
after the later state tracker patches.

This drivers are softpipe/llvmpipe (uses integer rather than half
integer) and pre-nv50 Nouveau (uses lower left rather than upper left).

Other drivers might be broken. With this patchset, fixing them is
only a matter of exposing the appropriate caps that match the behavior
of the existing code.

Drivers are encouraged to support all conventions themselves for better
performance, and this feature is added to softpipe in a later patch.
---
 src/gallium/drivers/cell/ppu/cell_screen.c |3 +++
 src/gallium/drivers/i915/i915_screen.c |3 +++
 src/gallium/drivers/i965/brw_screen.c  |3 +++
 src/gallium/drivers/llvmpipe/lp_screen.c   |3 +++
 src/gallium/drivers/nv04/nv04_screen.c |3 +++
 src/gallium/drivers/nv10/nv10_screen.c |3 +++
 src/gallium/drivers/nv20/nv20_screen.c |3 +++
 src/gallium/drivers/nv30/nv30_screen.c |3 +++
 src/gallium/drivers/nv40/nv40_screen.c |3 +++
 src/gallium/drivers/nv50/nv50_screen.c |3 +++
 src/gallium/drivers/r300/r300_screen.c |3 +++
 src/gallium/drivers/softpipe/sp_screen.c   |3 +++
 src/gallium/drivers/svga/svga_screen.c |4 +++-
 src/gallium/include/pipe/p_defines.h   |4 
 14 files changed, 43 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/cell/ppu/cell_screen.c 
b/src/gallium/drivers/cell/ppu/cell_screen.c
index d185c6b..80bcbdd 100644
--- a/src/gallium/drivers/cell/ppu/cell_screen.c
+++ b/src/gallium/drivers/cell/ppu/cell_screen.c
@@ -86,6 +86,9 @@ cell_get_param(struct pipe_screen *screen, int param)
   return 0; /* XXX to do */
case PIPE_CAP_TGSI_CONT_SUPPORTED:
   return 1;
+   case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
+   case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
+  return 1;
default:
   return 0;
}
diff --git a/src/gallium/drivers/i915/i915_screen.c 
b/src/gallium/drivers/i915/i915_screen.c
index d4ee8f5..95d385d 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -117,6 +117,9 @@ i915_get_param(struct pipe_screen *screen, int param)
   return 8;  /* max 128x128x128 */
case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
   return 11; /* max 1024x1024 */
+   case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
+   case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
+  return 1;
default:
   return 0;
}
diff --git a/src/gallium/drivers/i965/brw_screen.c 
b/src/gallium/drivers/i965/brw_screen.c
index 0ecacac..66d88dd 100644
--- a/src/gallium/drivers/i965/brw_screen.c
+++ b/src/gallium/drivers/i965/brw_screen.c
@@ -172,6 +172,9 @@ brw_get_param(struct pipe_screen *screen, int param)
   return 8;  /* max 128x128x128 */
case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
   return 11; /* max 1024x1024 */
+   case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
+   case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
+  return 1;
default:
   return 0;
}
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c 
b/src/gallium/drivers/llvmpipe/lp_screen.c
index 9b47415..88757dd 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -110,6 +110,9 @@ llvmpipe_get_param(struct pipe_screen *screen, int param)
   return 1;
case PIPE_CAP_BLEND_EQUATION_SEPARATE:
   return 1;
+   case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
+   case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
+  return 1;
default:
   return 0;
}
diff --git a/src/gallium/drivers/nv04/nv04_screen.c 
b/src/gallium/drivers/nv04/nv04_screen.c
index 7c5b6e8..ad1c65a 100644
--- a/src/gallium/drivers/nv04/nv04_screen.c
+++ b/src/gallium/drivers/nv04/nv04_screen.c
@@ -45,6 +45,9 @@ nv04_screen_get_param(struct pipe_screen *screen, int param)
case NOUVEAU_CAP_HW_VTXBUF:
case NOUVEAU_CAP_HW_IDXBUF:
return 0;
+case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT:
+case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
+return 1;
default:
NOUVEAU_ERR(Unknown PIPE_CAP %d\n, param);
return 0;
diff --git a/src/gallium/drivers/nv10/nv10_screen.c 
b/src/gallium/drivers/nv10/nv10_screen.c
index 69a6dab..3415fbb 100644
--- a/src/gallium/drivers/nv10/nv10_screen.c
+++ b/src/gallium/drivers/nv10/nv10_screen.c
@@ -40,6 +40,9 @@ nv10_screen_get_param(struct pipe_screen *screen, int param)
case NOUVEAU_CAP_HW_VTXBUF:
case NOUVEAU_CAP_HW_IDXBUF:
return 0;
+case 

[Mesa3d-dev] [PATCH 4/4] softpipe: support all TGSI fragment coord conventions (v3)

2010-01-26 Thread Luca Barbieri
Changes in v3:
- Use positive caps instead of negative caps

Changes in v2:
- Now takes the fragment convention directly from the fragment shader

Adds internal support for all fragment coord conventions to softpipe.

This patch is not required for use with the current state trackers, but it
allows softpipe to run any TGSI program and enhances performance.
---
 src/gallium/drivers/softpipe/sp_screen.c   |2 ++
 src/gallium/drivers/softpipe/sp_setup.c|   11 +++
 src/gallium/drivers/softpipe/sp_state.h|3 +++
 src/gallium/drivers/softpipe/sp_state_fs.c |8 
 4 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/softpipe/sp_screen.c 
b/src/gallium/drivers/softpipe/sp_screen.c
index 249c0a3..de0f74b 100644
--- a/src/gallium/drivers/softpipe/sp_screen.c
+++ b/src/gallium/drivers/softpipe/sp_screen.c
@@ -92,6 +92,8 @@ softpipe_get_param(struct pipe_screen *screen, int param)
case PIPE_CAP_BLEND_EQUATION_SEPARATE:
   return 1;
case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
+   case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT:
+   case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
   return 1;
default:
diff --git a/src/gallium/drivers/softpipe/sp_setup.c 
b/src/gallium/drivers/softpipe/sp_setup.c
index f6c3a2b..a3eeab2 100644
--- a/src/gallium/drivers/softpipe/sp_setup.c
+++ b/src/gallium/drivers/softpipe/sp_setup.c
@@ -505,21 +505,24 @@ static void tri_persp_coeff( struct setup_context *setup,
 
 /**
  * Special coefficient setup for gl_FragCoord.
- * X and Y are trivial, though Y has to be inverted for OpenGL.
+ * X and Y are trivial, though Y may have to be inverted for OpenGL.
  * Z and W are copied from posCoef which should have already been computed.
  * We could do a bit less work if we'd examine gl_FragCoord's swizzle mask.
  */
 static void
 setup_fragcoord_coeff(struct setup_context *setup, uint slot)
 {
+   struct sp_fragment_shader* spfs = setup-softpipe-fs;
/*X*/
-   setup-coef[slot].a0[0] = 0;
+   setup-coef[slot].a0[0] = spfs-pixel_center_integer ? 0.0 : 0.5;
setup-coef[slot].dadx[0] = 1.0;
setup-coef[slot].dady[0] = 0.0;
/*Y*/
-   setup-coef[slot].a0[1] = 0.0;
+   setup-coef[slot].a0[1] =
+  (spfs-origin_lower_left ? 
setup-softpipe-framebuffer.height : 0)
+  + (spfs-pixel_center_integer ? 0.0 : 0.5);
setup-coef[slot].dadx[1] = 0.0;
-   setup-coef[slot].dady[1] = 1.0;
+   setup-coef[slot].dady[1] = spfs-origin_lower_left ? -1.0 : 1.0;
/*Z*/
setup-coef[slot].a0[2] = setup-posCoef.a0[2];
setup-coef[slot].dadx[2] = setup-posCoef.dadx[2];
diff --git a/src/gallium/drivers/softpipe/sp_state.h 
b/src/gallium/drivers/softpipe/sp_state.h
index 7f244c4..a83cae7 100644
--- a/src/gallium/drivers/softpipe/sp_state.h
+++ b/src/gallium/drivers/softpipe/sp_state.h
@@ -68,6 +68,9 @@ struct sp_fragment_shader {
 
struct tgsi_shader_info info;
 
+   boolean origin_lower_left; /** fragment shader uses lower left position 
origin? */
+   boolean pixel_center_integer; /** fragment shader uses integer pixel 
center? */
+
void (*prepare)( const struct sp_fragment_shader *shader,
struct tgsi_exec_machine *machine,
struct tgsi_sampler **samplers);
diff --git a/src/gallium/drivers/softpipe/sp_state_fs.c 
b/src/gallium/drivers/softpipe/sp_state_fs.c
index b7ed444..1171ec7 100644
--- a/src/gallium/drivers/softpipe/sp_state_fs.c
+++ b/src/gallium/drivers/softpipe/sp_state_fs.c
@@ -44,6 +44,7 @@ softpipe_create_fs_state(struct pipe_context *pipe,
 {
struct softpipe_context *softpipe = softpipe_context(pipe);
struct sp_fragment_shader *state;
+   unsigned i;
 
/* debug */
if (softpipe-dump_fs) 
@@ -60,6 +61,13 @@ softpipe_create_fs_state(struct pipe_context *pipe,
/* get/save the summary info for this shader */
tgsi_scan_shader(templ-tokens, state-info);
 
+   for (i = 0; i  state-info.num_properties; ++i) {
+  if (state-info.properties[i].name == TGSI_PROPERTY_FS_COORD_ORIGIN)
+ state-origin_lower_left = state-info.properties[i].data[0];
+  else if (state-info.properties[i].name == 
TGSI_PROPERTY_FS_COORD_PIXEL_CENTER)
+state-pixel_center_integer = state-info.properties[i].data[0];
+   }
+
return state;
 }
 
-- 
1.6.6.1.476.g01ddb


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] [PATCH 3/7] tgsi: add properties for fragment coord conventions

2010-01-26 Thread Luca Barbieri
On Tue, Jan 26, 2010 at 12:11 PM, Keith Whitwell kei...@vmware.com wrote:
 Luca,

 I would have expected fragment coord conventions to be device state, not
 a part of the shader.

 It seems like these new flags are really peers (or replacements?) of the
 gl_rasterization_rules flag in pipe_rasterizer_state, and that the
 shaders should remain unchanged.

This flags are different from gl_rasterization_rules, as they only
affect fragment.position as seen by the shader, while
gl_rasterization_rules affects the trigger point for rasterization
itself only. I quoted the answer to this I already gave at the end of
the message.

OpenGL makes the convention part of the shader.

Of course, we could design Gallium in a different way, but I don't see
any advantage that would justify the inconvenience.
Also, since the flags only affect the fragment shader (as discussed
below), it makes sense for it to be part of it.

--

gl_rasterization_rules affects the way fragments are rasterized, i.e.
the set of fragments which a primitive is mapped to.
Changing it is equivalent to adding/subtracting a subpixel offset to
the viewport (which seemingly depends on the primitive type).

The pixel center convention instead sets how the values look like in
the fragment shader.
Changing it is equivalent to adding/subtracting 0.5 to the
fragment.position in the fragment shader.

In other words, yes, if you set gl_rasterization_rules and the pixel
center in a mismatched way, fragment.position will not be the
coordinate of the rasterization center.

As another example, suppose you do a blit with the 3D engine using
fragment.position to sample from a texture rectangle with bilinear
filtering.
A wrong rasterization convention may cause 1 pixel black bars at the borders.
A wrong pixel center convention will cause a 2x2 blur filter to be
applied to the texture.

BTW, gl_rasterization_rules is ignored by almost all drivers

From the spec:

The scope of this extension deals *only* with how the fragment
coordinate XY location appears during programming fragment processing.
Beyond the scope of this extension are coordinate conventions used
for rasterization or transformation.


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] gallium: ARB_half_float_vertex

2010-01-26 Thread Keith Whitwell
On Tue, 2010-01-26 at 01:17 -0800, Dave Airlie wrote:
 Since the whole patent mess can't apply to floating vertices here are some 
 gallium patches.
 
 First adds a new screen interface for is_vertex_format_supported and also
 we seems to have some GPUs with a single R16 and some with R16X16 so allow 
 or this.
 
 second is just i965g patch.

What happens with the X16 format if stride == 6 bytes?  Can the HW cope
with this?  Is there a risk of reading past the end of a buffer if the
app packs the last half-float up against the end of the buffer?

These are picky questions given the (barely functional) state of i965g,
but I'm curious more than anything.

 
 If these are okay, I can look at softpipe support via translate. 

If the draw module understood half-floats, that would be equivalent.

 Not sure 
 exposing this extension always and using translate always makes sense as 
 it defeats the purpose of this extension.

For non-swtnl drivers it's true we'd want to avoid advertising formats
which are unsupported by the hardware and optional in the API.

For non-optional formats, the position we're taking is the driver is as
good a place to fix this as anywhere else...

Keith


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] [mesa patch 1/3] dri2: Event driven buffer validation.

2010-01-26 Thread Keith Whitwell
On Fri, 2010-01-22 at 09:40 -0800, Francisco Jerez wrote:
 Keith Whitwell kei...@vmware.com writes:
 
  It's a very rare application that can render half a frame to one sized 
  framebuffer and the other half to another and expect to have a meaningful 
  result.
 
  It's also incredibly difficult to write a driver that produces any sensible 
  result when the render-target size changes halfway through a frame.  There 
  are a bunch of reasons for this, including the fact that the driver will 
  have unflushed command buffers referring to the old size that are suddenly 
  invalid when a new size materializes. 
 
  Basically one of the best things we ever did was stop checking the DRI1 
  sarea for window size changes except at swapbuffer and makecurrent times.  
  Being able to resize windows without seeing mangled/garbage frames in the 
  middle was a huge step forwards.
 
 
 As Michel said, that isn't what this changeset does, the new buffers
 don't kick in until the application becomes aware of them. And that
 shouldn't happen mid-frame unless the application is expecting it to
 happen at that point.

OK, understood.


  My pet take on this is that we should go one step further and modify GLX 
  semantics to allow a stretch blit on swapbuffers to scale the rendered 
  image up/down to the new window size.
 
 Wouldn't that mean modifying the viewport transform behind the user's
 back? Or would the window dimensions stay constant?

No, I mean turning SwapBuffers into a stretch-blit to bridge the gap
between whatever we thought the window size was when we rendered the
frame to what it really is when we do the swap.

Michel doesn't like this too much, though...

Keith


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] gallium: ARB_half_float_vertex

2010-01-26 Thread Luca Barbieri
 First adds a new screen interface for is_vertex_format_supported and also
 we seems to have some GPUs with a single R16 and some with R16X16 so allow
 or this.

Are you sure this is necessary?

Vertex shader formats have an explicitly specified stride, and so
padding does not matter for them.

I think we should just define padding-less formats like all other
vertex formats, and don't add is_vertex_format_supported (except
possibly to not expose the extension if the hardware doesn't support
it).

Padded formats can be added later for floating point *textures*, that
need them since the pixel size is derived from the format, unlike
what happens in vertex formats.

Here is my own implementation, which was based on some work of yours
that Jakob (IIRC) sent me.

diff --git a/src/gallium/include/pipe/p_format.h
b/src/gallium/include/pipe/p_format.h
index 6bfff1c..d324c65 100644
--- a/src/gallium/include/pipe/p_format.h
+++ b/src/gallium/include/pipe/p_format.h
@@ -166,6 +166,10 @@ enum pipe_format {
PIPE_FORMAT_DXT3_SRGBA= 108,
PIPE_FORMAT_DXT5_SRGBA= 109,

+   PIPE_FORMAT_R16_FLOAT  = 110,
+   PIPE_FORMAT_R16G16_FLOAT  = 111,
+   PIPE_FORMAT_R16G16B16_FLOAT= 112,
+   PIPE_FORMAT_R16G16B16A16_FLOAT= 113,
PIPE_FORMAT_COUNT
 };
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index b0d5b99..262cf9e 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -72,6 +72,13 @@ static GLuint float_types[4] = {
PIPE_FORMAT_R32G32B32A32_FLOAT
 };

+static GLuint half_float_types[4] = {
+   PIPE_FORMAT_R16_FLOAT,
+   PIPE_FORMAT_R16G16_FLOAT,
+   PIPE_FORMAT_R16G16B16_FLOAT,
+   PIPE_FORMAT_R16G16B16A16_FLOAT
+};
+
 static GLuint uint_types_norm[4] = {
PIPE_FORMAT_R32_UNORM,
PIPE_FORMAT_R32G32_UNORM,
@@ -173,7 +180,7 @@ st_pipe_vertex_format(GLenum type, GLuint size,
GLenum format,
   GLboolean normalized)
 {
assert((type = GL_BYTE  type = GL_DOUBLE) ||
-  type == GL_FIXED);
+  type == GL_FIXED || type == GL_HALF_FLOAT);
assert(size = 1);
assert(size = 4);
assert(format == GL_RGBA || format == GL_BGRA);
@@ -189,6 +196,7 @@ st_pipe_vertex_format(GLenum type, GLuint size,
GLenum format,
   switch (type) {
   case GL_DOUBLE: return double_types[size-1];
   case GL_FLOAT: return float_types[size-1];
+  case GL_HALF_FLOAT: return half_float_types[size-1];
   case GL_INT: return int_types_norm[size-1];
   case GL_SHORT: return short_types_norm[size-1];
   case GL_BYTE: return byte_types_norm[size-1];
@@ -203,6 +211,7 @@ st_pipe_vertex_format(GLenum type, GLuint size,
GLenum format,
   switch (type) {
   case GL_DOUBLE: return double_types[size-1];
   case GL_FLOAT: return float_types[size-1];
+  case GL_HALF_FLOAT: return half_float_types[size-1];
   case GL_INT: return int_types_scale[size-1];
   case GL_SHORT: return short_types_scale[size-1];
   case GL_BYTE: return byte_types_scale[size-1];
diff --git a/src/mesa/state_tracker/st_extensions.c
b/src/mesa/state_tracker/st_extensions.c
index 89a16c1..60732f3 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -148,6 +148,7 @@ void st_init_extensions(struct st_context *st)
 */
ctx-Extensions.ARB_copy_buffer = GL_TRUE;
ctx-Extensions.ARB_fragment_program = GL_TRUE;
+   ctx-Extensions.ARB_half_float_vertex = GL_TRUE;
ctx-Extensions.ARB_map_buffer_range = GL_TRUE;
ctx-Extensions.ARB_multisample = GL_TRUE;
ctx-Extensions.ARB_texture_border_clamp = GL_TRUE; /* XXX temp */

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] [PATCH] glxgears: Support GLX_EXT_swap_control for querying the current swap interval.

2010-01-26 Thread Brian Paul
Committed.  Thanks.

-Brian

Aaron Plattner wrote:
 Signed-off-by: Aaron Plattner aplatt...@nvidia.com
 ---
  progs/xdemos/glxgears.c |   13 ++---
  1 files changed, 10 insertions(+), 3 deletions(-)
 
 diff --git a/progs/xdemos/glxgears.c b/progs/xdemos/glxgears.c
 index 2993c82..92c75ca 100644
 --- a/progs/xdemos/glxgears.c
 +++ b/progs/xdemos/glxgears.c
 @@ -35,6 +35,7 @@
  #include X11/keysym.h
  #include GL/gl.h
  #include GL/glx.h
 +#include GL/glxext.h
  
  #ifndef GLX_MESA_swap_control
  #define GLX_MESA_swap_control 1
 @@ -586,11 +587,17 @@ is_glx_extension_supported(Display *dpy, const char 
 *query)
   * Attempt to determine whether or not the display is synched to vblank.
   */
  static void
 -query_vsync(Display *dpy)
 +query_vsync(Display *dpy, GLXDrawable drawable)
  {
 int interval = 0;
  
 -
 +#if defined(GLX_EXT_swap_control)
 +   if (is_glx_extension_supported(dpy, GLX_EXT_swap_control)) {
 +   unsigned int tmp = -1;
 +   glXQueryDrawable(dpy, drawable, GLX_SWAP_INTERVAL_EXT, tmp);
 +   interval = tmp;
 +   } else
 +#endif
 if (is_glx_extension_supported(dpy, GLX_MESA_swap_control)) {
PFNGLXGETSWAPINTERVALMESAPROC pglXGetSwapIntervalMESA =
(PFNGLXGETSWAPINTERVALMESAPROC)
 @@ -749,7 +756,7 @@ main(int argc, char *argv[])
 make_window(dpy, glxgears, x, y, winWidth, winHeight, win, ctx);
 XMapWindow(dpy, win);
 glXMakeCurrent(dpy, win, ctx);
 -   query_vsync(dpy);
 +   query_vsync(dpy, win);
  
 if (printInfo) {
printf(GL_RENDERER   = %s\n, (char *) glGetString(GL_RENDERER));


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] ARB_half_float_vertex support branch

2010-01-26 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dave Airlie wrote:
 Hey,
 
 Stuck at home today minding sick (on the mend now baby) with only my 965 
 laptop, and someone mentioned this morning on irc that we don't do 
 ARB_half_float_vertex, and after reading that patent stuff doesn't apply 
 to this by my reckoning it didn't seem that hard to throw together.

Rock.  Please update
http://dri.freedesktop.org/wiki/MissingFunctionality if you haven't already.

 I found a BSD licensed half-float array convertor, wrote a really simple 
 test app, and added the glapi, mesa core and 965 support.
 
 I'm sure it needs work and there is a good chance I won't get back to 
 figuring out whats missing from it, but if some kind soul could review it 
 and let me know what I missed, I might find some time to fix it up.
 
 I think at least r500/r600 can support this.
 
 if anyone wants I can send the patches to the list.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktfNQYACgkQX1gOwKyEAw/jogCghw66srIJFTZpGLpR+BMwE529
hR0An2SBHF4lihWMW7+QCV00fHiNaG1k
=/ptS
-END PGP SIGNATURE-

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] [PATCH] Don't bind DRAW/READ_FRAMEBUFFER separately without FBO blit support

2010-01-26 Thread Brian Paul
Erik Wien wrote:
 Hi. Attached is a patch fixing a GL-Error when deleting the currently
 bound framebuffer without the GL_EXT_framebuffer-blit extension enabled.

Thanks.  I'm applying the patch with minor tweaks.

-Brian


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


[Mesa3d-dev] [Bug 26230] Create developer account

2010-01-26 Thread bugzilla-daemon
http://bugs.freedesktop.org/show_bug.cgi?id=26230


Brian Paul brian.e.p...@gmail.com changed:

   What|Removed |Added

 AssignedTo|mesa3d- |sitewrangl...@lists.freedesk
   |d...@lists.sourceforge.net   |top.org
  Component|Mesa core   |New Accounts
Product|Mesa|freedesktop.org
Version|git |unspecified




-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] [PATCH] docs: add documentation to double opcodes

2010-01-26 Thread Brian Paul
Igor Oliveira wrote:
 Hello
 
 this patch applies in double-opcode-branch.
 It adds documentation to double opcodes.

Committed.  Thanks.

-Brian


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


[Mesa3d-dev] [Bug 26230] Create developer account

2010-01-26 Thread bugzilla-daemon
http://bugs.freedesktop.org/show_bug.cgi?id=26230





--- Comment #1 from Brian Paul brian.e.p...@gmail.com  2010-01-26 16:23:16 
PST ---
Approved.  Next step is for the fd.o admins.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev