Re: [Mesa3d-dev] A patch to get rbug-gui working with recent util_format and libgallium.a

2010-01-11 Thread Jakob Bornecrantz

On 8 jan 2010, at 18.42, Mike Stroyan wrote:
On Thu, Jan 7, 2010 at 4:34 AM, Keith Whitwell   
wrote:


It looks like there are some unrelated changes in your diff -- can you
separate them out into disjoint changes?  One way is to make several
commits to your local git repo and then use git-format-patch to create
email-ready changes with your authorship and commit message intact.

Keith,

Thanks for the pointer to git-format-patch.
Here is my patch set restructured to be more understandable.

While creating this stream I also removed a call to  
util_format_description
that I had put into texture_action_read_info.  I was thinking that  
could lead
to a more compact icon selection of the icons.  But the swizzle  
information

in the description was harder to use than the format enum.


Hi again Mike

I applied a slightly modified version of your patchs to the rbug-gui  
repo yesterday and squashed them into a single commit, I'm hope that  
is all right with you. Thanks again.


Cheers Jakob.--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev ___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] A patch to get rbug-gui working with recent util_format and libgallium.a

2010-01-08 Thread Mike Stroyan
On Thu, Jan 7, 2010 at 4:34 AM, Keith Whitwell  wrote:

>
> It looks like there are some unrelated changes in your diff -- can you
> separate them out into disjoint changes?  One way is to make several
> commits to your local git repo and then use git-format-patch to create
> email-ready changes with your authorship and commit message intact.
>
> Keith,

Thanks for the pointer to git-format-patch.
Here is my patch set restructured to be more understandable.

While creating this stream I also removed a call to util_format_description
that I had put into texture_action_read_info.  I was thinking that could
lead
to a more compact icon selection of the icons.  But the swizzle information
in the description was harder to use than the format enum.

Mike
From 24d8b23b3c4bdb0c0839c77b495ac334960a915e Mon Sep 17 00:00:00 2001
From: Mike Stroyan 
Date: Fri, 8 Jan 2010 11:00:43 -0700
Subject: [PATCH 1/5] Change from librbug.a, libtgsi.a, and libutil.a to libgallium.a

---
 Makefile.in |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 1d39e8b..0cc3b45 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -17,9 +17,7 @@ MESA_INCLUDES = \
 	-I$(MESA)src/gallium/drivers
 
 MESA_LIBS = \
-	$(MESA)src/gallium/auxiliary/rbug/librbug.a \
-	$(MESA)src/gallium/auxiliary/tgsi/libtgsi.a \
-	$(MESA)src/gallium/auxiliary/util/libutil.a
+	$(MESA)src/gallium/auxiliary/libgallium.a
 
 
 
-- 
1.6.3.3

From 03fc1a93c31045acea6f1f3e5575e2f5838c9070 Mon Sep 17 00:00:00 2001
From: Mike Stroyan 
Date: Fri, 8 Jan 2010 11:14:56 -0700
Subject: [PATCH 2/5] Use util_format_* functions instead of pf_* functions.

---
 src/texture.c |  167 +---
 1 files changed, 122 insertions(+), 45 deletions(-)

diff --git a/src/texture.c b/src/texture.c
index a9ba987..6553acc 100644
--- a/src/texture.c
+++ b/src/texture.c
@@ -27,6 +27,7 @@
 #include "GL/gl.h"
 
 #include "pipe/p_format.h"
+#include "util/u_format.h"
 
 /* needed for u_tile */
 #include "pipe/p_state.h"
@@ -233,7 +234,7 @@ struct texture_action_read
 	unsigned stride;
 	unsigned size;
 	enum pipe_format format;
-	struct pipe_format_block block;
+	uint32_t block_height;
 	void *data;
 };
 
@@ -319,9 +320,9 @@ static void texture_action_read_upload(struct texture_action_read *action,
 
 	src_stride = action->stride;
 
-	if (!pf_is_compressed(action->format)) {
+	if (!util_format_is_compressed(action->format)) {
 		uint32_t dst_stride = 4 * 4 * w;
-		uint32_t step_h = action->block.height;
+		uint32_t step_h = action->block_height;
 		float *rgba = g_malloc(dst_stride * h);
 		GLint format, type;
 		unsigned i;
@@ -342,7 +343,7 @@ static void texture_action_read_upload(struct texture_action_read *action,
 		 format, type, rgba);
 
 		g_free(rgba);
-	} else if (pf_is_compressed(action->format)) {
+	} else if (util_format_is_compressed(action->format)) {
 
 		if (action->format == PIPE_FORMAT_DXT1_RGB)
 			internal_format = GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
@@ -392,11 +393,11 @@ static gboolean texture_action_read_read(struct rbug_event *e,
 	if (!action->running)
 		goto error;
 
-	if (pf_is_compressed(action->format)) {
+	if (util_format_is_compressed(action->format)) {
 		size = read->data_len;
 	} else {
 		/* calculate needed size */
-		size = pf_get_nblocksy(&action->block, action->height) * read->stride;
+		size = util_format_get_nblocksx(action->format, action->height) * read->stride;
 
 		if (read->data_len < size)
 			goto error;
@@ -437,6 +438,7 @@ static gboolean texture_action_read_info(struct rbug_event *e,
 	char info_short_string[64];
 	char info_long_string[128];
 	GdkPixbuf *buf = NULL;
+	const struct util_format_description *format_description;
 
 	info = (struct rbug_proto_texture_info_reply *)header;
 	action = (struct texture_action_read *)e;
@@ -449,42 +451,119 @@ static gboolean texture_action_read_info(struct rbug_event *e,
 		goto error;
 	}
 
-	if (pf_layout(info->format) == PIPE_FORMAT_LAYOUT_RGBAZS) {
-		int swz = (info->format >> 2) &  0xFFF;
-
-		if (!swz)
-			;
-		else if (swz == _PIPE_FORMAT_RGBA)
-			buf = icon_get("rgba", p);
-		else if (swz == _PIPE_FORMAT_RGB1)
-			buf = icon_get("rgbx", p);
-		else if (swz == _PIPE_FORMAT_ARGB)
-			buf = icon_get("argb", p);
-		else if (swz == _PIPE_FORMAT_1RGB)
-			buf = icon_get("xrgb", p);
-		else if (swz == _PIPE_FORMAT_000R)
-			buf = icon_get("rgba", p);
-
-		else if (swz == _PIPE_FORMAT_SZ00)
-			buf = icon_get("s8z24", p);
-		else if (swz == _PIPE_FORMAT_0Z00)
-			buf = icon_get("x8z24", p);
-		else if (swz == _PIPE_FORMAT_ZS00)
-			buf = icon_get("z24s8", p);
-		else if (swz == _PIPE_FORMAT_Z000)
-			buf = icon_get("z24x8", p);
-
-	} else if (pf_layout(info->format) == PIPE_FORMAT_LAYOUT_DXT) {
-
-		if (info->format == PIPE_FORMAT_DXT1_RGB)
-			buf = icon_get("dxt1_rgb", p);
-		else if (info->format == PIPE_FORMAT_DXT1_RGBA)
-			buf = icon_get("dxt1_rgba", p);
-		else if (info->format == PIPE_FORMAT_DXT3_

Re: [Mesa3d-dev] A patch to get rbug-gui working with recent util_format and libgallium.a

2010-01-07 Thread Jakob Bornecrantz
On 7 jan 2010, at 01.47, Mike Stroyan wrote:
> Hello folks.  I started at LunarG this week and have been getting  
> more familiar with
> the gallium code.
>
> I noticed that rbug-gui has not been updated to match the recent  
> changes to
> the util_format.  Here is a patch that switches from the pr_*  
> functions to util_format
> functions.  (It also adds several new icons for the many formats.)
> I replaced the 'action->block' field with just one 'action- 
> >block_height' field.
> That is the only part of action->block that is needed if  
> util_format_get_nblocksx
> is called instead of pf_get_nblocksy.
> I don't know if there is a better way to extract block height from  
> format instead
> keeping it as a separate field.
>
> Do these changes look good?

Thanks Mike, I had already received a quick from fix from José but I'm  
currently having some problems pushing commits to the rbug-gui repo  
due to permission problems. I'll probably try to extract the good bits  
from your patch and commit it some time during this week. Again thanks  
for doing the work, I like the new icons btw.

Cheers Jakob.
--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] A patch to get rbug-gui working with recent util_format and libgallium.a

2010-01-07 Thread Keith Whitwell
On Wed, 2010-01-06 at 16:47 -0800, Mike Stroyan wrote:
> Hello folks.  I started at LunarG this week and have been getting more
> familiar with
> the gallium code.
> 
> I noticed that rbug-gui has not been updated to match the recent
> changes to
> the util_format.  Here is a patch that switches from the pr_*
> functions to util_format
> functions.  (It also adds several new icons for the many formats.)
> I replaced the 'action->block' field with just one
> 'action->block_height' field.
> That is the only part of action->block that is needed if
> util_format_get_nblocksx
> is called instead of pf_get_nblocksy.
> I don't know if there is a better way to extract block height from
> format instead
> keeping it as a separate field.
> 
> Do these changes look good?
> 
> Mike Stroyan, m...@lunarg.com

Mike,

It looks like there are some unrelated changes in your diff -- can you
separate them out into disjoint changes?  One way is to make several
commits to your local git repo and then use git-format-patch to create
email-ready changes with your authorship and commit message intact.

Keith


--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


[Mesa3d-dev] A patch to get rbug-gui working with recent util_format and libgallium.a

2010-01-06 Thread Mike Stroyan
Hello folks.  I started at LunarG this week and have been getting more
familiar with
the gallium code.

I noticed that rbug-gui has not been updated to match the recent changes to
the util_format.  Here is a patch that switches from the pr_* functions to
util_format
functions.  (It also adds several new icons for the many formats.)
I replaced the 'action->block' field with just one 'action->block_height'
field.
That is the only part of action->block that is needed if
util_format_get_nblocksx
is called instead of pf_get_nblocksy.
I don't know if there is a better way to extract block height from format
instead
keeping it as a separate field.

Do these changes look good?

Mike Stroyan, m...@lunarg.com


patch
Description: Binary data


new_icons.tar
Description: Unix tar archive
--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev ___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev