+Mesa 7.4.2 is a stable development release fixing bugs since the 7.4.1 release.
+
+
+Mesa 7.4.2 implements the OpenGL 2.1 API, but the version reported by
+glGetString(GL_VERSION) depends on the particular driver being used.
+Some drivers don't support all the features required in OpenGL 2.1.
+
Mesa uses an even/odd version number scheme like the Linux kernel.
-Odd numbered versions (such as 7.5) designate new developmental releases.
-Even numbered versions (such as 7.4) designate stable releases.
+Odd numbered versions (such as 6.5) designate new developmental releases.
+Even numbered versions (such as 6.4) designate stable releases.
@@ -20,7 +20,7 @@ The release notes summarize what's new or changed in each Mesa release.
7.3 release notes
--
cgit v1.2.3
From 483e247804db914835173347b7f2a12c0f78d60e Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Fri, 15 May 2009 08:03:56 -0600
Subject: mesa: bump version to 7.5-rc2
---
Makefile | 2 +-
src/mesa/main/version.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 69d3ecacd7..acf83e6280 100644
--- a/Makefile
+++ b/Makefile
@@ -181,7 +181,7 @@ ultrix-gcc:
# Rules for making release tarballs
-VERSION=7.5-rc1
+VERSION=7.5-rc2
DIRECTORY = Mesa-$(VERSION)
LIB_NAME = MesaLib-$(VERSION)
DEMO_NAME = MesaDemos-$(VERSION)
diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h
index 072037bbd7..e109f20df4 100644
--- a/src/mesa/main/version.h
+++ b/src/mesa/main/version.h
@@ -31,7 +31,7 @@
#define MESA_MAJOR 7
#define MESA_MINOR 5
#define MESA_PATCH 0
-#define MESA_VERSION_STRING "7.5-rc1"
+#define MESA_VERSION_STRING "7.5-rc2"
/* To make version comparison easy */
#define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
--
cgit v1.2.3
From 5c5a46884899ea25cdf25545d6ab3d9a74eafa3a Mon Sep 17 00:00:00 2001
From: Eric Anholt
Date: Fri, 15 May 2009 11:41:42 -0700
Subject: i915: Only use the new 945 cube layout for compressed textures.
The docs actually explain this, but not in a terribly clear manner.
This nearly fixes the piglit cubemap testcase, except that something's
going wrong with the nearest filtering at 2x2 sizes in the testcase.
Looks good by visual inspection, though.
Bug #21692
---
src/mesa/drivers/dri/i915/i915_tex_layout.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/mesa/drivers/dri/i915/i915_tex_layout.c b/src/mesa/drivers/dri/i915/i915_tex_layout.c
index d44a2f47b3..7cc1c096e4 100644
--- a/src/mesa/drivers/dri/i915/i915_tex_layout.c
+++ b/src/mesa/drivers/dri/i915/i915_tex_layout.c
@@ -454,7 +454,10 @@ i945_miptree_layout(struct intel_context *intel, struct intel_mipmap_tree * mt)
{
switch (mt->target) {
case GL_TEXTURE_CUBE_MAP:
- i945_miptree_layout_cube(intel, mt);
+ if (mt->compressed)
+ i945_miptree_layout_cube(intel, mt);
+ else
+ i915_miptree_layout_cube(intel, mt);
break;
case GL_TEXTURE_3D:
i945_miptree_layout_3d(intel, mt);
--
cgit v1.2.3
From 4c6f82989983eecc0b3b724716cb3bcb675664c5 Mon Sep 17 00:00:00 2001
From: Eric Anholt
Date: Fri, 15 May 2009 12:32:51 -0700
Subject: i915: Use Stencil.Enabled instead of Stencil._Enabled in DrawBuffers.
The _Enabled field isn't updated at the point that DrawBuffers is called,
and the Driver.Enable() function does the testing for stencil buffer
presence anyway.
bug #21608 for Radeon
---
src/mesa/drivers/dri/intel/intel_buffers.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c
index 4f4ea45b74..df5c3fc176 100644
--- a/src/mesa/drivers/dri/intel/intel_buffers.c
+++ b/src/mesa/drivers/dri/intel/intel_buffers.c
@@ -276,7 +276,7 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
ctx->Driver.Enable(ctx, GL_DEPTH_TEST,
(ctx->Depth.Test && fb->Visual.depthBits > 0));
ctx->Driver.Enable(ctx, GL_STENCIL_TEST,
- (ctx->Stencil._Enabled && fb->Visual.stencilBits > 0));
+ (ctx->Stencil.Enabled && fb->Visual.stencilBits > 0));
}
else {
/* Mesa's Stencil._Enabled field is updated when
--
cgit v1.2.3
From b197a8ade3e1e6c67743111f12f27e0a4a985cd9 Mon Sep 17 00:00:00 2001
From: "Steinar H. Gunderson"
Date: Tue, 12 May 2009 11:32:03 -0700
Subject: i915: Fix 945 cube map layout for the small mipmaps along the bottom.
Bug #21691.
---
src/mesa/drivers/dri/i915/i915_tex_layout.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/mesa/drivers/dri/i915/i915_tex_layout.c b/src/mesa/drivers/dri/i915/i915_tex_layout.c
index 7cc1c096e4..40bcf7a9af 100644
--- a/src/mesa/drivers/dri/i915/i915_tex_layout.c
+++ b/src/mesa/drivers/dri/i915/i915_tex_layout.c
@@ -55,6 +55,17 @@ static GLint step_offsets[6][2] = {
[FACE_NEG_Z] = {-1, 1},
};
+
+static GLint bottom_offsets[6] = {
+ [FACE_POS_X] = 16 + 0 * 8,
+ [FACE_POS_Y] = 16 + 1 * 8,
+ [FACE_POS_Z] = 16 + 2 * 8,
+ [FACE_NEG_X] = 16 + 3 * 8,
+ [FACE_NEG_Y] = 16 + 4 * 8,
+ [FACE_NEG_Z] = 16 + 5 * 8,
+};
+
+
/**
* Cube texture map layout for i830M-GM915.
*
@@ -297,7 +308,7 @@ i915_miptree_layout(struct intel_context *intel, struct intel_mipmap_tree * mt)
* +---+ +---+ +---+ +---+ +---+ +---+
*
* The bottom row continues with the remaining 2x2 then the 1x1 mip contents
- * in order, with each of them aligned to a 4x4 block boundary. Thus, for
+ * in order, with each of them aligned to a 8x8 block boundary. Thus, for
* 32x32 cube maps and smaller, the bottom row layout is going to dictate the
* pitch of the tree. For a tree with 4x4 images, the pitch is at least
* 14 * 8 = 112 texels, for 2x2 it is at least 12 * 8 texels, and for 1x1
@@ -375,10 +386,11 @@ i945_miptree_layout_cube(struct intel_context *intel,
x = (face - 4) * 8;
break;
}
+ break;
case 2:
y = mt->total_height - 4;
- x = 16 + face * 8;
+ x = bottom_offsets[face];
break;
case 1:
--
cgit v1.2.3
From c4538e326a99fde3996f21866497f92ec14086df Mon Sep 17 00:00:00 2001
From: Jakob Bornecrantz
Date: Fri, 15 May 2009 22:47:31 +0100
Subject: st/egl: Use proper Makefile
---
src/gallium/state_trackers/egl/Makefile | 36 ++++++++++++---------------------
1 file changed, 13 insertions(+), 23 deletions(-)
diff --git a/src/gallium/state_trackers/egl/Makefile b/src/gallium/state_trackers/egl/Makefile
index 692a3c8b76..e825aa718b 100644
--- a/src/gallium/state_trackers/egl/Makefile
+++ b/src/gallium/state_trackers/egl/Makefile
@@ -1,29 +1,19 @@
-TARGET = libegldrm.a
-CFILES = $(wildcard ./*.c)
-OBJECTS = $(patsubst ./%.c,./%.o,$(CFILES))
-GALLIUMDIR = ../..
-TOP = ../../../..
+TOP = ../../../..
+include $(TOP)/configs/current
-include ${TOP}/configs/current
+LIBNAME = egldrm
-CFLAGS := \
- -I${GALLIUMDIR}/include \
- -I${GALLIUMDIR}/auxiliary \
- -I${TOP}/src/mesa/drivers/dri/common \
- -I${TOP}/src/mesa \
- -I$(TOP)/include \
- -I$(TOP)/src/egl/main \
- ${LIBDRM_CFLAGS} \
- ${CFLAGS}
+LIBRARY_INCLUDES = \
+ -I$(TOP)/src/gallium/include \
+ -I$(TOP)/src/gallium/auxiliary \
+ -I$(TOP)/src/mesa/drivers/dri/common \
+ -I$(TOP)/src/mesa \
+ -I$(TOP)/include \
+ -I$(TOP)/src/egl/main \
+ $(shell pkg-config --cflags-only-I libdrm)
-#############################################
-.PHONY = all clean
+C_SOURCES = $(wildcard ./*.c)
-all: ${TARGET}
-${TARGET}: ${OBJECTS}
- ar rcs $@ $^
-
-clean:
- rm -rf ${OBJECTS} ${TARGET}
+include ../../Makefile.template
--
cgit v1.2.3
From 97ccdee68aef925d14ee4ee17eef307f55a3c92f Mon Sep 17 00:00:00 2001
From: Jakob Bornecrantz
Date: Fri, 15 May 2009 22:54:07 +0100
Subject: gallium-intel: Build with scons
---
src/gallium/winsys/drm/intel/SConscript | 7 +++++++
src/gallium/winsys/drm/intel/dri/SConscript | 15 +++++++++++++++
src/gallium/winsys/drm/intel/gem/SConscript | 17 +++++++++++++++++
3 files changed, 39 insertions(+)
create mode 100644 src/gallium/winsys/drm/intel/SConscript
create mode 100644 src/gallium/winsys/drm/intel/dri/SConscript
create mode 100644 src/gallium/winsys/drm/intel/gem/SConscript
diff --git a/src/gallium/winsys/drm/intel/SConscript b/src/gallium/winsys/drm/intel/SConscript
new file mode 100644
index 0000000000..50d7b75ed6
--- /dev/null
+++ b/src/gallium/winsys/drm/intel/SConscript
@@ -0,0 +1,7 @@
+Import('*')
+
+SConscript(['gem/SConscript',])
+
+if 'mesa' in env['statetrackers']:
+
+ SConscript(['dri/SConscript'])
diff --git a/src/gallium/winsys/drm/intel/dri/SConscript b/src/gallium/winsys/drm/intel/dri/SConscript
new file mode 100644
index 0000000000..b11a1927f7
--- /dev/null
+++ b/src/gallium/winsys/drm/intel/dri/SConscript
@@ -0,0 +1,15 @@
+Import('*')
+
+env = drienv.Clone()
+
+drivers = [
+ softpipe,
+ i915simple,
+ inteldrm
+]
+
+env.SharedLibrary(
+ target ='i915_dri.so',
+ source = COMMON_GALLIUM_SOURCES,
+ LIBS = drivers + mesa + auxiliaries + env['LIBS'],
+)
diff --git a/src/gallium/winsys/drm/intel/gem/SConscript b/src/gallium/winsys/drm/intel/gem/SConscript
new file mode 100644
index 0000000000..ea8a2e55f6
--- /dev/null
+++ b/src/gallium/winsys/drm/intel/gem/SConscript
@@ -0,0 +1,17 @@
+Import('*')
+
+env = drienv.Clone()
+
+inteldrm_sources = [
+ 'intel_be_api.c',
+ 'intel_be_batchbuffer.c',
+ 'intel_be_context.c',
+ 'intel_be_device.c',
+]
+
+inteldrm = env.ConvenienceLibrary(
+ target ='inteldrm',
+ source = inteldrm_sources,
+)
+
+Export('inteldrm')
--
cgit v1.2.3
From 0307e609aa3e707eeb40051bd664d36f2340ba9b Mon Sep 17 00:00:00 2001
From: Eric Anholt
Date: Fri, 15 May 2009 16:24:59 -0700
Subject: mesa: Mark FBOs with compressed color attachments as FBO-incomplete.
Both EXT_fbo and ARB_fbo agree on this. Fixes a segfault in the metaops
mipmap generation in Intel for SGIS_generate_mipmap of S3TC textures in
Regnum Online.
Bug #21654.
---
src/mesa/main/fbobject.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 9c5a5908a2..dbd4c5848c 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -368,6 +368,11 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format,
att->Complete = GL_FALSE;
return;
}
+ if (texImage->TexFormat->TexelBytes == 0) {
+ att_incomplete("compressed internalformat");
+ att->Complete = GL_FALSE;
+ return;
+ }
}
else if (format == GL_DEPTH) {
if (texImage->TexFormat->BaseFormat == GL_DEPTH_COMPONENT) {
--
cgit v1.2.3
From 22690482e692cb5ed2f84d3e69545c09292e3484 Mon Sep 17 00:00:00 2001
From: Eric Anholt
Date: Fri, 15 May 2009 17:32:21 -0700
Subject: intel: Don't complain on falling back from PBO fastpaths.
Instead, stash the debug info under the handy debug flag.
Bug #20053
---
src/mesa/drivers/dri/intel/intel_tex_image.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index b71fe2a7ae..ddbb13e74a 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -208,7 +208,7 @@ try_pbo_upload(struct intel_context *intel,
if (!pbo ||
intel->ctx._ImageTransferState ||
unpack->SkipPixels || unpack->SkipRows) {
- _mesa_printf("%s: failure 1\n", __FUNCTION__);
+ DBG("%s: failure 1\n", __FUNCTION__);
return GL_FALSE;
}
@@ -264,7 +264,7 @@ try_pbo_zcopy(struct intel_context *intel,
if (!pbo ||
intel->ctx._ImageTransferState ||
unpack->SkipPixels || unpack->SkipRows) {
- _mesa_printf("%s: failure 1\n", __FUNCTION__);
+ DBG("%s: failure 1\n", __FUNCTION__);
return GL_FALSE;
}
@@ -283,7 +283,7 @@ try_pbo_zcopy(struct intel_context *intel,
dst_stride = intelImage->mt->pitch;
if (src_stride != dst_stride || dst_offset != 0 || src_offset != 0) {
- _mesa_printf("%s: failure 2\n", __FUNCTION__);
+ DBG("%s: failure 2\n", __FUNCTION__);
return GL_FALSE;
}
--
cgit v1.2.3
From c30f66118974f41f57e86d49f372b7c78f891223 Mon Sep 17 00:00:00 2001
From: Jakob Bornecrantz
Date: Fri, 15 May 2009 04:17:00 +0200
Subject: trace: Move state dump functions to tr_dump_state.[c|h]
---
src/gallium/drivers/trace/Makefile | 2 +-
src/gallium/drivers/trace/SConscript | 2 +-
src/gallium/drivers/trace/tr_context.c | 2 +-
src/gallium/drivers/trace/tr_dump_state.c | 491 ++++++++++++++++++++++++++++++
src/gallium/drivers/trace/tr_dump_state.h | 78 +++++
src/gallium/drivers/trace/tr_screen.c | 2 +-
src/gallium/drivers/trace/tr_state.c | 491 ------------------------------
src/gallium/drivers/trace/tr_state.h | 78 -----
8 files changed, 573 insertions(+), 573 deletions(-)
create mode 100644 src/gallium/drivers/trace/tr_dump_state.c
create mode 100644 src/gallium/drivers/trace/tr_dump_state.h
delete mode 100644 src/gallium/drivers/trace/tr_state.c
delete mode 100644 src/gallium/drivers/trace/tr_state.h
diff --git a/src/gallium/drivers/trace/Makefile b/src/gallium/drivers/trace/Makefile
index e087db169a..188998d579 100644
--- a/src/gallium/drivers/trace/Makefile
+++ b/src/gallium/drivers/trace/Makefile
@@ -7,8 +7,8 @@ C_SOURCES = \
tr_buffer.c \
tr_context.c \
tr_dump.c \
+ tr_dump_state.c \
tr_screen.c \
- tr_state.c \
tr_texture.c
include ../../Makefile.template
diff --git a/src/gallium/drivers/trace/SConscript b/src/gallium/drivers/trace/SConscript
index 4215215d1a..4ab829a3a8 100644
--- a/src/gallium/drivers/trace/SConscript
+++ b/src/gallium/drivers/trace/SConscript
@@ -8,8 +8,8 @@ trace = env.ConvenienceLibrary(
'tr_buffer.c',
'tr_context.c',
'tr_dump.c',
+ 'tr_dump_state.c',
'tr_screen.c',
- 'tr_state.c',
'tr_texture.c',
])
diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c
index 47280459a7..6a19233a9a 100644
--- a/src/gallium/drivers/trace/tr_context.c
+++ b/src/gallium/drivers/trace/tr_context.c
@@ -31,7 +31,7 @@
#include "pipe/p_screen.h"
#include "tr_dump.h"
-#include "tr_state.h"
+#include "tr_dump_state.h"
#include "tr_buffer.h"
#include "tr_screen.h"
#include "tr_texture.h"
diff --git a/src/gallium/drivers/trace/tr_dump_state.c b/src/gallium/drivers/trace/tr_dump_state.c
new file mode 100644
index 0000000000..1b2b3493a6
--- /dev/null
+++ b/src/gallium/drivers/trace/tr_dump_state.c
@@ -0,0 +1,491 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
+#include "pipe/p_compiler.h"
+#include "util/u_memory.h"
+#include "tgsi/tgsi_dump.h"
+
+#include "tr_dump.h"
+#include "tr_dump_state.h"
+
+
+void trace_dump_format(enum pipe_format format)
+{
+ trace_dump_enum(pf_name(format) );
+}
+
+
+void trace_dump_block(const struct pipe_format_block *block)
+{
+ trace_dump_struct_begin("pipe_format_block");
+ trace_dump_member(uint, block, size);
+ trace_dump_member(uint, block, width);
+ trace_dump_member(uint, block, height);
+ trace_dump_struct_end();
+}
+
+
+static void trace_dump_reference(const struct pipe_reference *reference)
+{
+ trace_dump_struct_begin("pipe_reference");
+ trace_dump_member(int, &reference->count, count);
+ trace_dump_struct_end();
+}
+
+
+void trace_dump_template(const struct pipe_texture *templat)
+{
+ if(!templat) {
+ trace_dump_null();
+ return;
+ }
+
+ trace_dump_struct_begin("pipe_texture");
+
+ trace_dump_member(int, templat, target);
+ trace_dump_member(format, templat, format);
+
+ trace_dump_member_begin("width");
+ trace_dump_array(uint, templat->width, 1);
+ trace_dump_member_end();
+
+ trace_dump_member_begin("height");
+ trace_dump_array(uint, templat->height, 1);
+ trace_dump_member_end();
+
+ trace_dump_member_begin("depth");
+ trace_dump_array(uint, templat->depth, 1);
+ trace_dump_member_end();
+
+ trace_dump_member_begin("block");
+ trace_dump_block(&templat->block);
+ trace_dump_member_end();
+
+ trace_dump_member(uint, templat, last_level);
+ trace_dump_member(uint, templat, tex_usage);
+
+ trace_dump_struct_end();
+}
+
+
+void trace_dump_rasterizer_state(const struct pipe_rasterizer_state *state)
+{
+ if(!state) {
+ trace_dump_null();
+ return;
+ }
+
+ trace_dump_struct_begin("pipe_rasterizer_state");
+
+ trace_dump_member(bool, state, flatshade);
+ trace_dump_member(bool, state, light_twoside);
+ trace_dump_member(uint, state, front_winding);
+ trace_dump_member(uint, state, cull_mode);
+ trace_dump_member(uint, state, fill_cw);
+ trace_dump_member(uint, state, fill_ccw);
+ trace_dump_member(bool, state, offset_cw);
+ trace_dump_member(bool, state, offset_ccw);
+ trace_dump_member(bool, state, scissor);
+ trace_dump_member(bool, state, poly_smooth);
+ trace_dump_member(bool, state, poly_stipple_enable);
+ trace_dump_member(bool, state, point_smooth);
+ trace_dump_member(bool, state, point_sprite);
+ trace_dump_member(bool, state, point_size_per_vertex);
+ trace_dump_member(bool, state, multisample);
+ trace_dump_member(bool, state, line_smooth);
+ trace_dump_member(bool, state, line_stipple_enable);
+ trace_dump_member(uint, state, line_stipple_factor);
+ trace_dump_member(uint, state, line_stipple_pattern);
+ trace_dump_member(bool, state, line_last_pixel);
+ trace_dump_member(bool, state, bypass_vs_clip_and_viewport);
+ trace_dump_member(bool, state, flatshade_first);
+ trace_dump_member(bool, state, gl_rasterization_rules);
+
+ trace_dump_member(float, state, line_width);
+ trace_dump_member(float, state, point_size);
+ trace_dump_member(float, state, point_size_min);
+ trace_dump_member(float, state, point_size_max);
+ trace_dump_member(float, state, offset_units);
+ trace_dump_member(float, state, offset_scale);
+
+ trace_dump_member_array(uint, state, sprite_coord_mode);
+
+ trace_dump_struct_end();
+}
+
+
+void trace_dump_poly_stipple(const struct pipe_poly_stipple *state)
+{
+ if(!state) {
+ trace_dump_null();
+ return;
+ }
+
+ trace_dump_struct_begin("pipe_poly_stipple");
+
+ trace_dump_member_begin("stipple");
+ trace_dump_array(uint,
+ state->stipple,
+ Elements(state->stipple));
+ trace_dump_member_end();
+
+ trace_dump_struct_end();
+}
+
+
+void trace_dump_viewport_state(const struct pipe_viewport_state *state)
+{
+ if(!state) {
+ trace_dump_null();
+ return;
+ }
+
+ trace_dump_struct_begin("pipe_viewport_state");
+
+ trace_dump_member_array(float, state, scale);
+ trace_dump_member_array(float, state, translate);
+
+ trace_dump_struct_end();
+}
+
+
+void trace_dump_scissor_state(const struct pipe_scissor_state *state)
+{
+ if(!state) {
+ trace_dump_null();
+ return;
+ }
+
+ trace_dump_struct_begin("pipe_scissor_state");
+
+ trace_dump_member(uint, state, minx);
+ trace_dump_member(uint, state, miny);
+ trace_dump_member(uint, state, maxx);
+ trace_dump_member(uint, state, maxy);
+
+ trace_dump_struct_end();
+}
+
+
+void trace_dump_clip_state(const struct pipe_clip_state *state)
+{
+ unsigned i;
+
+ if(!state) {
+ trace_dump_null();
+ return;
+ }
+
+ trace_dump_struct_begin("pipe_clip_state");
+
+ trace_dump_member_begin("ucp");
+ trace_dump_array_begin();
+ for(i = 0; i < PIPE_MAX_CLIP_PLANES; ++i) {
+ trace_dump_elem_begin();
+ trace_dump_array(float, state->ucp[i], 4);
+ trace_dump_elem_end();
+ }
+ trace_dump_array_end();
+ trace_dump_member_end();
+
+ trace_dump_member(uint, state, nr);
+
+ trace_dump_struct_end();
+}
+
+
+void trace_dump_constant_buffer(const struct pipe_constant_buffer *state)
+{
+ if(!state) {
+ trace_dump_null();
+ return;
+ }
+
+ trace_dump_struct_begin("pipe_constant_buffer");
+
+ trace_dump_member(buffer_ptr, state, buffer);
+
+ trace_dump_struct_end();
+}
+
+
+void trace_dump_shader_state(const struct pipe_shader_state *state)
+{
+ static char str[8192];
+
+ if(!state) {
+ trace_dump_null();
+ return;
+ }
+
+ tgsi_dump_str(state->tokens, 0, str, sizeof(str));
+
+ trace_dump_struct_begin("pipe_shader_state");
+
+ trace_dump_member_begin("tokens");
+ trace_dump_string(str);
+ trace_dump_member_end();
+
+ trace_dump_struct_end();
+}
+
+
+void trace_dump_depth_stencil_alpha_state(const struct pipe_depth_stencil_alpha_state *state)
+{
+ unsigned i;
+
+ if(!state) {
+ trace_dump_null();
+ return;
+ }
+
+ trace_dump_struct_begin("pipe_depth_stencil_alpha_state");
+
+ trace_dump_member_begin("depth");
+ trace_dump_struct_begin("pipe_depth_state");
+ trace_dump_member(bool, &state->depth, enabled);
+ trace_dump_member(bool, &state->depth, writemask);
+ trace_dump_member(uint, &state->depth, func);
+ trace_dump_member(bool, &state->depth, occlusion_count);
+ trace_dump_struct_end();
+ trace_dump_member_end();
+
+ trace_dump_member_begin("stencil");
+ trace_dump_array_begin();
+ for(i = 0; i < Elements(state->stencil); ++i) {
+ trace_dump_elem_begin();
+ trace_dump_struct_begin("pipe_stencil_state");
+ trace_dump_member(bool, &state->stencil[i], enabled);
+ trace_dump_member(uint, &state->stencil[i], func);
+ trace_dump_member(uint, &state->stencil[i], fail_op);
+ trace_dump_member(uint, &state->stencil[i], zpass_op);
+ trace_dump_member(uint, &state->stencil[i], zfail_op);
+ trace_dump_member(uint, &state->stencil[i], ref_value);
+ trace_dump_member(uint, &state->stencil[i], valuemask);
+ trace_dump_member(uint, &state->stencil[i], writemask);
+ trace_dump_struct_end();
+ trace_dump_elem_end();
+ }
+ trace_dump_array_end();
+ trace_dump_member_end();
+
+ trace_dump_member_begin("alpha");
+ trace_dump_struct_begin("pipe_alpha_state");
+ trace_dump_member(bool, &state->alpha, enabled);
+ trace_dump_member(uint, &state->alpha, func);
+ trace_dump_member(float, &state->alpha, ref_value);
+ trace_dump_struct_end();
+ trace_dump_member_end();
+
+ trace_dump_struct_end();
+}
+
+
+void trace_dump_blend_state(const struct pipe_blend_state *state)
+{
+ if(!state) {
+ trace_dump_null();
+ return;
+ }
+
+ trace_dump_struct_begin("pipe_blend_state");
+
+ trace_dump_member(bool, state, blend_enable);
+
+ trace_dump_member(uint, state, rgb_func);
+ trace_dump_member(uint, state, rgb_src_factor);
+ trace_dump_member(uint, state, rgb_dst_factor);
+
+ trace_dump_member(uint, state, alpha_func);
+ trace_dump_member(uint, state, alpha_src_factor);
+ trace_dump_member(uint, state, alpha_dst_factor);
+
+ trace_dump_member(bool, state, logicop_enable);
+ trace_dump_member(uint, state, logicop_func);
+
+ trace_dump_member(uint, state, colormask);
+ trace_dump_member(bool, state, dither);
+
+ trace_dump_struct_end();
+}
+
+
+void trace_dump_blend_color(const struct pipe_blend_color *state)
+{
+ if(!state) {
+ trace_dump_null();
+ return;
+ }
+
+ trace_dump_struct_begin("pipe_blend_color");
+
+ trace_dump_member_array(float, state, color);
+
+ trace_dump_struct_end();
+}
+
+
+void trace_dump_framebuffer_state(const struct pipe_framebuffer_state *state)
+{
+ trace_dump_struct_begin("pipe_framebuffer_state");
+
+ trace_dump_member(uint, state, width);
+ trace_dump_member(uint, state, height);
+ trace_dump_member(uint, state, nr_cbufs);
+ trace_dump_member_array(ptr, state, cbufs);
+ trace_dump_member(ptr, state, zsbuf);
+
+ trace_dump_struct_end();
+}
+
+
+void trace_dump_sampler_state(const struct pipe_sampler_state *state)
+{
+ if(!state) {
+ trace_dump_null();
+ return;
+ }
+
+ trace_dump_struct_begin("pipe_sampler_state");
+
+ trace_dump_member(uint, state, wrap_s);
+ trace_dump_member(uint, state, wrap_t);
+ trace_dump_member(uint, state, wrap_r);
+ trace_dump_member(uint, state, min_img_filter);
+ trace_dump_member(uint, state, min_mip_filter);
+ trace_dump_member(uint, state, mag_img_filter);
+ trace_dump_member(bool, state, compare_mode);
+ trace_dump_member(uint, state, compare_func);
+ trace_dump_member(bool, state, normalized_coords);
+ trace_dump_member(uint, state, prefilter);
+ trace_dump_member(float, state, shadow_ambient);
+ trace_dump_member(float, state, lod_bias);
+ trace_dump_member(float, state, min_lod);
+ trace_dump_member(float, state, max_lod);
+ trace_dump_member_array(float, state, border_color);
+ trace_dump_member(float, state, max_anisotropy);
+
+ trace_dump_struct_end();
+}
+
+
+void trace_dump_surface(const struct pipe_surface *state)
+{
+ if(!state) {
+ trace_dump_null();
+ return;
+ }
+
+ trace_dump_struct_begin("pipe_surface");
+
+ trace_dump_reference(&state->reference);
+
+ trace_dump_member(format, state, format);
+ trace_dump_member(uint, state, width);
+ trace_dump_member(uint, state, height);
+
+ trace_dump_member(uint, state, layout);
+ trace_dump_member(uint, state, offset);
+ trace_dump_member(uint, state, usage);
+
+ trace_dump_member(ptr, state, texture);
+ trace_dump_member(uint, state, face);
+ trace_dump_member(uint, state, level);
+ trace_dump_member(uint, state, zslice);
+
+ trace_dump_struct_end();
+}
+
+
+void trace_dump_transfer(const struct pipe_transfer *state)
+{
+ if(!state) {
+ trace_dump_null();
+ return;
+ }
+
+ trace_dump_struct_begin("pipe_transfer");
+
+ trace_dump_member(format, state, format);
+ trace_dump_member(uint, state, width);
+ trace_dump_member(uint, state, height);
+
+ trace_dump_member_begin("block");
+ trace_dump_block(&state->block);
+ trace_dump_member_end();
+
+ trace_dump_member(uint, state, nblocksx);
+ trace_dump_member(uint, state, nblocksy);
+ trace_dump_member(uint, state, stride);
+ trace_dump_member(uint, state, usage);
+
+ trace_dump_member(ptr, state, texture);
+ trace_dump_member(uint, state, face);
+ trace_dump_member(uint, state, level);
+ trace_dump_member(uint, state, zslice);
+
+ trace_dump_struct_end();
+}
+
+
+void trace_dump_vertex_buffer(const struct pipe_vertex_buffer *state)
+{
+ if(!state) {
+ trace_dump_null();
+ return;
+ }
+
+ trace_dump_struct_begin("pipe_vertex_buffer");
+
+ trace_dump_member(uint, state, stride);
+ trace_dump_member(uint, state, max_index);
+ trace_dump_member(uint, state, buffer_offset);
+ trace_dump_member(buffer_ptr, state, buffer);
+
+ trace_dump_struct_end();
+}
+
+
+void trace_dump_vertex_element(const struct pipe_vertex_element *state)
+{
+ if(!state) {
+ trace_dump_null();
+ return;
+ }
+
+ trace_dump_struct_begin("pipe_vertex_element");
+
+ trace_dump_member(uint, state, src_offset);
+
+ trace_dump_member(uint, state, vertex_buffer_index);
+ trace_dump_member(uint, state, nr_components);
+
+ trace_dump_member(format, state, src_format);
+
+ trace_dump_struct_end();
+}
diff --git a/src/gallium/drivers/trace/tr_dump_state.h b/src/gallium/drivers/trace/tr_dump_state.h
new file mode 100644
index 0000000000..05b821adb6
--- /dev/null
+++ b/src/gallium/drivers/trace/tr_dump_state.h
@@ -0,0 +1,78 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#ifndef TR_DUMP_STATE_H_
+#define TR_DUMP_STATE_H_
+
+#include "pipe/p_format.h"
+#include "pipe/p_state.h"
+#include "pipe/p_shader_tokens.h"
+
+
+void trace_dump_format(enum pipe_format format);
+
+void trace_dump_block(const struct pipe_format_block *block);
+
+void trace_dump_template(const struct pipe_texture *templat);
+
+
+void trace_dump_rasterizer_state(const struct pipe_rasterizer_state *state);
+
+void trace_dump_poly_stipple(const struct pipe_poly_stipple *state);
+
+void trace_dump_viewport_state(const struct pipe_viewport_state *state);
+
+void trace_dump_scissor_state(const struct pipe_scissor_state *state);
+
+void trace_dump_clip_state(const struct pipe_clip_state *state);
+
+void trace_dump_constant_buffer(const struct pipe_constant_buffer *state);
+
+void trace_dump_token(const struct tgsi_token *token);
+
+void trace_dump_shader_state(const struct pipe_shader_state *state);
+
+void trace_dump_depth_stencil_alpha_state(const struct pipe_depth_stencil_alpha_state *state);
+
+void trace_dump_blend_state(const struct pipe_blend_state *state);
+
+void trace_dump_blend_color(const struct pipe_blend_color *state);
+
+void trace_dump_framebuffer_state(const struct pipe_framebuffer_state *state);
+
+void trace_dump_sampler_state(const struct pipe_sampler_state *state);
+
+void trace_dump_surface(const struct pipe_surface *state);
+
+void trace_dump_transfer(const struct pipe_transfer *state);
+
+void trace_dump_vertex_buffer(const struct pipe_vertex_buffer *state);
+
+void trace_dump_vertex_element(const struct pipe_vertex_element *state);
+
+
+#endif /* TR_STATE_H */
diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c
index 12a8535342..e659416aba 100644
--- a/src/gallium/drivers/trace/tr_screen.c
+++ b/src/gallium/drivers/trace/tr_screen.c
@@ -30,7 +30,7 @@
#include "tr_buffer.h"
#include "tr_dump.h"
-#include "tr_state.h"
+#include "tr_dump_state.h"
#include "tr_texture.h"
#include "tr_screen.h"
diff --git a/src/gallium/drivers/trace/tr_state.c b/src/gallium/drivers/trace/tr_state.c
deleted file mode 100644
index a9570c1aeb..0000000000
--- a/src/gallium/drivers/trace/tr_state.c
+++ /dev/null
@@ -1,491 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-
-#include "pipe/p_compiler.h"
-#include "util/u_memory.h"
-#include "tgsi/tgsi_dump.h"
-
-#include "tr_dump.h"
-#include "tr_state.h"
-
-
-void trace_dump_format(enum pipe_format format)
-{
- trace_dump_enum(pf_name(format) );
-}
-
-
-void trace_dump_block(const struct pipe_format_block *block)
-{
- trace_dump_struct_begin("pipe_format_block");
- trace_dump_member(uint, block, size);
- trace_dump_member(uint, block, width);
- trace_dump_member(uint, block, height);
- trace_dump_struct_end();
-}
-
-
-static void trace_dump_reference(const struct pipe_reference *reference)
-{
- trace_dump_struct_begin("pipe_reference");
- trace_dump_member(int, &reference->count, count);
- trace_dump_struct_end();
-}
-
-
-void trace_dump_template(const struct pipe_texture *templat)
-{
- if(!templat) {
- trace_dump_null();
- return;
- }
-
- trace_dump_struct_begin("pipe_texture");
-
- trace_dump_member(int, templat, target);
- trace_dump_member(format, templat, format);
-
- trace_dump_member_begin("width");
- trace_dump_array(uint, templat->width, 1);
- trace_dump_member_end();
-
- trace_dump_member_begin("height");
- trace_dump_array(uint, templat->height, 1);
- trace_dump_member_end();
-
- trace_dump_member_begin("depth");
- trace_dump_array(uint, templat->depth, 1);
- trace_dump_member_end();
-
- trace_dump_member_begin("block");
- trace_dump_block(&templat->block);
- trace_dump_member_end();
-
- trace_dump_member(uint, templat, last_level);
- trace_dump_member(uint, templat, tex_usage);
-
- trace_dump_struct_end();
-}
-
-
-void trace_dump_rasterizer_state(const struct pipe_rasterizer_state *state)
-{
- if(!state) {
- trace_dump_null();
- return;
- }
-
- trace_dump_struct_begin("pipe_rasterizer_state");
-
- trace_dump_member(bool, state, flatshade);
- trace_dump_member(bool, state, light_twoside);
- trace_dump_member(uint, state, front_winding);
- trace_dump_member(uint, state, cull_mode);
- trace_dump_member(uint, state, fill_cw);
- trace_dump_member(uint, state, fill_ccw);
- trace_dump_member(bool, state, offset_cw);
- trace_dump_member(bool, state, offset_ccw);
- trace_dump_member(bool, state, scissor);
- trace_dump_member(bool, state, poly_smooth);
- trace_dump_member(bool, state, poly_stipple_enable);
- trace_dump_member(bool, state, point_smooth);
- trace_dump_member(bool, state, point_sprite);
- trace_dump_member(bool, state, point_size_per_vertex);
- trace_dump_member(bool, state, multisample);
- trace_dump_member(bool, state, line_smooth);
- trace_dump_member(bool, state, line_stipple_enable);
- trace_dump_member(uint, state, line_stipple_factor);
- trace_dump_member(uint, state, line_stipple_pattern);
- trace_dump_member(bool, state, line_last_pixel);
- trace_dump_member(bool, state, bypass_vs_clip_and_viewport);
- trace_dump_member(bool, state, flatshade_first);
- trace_dump_member(bool, state, gl_rasterization_rules);
-
- trace_dump_member(float, state, line_width);
- trace_dump_member(float, state, point_size);
- trace_dump_member(float, state, point_size_min);
- trace_dump_member(float, state, point_size_max);
- trace_dump_member(float, state, offset_units);
- trace_dump_member(float, state, offset_scale);
-
- trace_dump_member_array(uint, state, sprite_coord_mode);
-
- trace_dump_struct_end();
-}
-
-
-void trace_dump_poly_stipple(const struct pipe_poly_stipple *state)
-{
- if(!state) {
- trace_dump_null();
- return;
- }
-
- trace_dump_struct_begin("pipe_poly_stipple");
-
- trace_dump_member_begin("stipple");
- trace_dump_array(uint,
- state->stipple,
- Elements(state->stipple));
- trace_dump_member_end();
-
- trace_dump_struct_end();
-}
-
-
-void trace_dump_viewport_state(const struct pipe_viewport_state *state)
-{
- if(!state) {
- trace_dump_null();
- return;
- }
-
- trace_dump_struct_begin("pipe_viewport_state");
-
- trace_dump_member_array(float, state, scale);
- trace_dump_member_array(float, state, translate);
-
- trace_dump_struct_end();
-}
-
-
-void trace_dump_scissor_state(const struct pipe_scissor_state *state)
-{
- if(!state) {
- trace_dump_null();
- return;
- }
-
- trace_dump_struct_begin("pipe_scissor_state");
-
- trace_dump_member(uint, state, minx);
- trace_dump_member(uint, state, miny);
- trace_dump_member(uint, state, maxx);
- trace_dump_member(uint, state, maxy);
-
- trace_dump_struct_end();
-}
-
-
-void trace_dump_clip_state(const struct pipe_clip_state *state)
-{
- unsigned i;
-
- if(!state) {
- trace_dump_null();
- return;
- }
-
- trace_dump_struct_begin("pipe_clip_state");
-
- trace_dump_member_begin("ucp");
- trace_dump_array_begin();
- for(i = 0; i < PIPE_MAX_CLIP_PLANES; ++i) {
- trace_dump_elem_begin();
- trace_dump_array(float, state->ucp[i], 4);
- trace_dump_elem_end();
- }
- trace_dump_array_end();
- trace_dump_member_end();
-
- trace_dump_member(uint, state, nr);
-
- trace_dump_struct_end();
-}
-
-
-void trace_dump_constant_buffer(const struct pipe_constant_buffer *state)
-{
- if(!state) {
- trace_dump_null();
- return;
- }
-
- trace_dump_struct_begin("pipe_constant_buffer");
-
- trace_dump_member(buffer_ptr, state, buffer);
-
- trace_dump_struct_end();
-}
-
-
-void trace_dump_shader_state(const struct pipe_shader_state *state)
-{
- static char str[8192];
-
- if(!state) {
- trace_dump_null();
- return;
- }
-
- tgsi_dump_str(state->tokens, 0, str, sizeof(str));
-
- trace_dump_struct_begin("pipe_shader_state");
-
- trace_dump_member_begin("tokens");
- trace_dump_string(str);
- trace_dump_member_end();
-
- trace_dump_struct_end();
-}
-
-
-void trace_dump_depth_stencil_alpha_state(const struct pipe_depth_stencil_alpha_state *state)
-{
- unsigned i;
-
- if(!state) {
- trace_dump_null();
- return;
- }
-
- trace_dump_struct_begin("pipe_depth_stencil_alpha_state");
-
- trace_dump_member_begin("depth");
- trace_dump_struct_begin("pipe_depth_state");
- trace_dump_member(bool, &state->depth, enabled);
- trace_dump_member(bool, &state->depth, writemask);
- trace_dump_member(uint, &state->depth, func);
- trace_dump_member(bool, &state->depth, occlusion_count);
- trace_dump_struct_end();
- trace_dump_member_end();
-
- trace_dump_member_begin("stencil");
- trace_dump_array_begin();
- for(i = 0; i < Elements(state->stencil); ++i) {
- trace_dump_elem_begin();
- trace_dump_struct_begin("pipe_stencil_state");
- trace_dump_member(bool, &state->stencil[i], enabled);
- trace_dump_member(uint, &state->stencil[i], func);
- trace_dump_member(uint, &state->stencil[i], fail_op);
- trace_dump_member(uint, &state->stencil[i], zpass_op);
- trace_dump_member(uint, &state->stencil[i], zfail_op);
- trace_dump_member(uint, &state->stencil[i], ref_value);
- trace_dump_member(uint, &state->stencil[i], valuemask);
- trace_dump_member(uint, &state->stencil[i], writemask);
- trace_dump_struct_end();
- trace_dump_elem_end();
- }
- trace_dump_array_end();
- trace_dump_member_end();
-
- trace_dump_member_begin("alpha");
- trace_dump_struct_begin("pipe_alpha_state");
- trace_dump_member(bool, &state->alpha, enabled);
- trace_dump_member(uint, &state->alpha, func);
- trace_dump_member(float, &state->alpha, ref_value);
- trace_dump_struct_end();
- trace_dump_member_end();
-
- trace_dump_struct_end();
-}
-
-
-void trace_dump_blend_state(const struct pipe_blend_state *state)
-{
- if(!state) {
- trace_dump_null();
- return;
- }
-
- trace_dump_struct_begin("pipe_blend_state");
-
- trace_dump_member(bool, state, blend_enable);
-
- trace_dump_member(uint, state, rgb_func);
- trace_dump_member(uint, state, rgb_src_factor);
- trace_dump_member(uint, state, rgb_dst_factor);
-
- trace_dump_member(uint, state, alpha_func);
- trace_dump_member(uint, state, alpha_src_factor);
- trace_dump_member(uint, state, alpha_dst_factor);
-
- trace_dump_member(bool, state, logicop_enable);
- trace_dump_member(uint, state, logicop_func);
-
- trace_dump_member(uint, state, colormask);
- trace_dump_member(bool, state, dither);
-
- trace_dump_struct_end();
-}
-
-
-void trace_dump_blend_color(const struct pipe_blend_color *state)
-{
- if(!state) {
- trace_dump_null();
- return;
- }
-
- trace_dump_struct_begin("pipe_blend_color");
-
- trace_dump_member_array(float, state, color);
-
- trace_dump_struct_end();
-}
-
-
-void trace_dump_framebuffer_state(const struct pipe_framebuffer_state *state)
-{
- trace_dump_struct_begin("pipe_framebuffer_state");
-
- trace_dump_member(uint, state, width);
- trace_dump_member(uint, state, height);
- trace_dump_member(uint, state, nr_cbufs);
- trace_dump_member_array(ptr, state, cbufs);
- trace_dump_member(ptr, state, zsbuf);
-
- trace_dump_struct_end();
-}
-
-
-void trace_dump_sampler_state(const struct pipe_sampler_state *state)
-{
- if(!state) {
- trace_dump_null();
- return;
- }
-
- trace_dump_struct_begin("pipe_sampler_state");
-
- trace_dump_member(uint, state, wrap_s);
- trace_dump_member(uint, state, wrap_t);
- trace_dump_member(uint, state, wrap_r);
- trace_dump_member(uint, state, min_img_filter);
- trace_dump_member(uint, state, min_mip_filter);
- trace_dump_member(uint, state, mag_img_filter);
- trace_dump_member(bool, state, compare_mode);
- trace_dump_member(uint, state, compare_func);
- trace_dump_member(bool, state, normalized_coords);
- trace_dump_member(uint, state, prefilter);
- trace_dump_member(float, state, shadow_ambient);
- trace_dump_member(float, state, lod_bias);
- trace_dump_member(float, state, min_lod);
- trace_dump_member(float, state, max_lod);
- trace_dump_member_array(float, state, border_color);
- trace_dump_member(float, state, max_anisotropy);
-
- trace_dump_struct_end();
-}
-
-
-void trace_dump_surface(const struct pipe_surface *state)
-{
- if(!state) {
- trace_dump_null();
- return;
- }
-
- trace_dump_struct_begin("pipe_surface");
-
- trace_dump_reference(&state->reference);
-
- trace_dump_member(format, state, format);
- trace_dump_member(uint, state, width);
- trace_dump_member(uint, state, height);
-
- trace_dump_member(uint, state, layout);
- trace_dump_member(uint, state, offset);
- trace_dump_member(uint, state, usage);
-
- trace_dump_member(ptr, state, texture);
- trace_dump_member(uint, state, face);
- trace_dump_member(uint, state, level);
- trace_dump_member(uint, state, zslice);
-
- trace_dump_struct_end();
-}
-
-
-void trace_dump_transfer(const struct pipe_transfer *state)
-{
- if(!state) {
- trace_dump_null();
- return;
- }
-
- trace_dump_struct_begin("pipe_transfer");
-
- trace_dump_member(format, state, format);
- trace_dump_member(uint, state, width);
- trace_dump_member(uint, state, height);
-
- trace_dump_member_begin("block");
- trace_dump_block(&state->block);
- trace_dump_member_end();
-
- trace_dump_member(uint, state, nblocksx);
- trace_dump_member(uint, state, nblocksy);
- trace_dump_member(uint, state, stride);
- trace_dump_member(uint, state, usage);
-
- trace_dump_member(ptr, state, texture);
- trace_dump_member(uint, state, face);
- trace_dump_member(uint, state, level);
- trace_dump_member(uint, state, zslice);
-
- trace_dump_struct_end();
-}
-
-
-void trace_dump_vertex_buffer(const struct pipe_vertex_buffer *state)
-{
- if(!state) {
- trace_dump_null();
- return;
- }
-
- trace_dump_struct_begin("pipe_vertex_buffer");
-
- trace_dump_member(uint, state, stride);
- trace_dump_member(uint, state, max_index);
- trace_dump_member(uint, state, buffer_offset);
- trace_dump_member(buffer_ptr, state, buffer);
-
- trace_dump_struct_end();
-}
-
-
-void trace_dump_vertex_element(const struct pipe_vertex_element *state)
-{
- if(!state) {
- trace_dump_null();
- return;
- }
-
- trace_dump_struct_begin("pipe_vertex_element");
-
- trace_dump_member(uint, state, src_offset);
-
- trace_dump_member(uint, state, vertex_buffer_index);
- trace_dump_member(uint, state, nr_components);
-
- trace_dump_member(format, state, src_format);
-
- trace_dump_struct_end();
-}
diff --git a/src/gallium/drivers/trace/tr_state.h b/src/gallium/drivers/trace/tr_state.h
deleted file mode 100644
index 513ed0ac98..0000000000
--- a/src/gallium/drivers/trace/tr_state.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef TR_STATE_H
-#define TR_STATE_H
-
-#include "pipe/p_format.h"
-#include "pipe/p_state.h"
-#include "pipe/p_shader_tokens.h"
-
-
-void trace_dump_format(enum pipe_format format);
-
-void trace_dump_block(const struct pipe_format_block *block);
-
-void trace_dump_template(const struct pipe_texture *templat);
-
-
-void trace_dump_rasterizer_state(const struct pipe_rasterizer_state *state);
-
-void trace_dump_poly_stipple(const struct pipe_poly_stipple *state);
-
-void trace_dump_viewport_state(const struct pipe_viewport_state *state);
-
-void trace_dump_scissor_state(const struct pipe_scissor_state *state);
-
-void trace_dump_clip_state(const struct pipe_clip_state *state);
-
-void trace_dump_constant_buffer(const struct pipe_constant_buffer *state);
-
-void trace_dump_token(const struct tgsi_token *token);
-
-void trace_dump_shader_state(const struct pipe_shader_state *state);
-
-void trace_dump_depth_stencil_alpha_state(const struct pipe_depth_stencil_alpha_state *state);
-
-void trace_dump_blend_state(const struct pipe_blend_state *state);
-
-void trace_dump_blend_color(const struct pipe_blend_color *state);
-
-void trace_dump_framebuffer_state(const struct pipe_framebuffer_state *state);
-
-void trace_dump_sampler_state(const struct pipe_sampler_state *state);
-
-void trace_dump_surface(const struct pipe_surface *state);
-
-void trace_dump_transfer(const struct pipe_transfer *state);
-
-void trace_dump_vertex_buffer(const struct pipe_vertex_buffer *state);
-
-void trace_dump_vertex_element(const struct pipe_vertex_element *state);
-
-
-#endif /* TR_STATE_H */
--
cgit v1.2.3
From 3b4da4e9dac00f181380a9896ef3329964432c43 Mon Sep 17 00:00:00 2001
From: Jakob Bornecrantz
Date: Fri, 15 May 2009 05:30:43 +0200
Subject: trace: Put shaders on a list in the context
---
src/gallium/drivers/trace/Makefile | 1 +
src/gallium/drivers/trace/SConscript | 1 +
src/gallium/drivers/trace/tr_context.c | 41 ++++++++++++++++++-----
src/gallium/drivers/trace/tr_context.h | 7 ++++
src/gallium/drivers/trace/tr_state.c | 50 ++++++++++++++++++++++++++++
src/gallium/drivers/trace/tr_state.h | 59 ++++++++++++++++++++++++++++++++++
6 files changed, 151 insertions(+), 8 deletions(-)
create mode 100644 src/gallium/drivers/trace/tr_state.c
create mode 100644 src/gallium/drivers/trace/tr_state.h
diff --git a/src/gallium/drivers/trace/Makefile b/src/gallium/drivers/trace/Makefile
index 188998d579..94be0bfd5a 100644
--- a/src/gallium/drivers/trace/Makefile
+++ b/src/gallium/drivers/trace/Makefile
@@ -8,6 +8,7 @@ C_SOURCES = \
tr_context.c \
tr_dump.c \
tr_dump_state.c \
+ tr_state.c \
tr_screen.c \
tr_texture.c
diff --git a/src/gallium/drivers/trace/SConscript b/src/gallium/drivers/trace/SConscript
index 4ab829a3a8..9b5af0d86f 100644
--- a/src/gallium/drivers/trace/SConscript
+++ b/src/gallium/drivers/trace/SConscript
@@ -10,6 +10,7 @@ trace = env.ConvenienceLibrary(
'tr_dump.c',
'tr_dump_state.c',
'tr_screen.c',
+ 'tr_state.c',
'tr_texture.c',
])
diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c
index 6a19233a9a..dee9ac57b4 100644
--- a/src/gallium/drivers/trace/tr_context.c
+++ b/src/gallium/drivers/trace/tr_context.c
@@ -32,10 +32,10 @@
#include "tr_dump.h"
#include "tr_dump_state.h"
+#include "tr_state.h"
#include "tr_buffer.h"
#include "tr_screen.h"
#include "tr_texture.h"
-#include "tr_context.h"
static INLINE struct pipe_buffer *
@@ -573,23 +573,30 @@ trace_context_create_fs_state(struct pipe_context *_pipe,
trace_dump_call_end();
+ result = trace_shader_create(tr_ctx, state, result);
+
return result;
}
static INLINE void
trace_context_bind_fs_state(struct pipe_context *_pipe,
- void *state)
+ void *_state)
{
struct trace_context *tr_ctx = trace_context(_pipe);
+ struct trace_shader *tr_shdr = trace_shader(_state);
struct pipe_context *pipe = tr_ctx->pipe;
+ void *state = tr_shdr ? tr_shdr->state : NULL;
trace_dump_call_begin("pipe_context", "bind_fs_state");
trace_dump_arg(ptr, pipe);
trace_dump_arg(ptr, state);
- pipe->bind_fs_state(pipe, state);;
+ if (tr_shdr && tr_shdr->replaced)
+ state = tr_shdr->replaced;
+
+ pipe->bind_fs_state(pipe, state);
trace_dump_call_end();
}
@@ -597,19 +604,23 @@ trace_context_bind_fs_state(struct pipe_context *_pipe,
static INLINE void
trace_context_delete_fs_state(struct pipe_context *_pipe,
- void *state)
+ void *_state)
{
struct trace_context *tr_ctx = trace_context(_pipe);
+ struct trace_shader *tr_shdr = trace_shader(_state);
struct pipe_context *pipe = tr_ctx->pipe;
+ void *state = tr_shdr->state;
trace_dump_call_begin("pipe_context", "delete_fs_state");
trace_dump_arg(ptr, pipe);
trace_dump_arg(ptr, state);
- pipe->delete_fs_state(pipe, state);;
+ pipe->delete_fs_state(pipe, state);
trace_dump_call_end();
+
+ trace_shader_destroy(tr_ctx, tr_shdr);
}
@@ -626,28 +637,35 @@ trace_context_create_vs_state(struct pipe_context *_pipe,
trace_dump_arg(ptr, pipe);
trace_dump_arg(shader_state, state);
- result = pipe->create_vs_state(pipe, state);;
+ result = pipe->create_vs_state(pipe, state);
trace_dump_ret(ptr, result);
trace_dump_call_end();
+ result = trace_shader_create(tr_ctx, state, result);
+
return result;
}
static INLINE void
trace_context_bind_vs_state(struct pipe_context *_pipe,
- void *state)
+ void *_state)
{
struct trace_context *tr_ctx = trace_context(_pipe);
+ struct trace_shader *tr_shdr = trace_shader(_state);
struct pipe_context *pipe = tr_ctx->pipe;
+ void *state = tr_shdr ? tr_shdr->state : NULL;
trace_dump_call_begin("pipe_context", "bind_vs_state");
trace_dump_arg(ptr, pipe);
trace_dump_arg(ptr, state);
+ if (tr_shdr && tr_shdr->replaced)
+ state = tr_shdr->replaced;
+
pipe->bind_vs_state(pipe, state);;
trace_dump_call_end();
@@ -656,10 +674,12 @@ trace_context_bind_vs_state(struct pipe_context *_pipe,
static INLINE void
trace_context_delete_vs_state(struct pipe_context *_pipe,
- void *state)
+ void *_state)
{
struct trace_context *tr_ctx = trace_context(_pipe);
+ struct trace_shader *tr_shdr = trace_shader(_state);
struct pipe_context *pipe = tr_ctx->pipe;
+ void *state = tr_shdr->state;
trace_dump_call_begin("pipe_context", "delete_vs_state");
@@ -669,6 +689,8 @@ trace_context_delete_vs_state(struct pipe_context *_pipe,
pipe->delete_vs_state(pipe, state);;
trace_dump_call_end();
+
+ trace_shader_destroy(tr_ctx, tr_shdr);
}
@@ -1099,6 +1121,9 @@ trace_context_create(struct pipe_screen *_screen,
if(!tr_ctx)
goto error1;
+ pipe_mutex_init(tr_ctx->list_mutex);
+ make_empty_list(&tr_ctx->shaders);
+
tr_ctx->base.winsys = _screen->winsys;
tr_ctx->base.screen = _screen;
tr_ctx->base.destroy = trace_context_destroy;
diff --git a/src/gallium/drivers/trace/tr_context.h b/src/gallium/drivers/trace/tr_context.h
index 2512a0a232..a7da7b9526 100644
--- a/src/gallium/drivers/trace/tr_context.h
+++ b/src/gallium/drivers/trace/tr_context.h
@@ -33,6 +33,7 @@
#include "util/u_debug.h"
#include "pipe/p_context.h"
+#include "tr_screen.h"
#ifdef __cplusplus
extern "C" {
@@ -45,7 +46,13 @@ struct trace_context
struct pipe_context *pipe;
+ /* for list on screen */
struct tr_list list;
+
+ /* list of state objects */
+ pipe_mutex list_mutex;
+ unsigned num_shaders;
+ struct tr_list shaders;
};
diff --git a/src/gallium/drivers/trace/tr_state.c b/src/gallium/drivers/trace/tr_state.c
new file mode 100644
index 0000000000..c9ce63a0ed
--- /dev/null
+++ b/src/gallium/drivers/trace/tr_state.c
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2009 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "tr_state.h"
+
+#include "util/u_memory.h"
+#include "util/u_simple_list.h"
+
+struct trace_shader * trace_shader_create(struct trace_context *tr_ctx,
+ const struct pipe_shader_state *state,
+ void *result)
+{
+ struct trace_shader *tr_shdr = CALLOC_STRUCT(trace_shader);
+
+ tr_shdr->state = result;
+
+ /* works on context as well */
+ trace_screen_add_to_list(tr_ctx, shaders, tr_shdr);
+
+ return tr_shdr;
+}
+
+void trace_shader_destroy(struct trace_context *tr_ctx,
+ struct trace_shader *tr_shdr)
+{
+ trace_screen_remove_from_list(tr_ctx, shaders, tr_shdr);
+
+ FREE(tr_shdr);
+}
diff --git a/src/gallium/drivers/trace/tr_state.h b/src/gallium/drivers/trace/tr_state.h
new file mode 100644
index 0000000000..bca615c50e
--- /dev/null
+++ b/src/gallium/drivers/trace/tr_state.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2009 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef TR_STATE_H_
+#define TR_STATE_H_
+
+#include "tr_context.h"
+
+struct tgsi_token;
+
+struct trace_shader
+{
+ struct tr_list list;
+
+ void *state;
+ void *replaced;
+
+ struct tgsi_token *tokens;
+ struct tgsi_token *replaced_tokens;
+
+ boolean disabled;
+};
+
+
+static INLINE struct trace_shader *
+trace_shader(void *state)
+{
+ return (struct trace_shader *)state;
+}
+
+struct trace_shader * trace_shader_create(struct trace_context *tr_ctx,
+ const struct pipe_shader_state *state,
+ void *result);
+
+void trace_shader_destroy(struct trace_context *tr_ctx,
+ struct trace_shader *tr_shdr);
+
+#endif
--
cgit v1.2.3
From ab95f389a59acd8f70fc6ce00d945511f0a45d8b Mon Sep 17 00:00:00 2001
From: Jakob Bornecrantz
Date: Fri, 15 May 2009 05:59:24 +0200
Subject: trace: If either shader is disabled don't draw
---
src/gallium/drivers/trace/tr_context.c | 13 +++++++++++++
src/gallium/drivers/trace/tr_context.h | 6 ++++++
2 files changed, 19 insertions(+)
diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c
index dee9ac57b4..e51af2451b 100644
--- a/src/gallium/drivers/trace/tr_context.c
+++ b/src/gallium/drivers/trace/tr_context.c
@@ -121,6 +121,9 @@ trace_context_draw_arrays(struct pipe_context *_pipe,
struct pipe_context *pipe = tr_ctx->pipe;
boolean result;
+ if (tr_ctx->curr.fs->disabled || tr_ctx->curr.vs->disabled)
+ return 0;
+
trace_dump_call_begin("pipe_context", "draw_arrays");
trace_dump_arg(ptr, pipe);
@@ -150,6 +153,9 @@ trace_context_draw_elements(struct pipe_context *_pipe,
struct pipe_buffer *indexBuffer = tr_buf->buffer;
boolean result;
+ if (tr_ctx->curr.fs->disabled || tr_ctx->curr.vs->disabled)
+ return 0;
+
trace_screen_user_buffer_update(_pipe->screen, indexBuffer);
trace_dump_call_begin("pipe_context", "draw_elements");
@@ -187,6 +193,9 @@ trace_context_draw_range_elements(struct pipe_context *_pipe,
struct pipe_buffer *indexBuffer = tr_buf->buffer;
boolean result;
+ if (tr_ctx->curr.fs->disabled || tr_ctx->curr.vs->disabled)
+ return 0;
+
trace_screen_user_buffer_update(_pipe->screen, indexBuffer);
trace_dump_call_begin("pipe_context", "draw_range_elements");
@@ -593,6 +602,8 @@ trace_context_bind_fs_state(struct pipe_context *_pipe,
trace_dump_arg(ptr, pipe);
trace_dump_arg(ptr, state);
+ tr_ctx->curr.fs = tr_shdr;
+
if (tr_shdr && tr_shdr->replaced)
state = tr_shdr->replaced;
@@ -663,6 +674,8 @@ trace_context_bind_vs_state(struct pipe_context *_pipe,
trace_dump_arg(ptr, pipe);
trace_dump_arg(ptr, state);
+ tr_ctx->curr.vs = tr_shdr;
+
if (tr_shdr && tr_shdr->replaced)
state = tr_shdr->replaced;
diff --git a/src/gallium/drivers/trace/tr_context.h b/src/gallium/drivers/trace/tr_context.h
index a7da7b9526..86827f97b2 100644
--- a/src/gallium/drivers/trace/tr_context.h
+++ b/src/gallium/drivers/trace/tr_context.h
@@ -46,6 +46,12 @@ struct trace_context
struct pipe_context *pipe;
+ /* current state */
+ struct {
+ struct trace_shader *fs;
+ struct trace_shader *vs;
+ } curr;
+
/* for list on screen */
struct tr_list list;
--
cgit v1.2.3
From ee05658798c047876ccd9e5cd33e12eee1dd8758 Mon Sep 17 00:00:00 2001
From: Jakob Bornecrantz
Date: Sat, 16 May 2009 01:19:44 +0100
Subject: trace: Unwrap buffer in texture_blanket
---
src/gallium/drivers/trace/tr_screen.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c
index e659416aba..58855a8346 100644
--- a/src/gallium/drivers/trace/tr_screen.c
+++ b/src/gallium/drivers/trace/tr_screen.c
@@ -212,10 +212,12 @@ static struct pipe_texture *
trace_screen_texture_blanket(struct pipe_screen *_screen,
const struct pipe_texture *templat,
const unsigned *ppitch,
- struct pipe_buffer *buffer)
+ struct pipe_buffer *_buffer)
{
struct trace_screen *tr_scr = trace_screen(_screen);
+ struct trace_buffer *tr_buf = trace_buffer(_buffer);
struct pipe_screen *screen = tr_scr->screen;
+ struct pipe_buffer *buffer = tr_buf->buffer;
unsigned pitch = *ppitch;
struct pipe_texture *result;
--
cgit v1.2.3
From f04c38fa1fab0fe640b89d0de82fa44e2ee984a9 Mon Sep 17 00:00:00 2001
From: Jakob Bornecrantz
Date: Sat, 16 May 2009 01:49:11 +0100
Subject: trace: Export enabled status
---
src/gallium/drivers/trace/Makefile | 2 +-
src/gallium/drivers/trace/tr_context.c | 2 +-
src/gallium/drivers/trace/tr_screen.c | 23 ++++++++++++++++-------
src/gallium/drivers/trace/tr_screen.h | 7 +++++++
4 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/src/gallium/drivers/trace/Makefile b/src/gallium/drivers/trace/Makefile
index 94be0bfd5a..ecb69fb996 100644
--- a/src/gallium/drivers/trace/Makefile
+++ b/src/gallium/drivers/trace/Makefile
@@ -8,8 +8,8 @@ C_SOURCES = \
tr_context.c \
tr_dump.c \
tr_dump_state.c \
- tr_state.c \
tr_screen.c \
+ tr_state.c \
tr_texture.c
include ../../Makefile.template
diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c
index e51af2451b..a416628562 100644
--- a/src/gallium/drivers/trace/tr_context.c
+++ b/src/gallium/drivers/trace/tr_context.c
@@ -1124,7 +1124,7 @@ trace_context_create(struct pipe_screen *_screen,
if(!pipe)
goto error1;
- if(!trace_dump_trace_enabled())
+ if(!trace_enabled())
goto error1;
tr_scr = trace_screen(_screen);
diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c
index 58855a8346..bc14248eeb 100644
--- a/src/gallium/drivers/trace/tr_screen.c
+++ b/src/gallium/drivers/trace/tr_screen.c
@@ -37,6 +37,8 @@
#include "pipe/p_inlines.h"
+static boolean trace = FALSE;
+
static const char *
trace_screen_get_name(struct pipe_screen *_screen)
{
@@ -820,16 +822,20 @@ trace_screen_destroy(struct pipe_screen *_screen)
struct pipe_screen *screen = tr_scr->screen;
trace_dump_call_begin("pipe_screen", "destroy");
-
trace_dump_arg(ptr, screen);
+ trace_dump_call_end();
+ trace_dump_trace_end();
screen->destroy(screen);
- trace_dump_call_end();
+ FREE(tr_scr);
+}
- trace_dump_trace_end();
- FREE(tr_scr);
+boolean
+trace_enabled(void)
+{
+ return trace;
}
@@ -844,10 +850,13 @@ trace_screen_create(struct pipe_screen *screen)
trace_dump_init();
- if(!trace_dump_trace_begin())
- goto error1;
+ if(trace_dump_trace_begin()) {
+ trace_dumping_start();
+ trace = TRUE;
+ }
- trace_dumping_start();
+ if (!trace)
+ goto error1;
trace_dump_call_begin("", "pipe_screen_create");
diff --git a/src/gallium/drivers/trace/tr_screen.h b/src/gallium/drivers/trace/tr_screen.h
index 59f254166d..7fae182985 100644
--- a/src/gallium/drivers/trace/tr_screen.h
+++ b/src/gallium/drivers/trace/tr_screen.h
@@ -71,6 +71,13 @@ struct trace_screen
};
+/*
+ * tr_screen.c
+ */
+
+boolean
+trace_enabled(void);
+
struct trace_screen *
trace_screen(struct pipe_screen *screen);
--
cgit v1.2.3
From 3259f52a9296c1b82cd18f405735e65d2b727144 Mon Sep 17 00:00:00 2001
From: Jakob Bornecrantz
Date: Sat, 16 May 2009 01:21:02 +0100
Subject: gallium-intel: Enable trace driver
---
src/gallium/winsys/drm/intel/dri/Makefile | 1 +
src/gallium/winsys/drm/intel/dri/SConscript | 1 +
src/gallium/winsys/drm/intel/gem/intel_be_api.c | 145 ++++++++++++++++++++++++
3 files changed, 147 insertions(+)
diff --git a/src/gallium/winsys/drm/intel/dri/Makefile b/src/gallium/winsys/drm/intel/dri/Makefile
index ac0891a646..de39e759d8 100644
--- a/src/gallium/winsys/drm/intel/dri/Makefile
+++ b/src/gallium/winsys/drm/intel/dri/Makefile
@@ -6,6 +6,7 @@ LIBNAME = i915_dri.so
PIPE_DRIVERS = \
$(TOP)/src/gallium/state_trackers/dri/libdridrm.a \
$(TOP)/src/gallium/winsys/drm/intel/gem/libinteldrm.a \
+ $(TOP)/src/gallium/drivers/trace/libtrace.a \
$(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
$(TOP)/src/gallium/drivers/i915simple/libi915simple.a
diff --git a/src/gallium/winsys/drm/intel/dri/SConscript b/src/gallium/winsys/drm/intel/dri/SConscript
index b11a1927f7..e14e96e32f 100644
--- a/src/gallium/winsys/drm/intel/dri/SConscript
+++ b/src/gallium/winsys/drm/intel/dri/SConscript
@@ -5,6 +5,7 @@ env = drienv.Clone()
drivers = [
softpipe,
i915simple,
+ trace,
inteldrm
]
diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_api.c b/src/gallium/winsys/drm/intel/gem/intel_be_api.c
index f4ef7c2d88..5853afa756 100644
--- a/src/gallium/winsys/drm/intel/gem/intel_be_api.c
+++ b/src/gallium/winsys/drm/intel/gem/intel_be_api.c
@@ -2,7 +2,11 @@
#include "intel_be_api.h"
#include "i915simple/i915_winsys.h"
+#ifndef DEBUG
struct drm_api drm_api_hooks =
+#else
+static struct drm_api hooks =
+#endif
{
/* intel_be_context.c */
.create_context = intel_be_create_context,
@@ -13,3 +17,144 @@ struct drm_api drm_api_hooks =
.handle_from_buffer = intel_be_handle_from_buffer,
.global_handle_from_buffer = intel_be_global_handle_from_buffer,
};
+
+
+/*
+ * Trace integration
+ */
+
+#ifdef DEBUG
+#include "trace/tr_screen.h"
+#include "trace/tr_texture.h"
+#include "trace/tr_buffer.h"
+#include "trace/tr_context.h"
+
+static struct pipe_screen *
+trace_drm_create_screen(int fd, struct drm_create_screen_arg *arg)
+{
+ struct pipe_screen *screen;
+
+ if (arg && arg->mode != DRM_CREATE_NORMAL)
+ return NULL;
+
+ screen = hooks.create_screen(fd, arg);
+
+ return trace_screen_create(screen);
+};
+
+static struct pipe_context *
+trace_drm_create_context(struct pipe_screen *_screen)
+{
+ struct pipe_screen *screen;
+ struct pipe_context *pipe;
+
+ if (trace_enabled())
+ screen = trace_screen(_screen)->screen;
+ else
+ screen = _screen;
+
+ pipe = hooks.create_context(screen);
+
+ if (trace_enabled())
+ pipe = trace_context_create(_screen, pipe);
+
+ return pipe;
+};
+
+static boolean
+trace_drm_buffer_from_texture(struct pipe_texture *_texture,
+ struct pipe_buffer **_buffer,
+ unsigned *stride)
+{
+ struct pipe_texture *texture;
+ struct pipe_buffer *buffer = NULL;
+ boolean result;
+
+ if (trace_enabled())
+ texture = trace_texture(_texture)->texture;
+ else
+ texture = _texture;
+
+ result = hooks.buffer_from_texture(texture, &buffer, stride);
+
+ if (result && _buffer)
+ buffer = trace_buffer_create(trace_screen(texture->screen), buffer);
+
+ if (_buffer)
+ *_buffer = buffer;
+ else
+ pipe_buffer_reference(&buffer, NULL);
+
+ return result;
+}
+
+static struct pipe_buffer *
+trace_drm_buffer_from_handle(struct pipe_screen *_screen,
+ const char *name,
+ unsigned handle)
+{
+ struct pipe_screen *screen;
+ struct pipe_buffer *result;
+
+ if (trace_enabled())
+ screen = trace_screen(_screen)->screen;
+ else
+ screen = _screen;
+
+ result = hooks.buffer_from_handle(screen, name, handle);
+
+ if (trace_enabled())
+ result = trace_buffer_create(trace_screen(_screen), result);
+
+ return result;
+}
+
+static boolean
+trace_drm_handle_from_buffer(struct pipe_screen *_screen,
+ struct pipe_buffer *_buffer,
+ unsigned *handle)
+{
+ struct pipe_screen *screen;
+ struct pipe_buffer *buffer;
+
+ if (trace_enabled()) {
+ screen = trace_screen(_screen)->screen;
+ buffer = trace_buffer(_buffer)->buffer;
+ } else {
+ screen = _screen;
+ buffer = _buffer;
+ }
+
+ return hooks.handle_from_buffer(screen, buffer, handle);
+}
+
+static boolean
+trace_drm_global_handle_from_buffer(struct pipe_screen *_screen,
+ struct pipe_buffer *_buffer,
+ unsigned *handle)
+{
+ struct pipe_screen *screen;
+ struct pipe_buffer *buffer;
+
+ if (trace_enabled()) {
+ screen = trace_screen(_screen)->screen;
+ buffer = trace_buffer(_buffer)->buffer;
+ } else {
+ screen = _screen;
+ buffer = _buffer;
+ }
+
+ return hooks.global_handle_from_buffer(screen, buffer, handle);
+}
+
+struct drm_api drm_api_hooks =
+{
+ .create_screen = trace_drm_create_screen,
+ .create_context = trace_drm_create_context,
+
+ .buffer_from_texture = trace_drm_buffer_from_texture,
+ .buffer_from_handle = trace_drm_buffer_from_handle,
+ .handle_from_buffer = trace_drm_handle_from_buffer,
+ .global_handle_from_buffer = trace_drm_global_handle_from_buffer,
+};
+#endif
--
cgit v1.2.3
From 57fd20237541c34ed06587bca9f5a58c8a63fbf4 Mon Sep 17 00:00:00 2001
From: Keith Whitwell
Date: Sat, 16 May 2009 17:25:26 +0100
Subject: gallium: remove occlusion_count flag from depth-stencil state
Drivers can just keep track of whether they are within a query
by monitoring the begin/end query callbacks. The flag adds no
information beyond that.
Only softpipe was examining this flag -- it has been fixed up
and retested with demos/arbocclude.
---
src/gallium/drivers/softpipe/sp_context.h | 1 +
src/gallium/drivers/softpipe/sp_quad_pipe.c | 2 +-
src/gallium/drivers/softpipe/sp_query.c | 5 +++++
src/gallium/drivers/trace/tr_dump_state.c | 1 -
4 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/softpipe/sp_context.h b/src/gallium/drivers/softpipe/sp_context.h
index 59d6df8f2d..b89a7292e5 100644
--- a/src/gallium/drivers/softpipe/sp_context.h
+++ b/src/gallium/drivers/softpipe/sp_context.h
@@ -92,6 +92,7 @@ struct softpipe_context {
* queries.
*/
uint64_t occlusion_count;
+ unsigned active_query_count;
/** Mapped vertex buffers */
ubyte *mapped_vbuffer[PIPE_MAX_ATTRIBS];
diff --git a/src/gallium/drivers/softpipe/sp_quad_pipe.c b/src/gallium/drivers/softpipe/sp_quad_pipe.c
index 892ef87ee9..b5f69b7426 100644
--- a/src/gallium/drivers/softpipe/sp_quad_pipe.c
+++ b/src/gallium/drivers/softpipe/sp_quad_pipe.c
@@ -80,7 +80,7 @@ sp_build_quad_pipeline(struct softpipe_context *sp)
sp_push_quad_first( sp, sp->quad[i].blend, i );
}
- if (sp->depth_stencil->depth.occlusion_count) {
+ if (sp->active_query_count) {
sp_push_quad_first( sp, sp->quad[i].occlusion, i );
}
diff --git a/src/gallium/drivers/softpipe/sp_query.c b/src/gallium/drivers/softpipe/sp_query.c
index 93dab236d6..379cf4ad06 100644
--- a/src/gallium/drivers/softpipe/sp_query.c
+++ b/src/gallium/drivers/softpipe/sp_query.c
@@ -34,6 +34,7 @@
#include "util/u_memory.h"
#include "sp_context.h"
#include "sp_query.h"
+#include "sp_state.h"
struct softpipe_query {
uint64_t start;
@@ -69,6 +70,8 @@ softpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q)
struct softpipe_query *sq = softpipe_query(q);
sq->start = softpipe->occlusion_count;
+ softpipe->active_query_count++;
+ softpipe->dirty |= SP_NEW_QUERY;
}
@@ -78,7 +81,9 @@ softpipe_end_query(struct pipe_context *pipe, struct pipe_query *q)
struct softpipe_context *softpipe = softpipe_context( pipe );
struct softpipe_query *sq = softpipe_query(q);
+ softpipe->active_query_count--;
sq->end = softpipe->occlusion_count;
+ softpipe->dirty |= SP_NEW_QUERY;
}
diff --git a/src/gallium/drivers/trace/tr_dump_state.c b/src/gallium/drivers/trace/tr_dump_state.c
index 1b2b3493a6..23a2473b57 100644
--- a/src/gallium/drivers/trace/tr_dump_state.c
+++ b/src/gallium/drivers/trace/tr_dump_state.c
@@ -271,7 +271,6 @@ void trace_dump_depth_stencil_alpha_state(const struct pipe_depth_stencil_alpha_
trace_dump_member(bool, &state->depth, enabled);
trace_dump_member(bool, &state->depth, writemask);
trace_dump_member(uint, &state->depth, func);
- trace_dump_member(bool, &state->depth, occlusion_count);
trace_dump_struct_end();
trace_dump_member_end();
--
cgit v1.2.3
From 13131adbf1beb3e4222ce16c32ac7910a4a5331b Mon Sep 17 00:00:00 2001
From: Corbin Simpson
Date: Sat, 16 May 2009 08:47:36 -0700
Subject: r300-gallium: Various cleanups leftover from before.
BEGIN/END_CS pair, a few asserts, and a slightly more correct VTE setup.
---
src/gallium/drivers/r300/r300_emit.c | 6 ++++--
src/gallium/drivers/r300/r300_state.c | 2 +-
src/gallium/drivers/r300/r300_surface.c | 3 +++
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index cd5c38a0c7..3beb1b8c3f 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -163,6 +163,7 @@ void r300_emit_fb_state(struct r300_context* r300,
BEGIN_CS((8 * fb->nr_cbufs) + (fb->zsbuf ? 8 : 0) + 4);
for (i = 0; i < fb->nr_cbufs; i++) {
tex = (struct r300_texture*)fb->cbufs[i]->texture;
+ assert(tex && tex->buffer && "cbuf is marked, but NULL!");
pixpitch = tex->stride / tex->tex.block.size;
OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0 + (4 * i), 1);
@@ -177,7 +178,8 @@ void r300_emit_fb_state(struct r300_context* r300,
if (fb->zsbuf) {
tex = (struct r300_texture*)fb->zsbuf->texture;
- pixpitch = (tex->stride / tex->tex.block.size);
+ assert(tex && tex->buffer && "zsbuf is marked, but NULL!");
+ pixpitch = tex->stride / tex->tex.block.size;
OUT_CS_REG_SEQ(R300_ZB_DEPTHOFFSET, 1);
OUT_CS_RELOC(tex->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0);
@@ -473,7 +475,7 @@ void r300_emit_dirty_state(struct r300_context* r300)
/* ...textures... */
for (i = 0; i < r300->texture_count; i++) {
tex = r300->textures[i];
- assert(tex && tex->buffer && "zsbuf is marked, but NULL!");
+ assert(tex && tex->buffer && "texture is marked, but NULL!");
r300->winsys->add_buffer(r300->winsys, tex->buffer,
RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0);
}
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index 2118f7706f..49b93a420b 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -562,7 +562,7 @@ static void r300_set_viewport_state(struct pipe_context* pipe,
if (r300_screen(r300->context.screen)->caps->has_tcl) {
/* Do the transform in HW. */
- r300->viewport_state->vte_control = R300_VTX_W0_FMT;
+ r300->viewport_state->vte_control = R300_VTX_XY_FMT | R300_VTX_Z_FMT;
if (state->scale[0] != 1.0f) {
assert(state->scale[0] != 0.0f);
diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c
index 00eb4ebe7c..17b42504d4 100644
--- a/src/gallium/drivers/r300/r300_surface.c
+++ b/src/gallium/drivers/r300/r300_surface.c
@@ -264,6 +264,7 @@ static void r300_surface_copy(struct pipe_context* pipe,
r300_emit_rs_block_state(r300, &r300_rs_block_copy_state);
}
+ BEGIN_CS(28);
/* VAP stream control, mapping from input memory to PVS/RS memory */
if (caps->has_tcl) {
OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0,
@@ -313,6 +314,8 @@ static void r300_surface_copy(struct pipe_context* pipe,
OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT, 0xA);
+ END_CS;
+
r300->dirty_hw++;
}
--
cgit v1.2.3
From 5e39a8c4503596a019dc7c3ed4e24ee4117b1fca Mon Sep 17 00:00:00 2001
From: Corbin Simpson
Date: Sat, 16 May 2009 09:58:54 -0700
Subject: Create common trace_drm code, add to radeon_winsys.
---
src/gallium/auxiliary/trace/trace_drm.h | 165 ++++++++++++++++++++++++
src/gallium/winsys/drm/radeon/core/radeon_drm.c | 8 ++
src/gallium/winsys/drm/radeon/dri/Makefile | 1 +
src/gallium/winsys/drm/radeon/egl/Makefile | 1 +
4 files changed, 175 insertions(+)
create mode 100644 src/gallium/auxiliary/trace/trace_drm.h
diff --git a/src/gallium/auxiliary/trace/trace_drm.h b/src/gallium/auxiliary/trace/trace_drm.h
new file mode 100644
index 0000000000..892bd9860c
--- /dev/null
+++ b/src/gallium/auxiliary/trace/trace_drm.h
@@ -0,0 +1,165 @@
+/*
+ * Copyright 2009 Jakob Bornecrantz
+ * Corbin Simpson
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef TRACE_DRM_H
+#define TRACE_DRM_H
+
+#include "state_tracker/drm_api.h"
+
+#include "trace/tr_buffer.h"
+#include "trace/tr_context.h"
+#include "trace/tr_screen.h"
+#include "trace/tr_texture.h"
+
+struct drm_api hooks;
+
+static struct pipe_screen *
+trace_drm_create_screen(int fd, struct drm_create_screen_arg *arg)
+{
+ struct pipe_screen *screen;
+
+ if (arg && arg->mode != DRM_CREATE_NORMAL)
+ return NULL;
+
+ screen = hooks.create_screen(fd, arg);
+
+ return trace_screen_create(screen);
+};
+
+static struct pipe_context *
+trace_drm_create_context(struct pipe_screen *_screen)
+{
+ struct pipe_screen *screen;
+ struct pipe_context *pipe;
+
+ if (trace_enabled())
+ screen = trace_screen(_screen)->screen;
+ else
+ screen = _screen;
+
+ pipe = hooks.create_context(screen);
+
+ if (trace_enabled())
+ pipe = trace_context_create(_screen, pipe);
+
+ return pipe;
+};
+
+static boolean
+trace_drm_buffer_from_texture(struct pipe_texture *_texture,
+ struct pipe_buffer **_buffer,
+ unsigned *stride)
+{
+ struct pipe_texture *texture;
+ struct pipe_buffer *buffer = NULL;
+ boolean result;
+
+ if (trace_enabled())
+ texture = trace_texture(_texture)->texture;
+ else
+ texture = _texture;
+
+ result = hooks.buffer_from_texture(texture, &buffer, stride);
+
+ if (result && _buffer)
+ buffer = trace_buffer_create(trace_screen(texture->screen), buffer);
+
+ if (_buffer)
+ *_buffer = buffer;
+ else
+ pipe_buffer_reference(&buffer, NULL);
+
+ return result;
+}
+
+static struct pipe_buffer *
+trace_drm_buffer_from_handle(struct pipe_screen *_screen,
+ const char *name,
+ unsigned handle)
+{
+ struct pipe_screen *screen;
+ struct pipe_buffer *result;
+
+ if (trace_enabled())
+ screen = trace_screen(_screen)->screen;
+ else
+ screen = _screen;
+
+ result = hooks.buffer_from_handle(screen, name, handle);
+
+ if (trace_enabled())
+ result = trace_buffer_create(trace_screen(_screen), result);
+
+ return result;
+}
+
+static boolean
+trace_drm_handle_from_buffer(struct pipe_screen *_screen,
+ struct pipe_buffer *_buffer,
+ unsigned *handle)
+{
+ struct pipe_screen *screen;
+ struct pipe_buffer *buffer;
+
+ if (trace_enabled()) {
+ screen = trace_screen(_screen)->screen;
+ buffer = trace_buffer(_buffer)->buffer;
+ } else {
+ screen = _screen;
+ buffer = _buffer;
+ }
+
+ return hooks.handle_from_buffer(screen, buffer, handle);
+}
+
+static boolean
+trace_drm_global_handle_from_buffer(struct pipe_screen *_screen,
+ struct pipe_buffer *_buffer,
+ unsigned *handle)
+{
+ struct pipe_screen *screen;
+ struct pipe_buffer *buffer;
+
+ if (trace_enabled()) {
+ screen = trace_screen(_screen)->screen;
+ buffer = trace_buffer(_buffer)->buffer;
+ } else {
+ screen = _screen;
+ buffer = _buffer;
+ }
+
+ return hooks.global_handle_from_buffer(screen, buffer, handle);
+}
+
+struct drm_api drm_api_hooks =
+{
+ .create_screen = trace_drm_create_screen,
+ .create_context = trace_drm_create_context,
+
+ .buffer_from_texture = trace_drm_buffer_from_texture,
+ .buffer_from_handle = trace_drm_buffer_from_handle,
+ .handle_from_buffer = trace_drm_handle_from_buffer,
+ .global_handle_from_buffer = trace_drm_global_handle_from_buffer,
+};
+
+#endif /* TRACE_DRM_H */
diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm.c b/src/gallium/winsys/drm/radeon/core/radeon_drm.c
index 428d3f65a1..5406d2bbea 100644
--- a/src/gallium/winsys/drm/radeon/core/radeon_drm.c
+++ b/src/gallium/winsys/drm/radeon/core/radeon_drm.c
@@ -30,6 +30,10 @@
#include "radeon_drm.h"
+#ifdef DEBUG
+#include "trace/trace_drm.h"
+#endif
+
/* Create a pipe_screen. */
struct pipe_screen* radeon_create_screen(int drmFB,
struct drm_create_screen_arg *arg)
@@ -112,7 +116,11 @@ boolean radeon_global_handle_from_buffer(struct pipe_screen* screen,
return TRUE;
}
+#ifdef DEBUG
+struct drm_api hooks = {
+#else
struct drm_api drm_api_hooks = {
+#endif
.create_screen = radeon_create_screen,
.create_context = radeon_create_context,
/* XXX fix this */
diff --git a/src/gallium/winsys/drm/radeon/dri/Makefile b/src/gallium/winsys/drm/radeon/dri/Makefile
index c218ee9d01..a9889444de 100644
--- a/src/gallium/winsys/drm/radeon/dri/Makefile
+++ b/src/gallium/winsys/drm/radeon/dri/Makefile
@@ -10,6 +10,7 @@ PIPE_DRIVERS = \
$(TOP)/src/gallium/state_trackers/dri/libdridrm.a \
$(TOP)/src/gallium/winsys/drm/radeon/core/libradeonwinsys.a \
$(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
+ $(TOP)/src/gallium/drivers/trace/libtrace.a \
$(TOP)/src/gallium/drivers/r300/libr300.a
C_SOURCES = \
diff --git a/src/gallium/winsys/drm/radeon/egl/Makefile b/src/gallium/winsys/drm/radeon/egl/Makefile
index d989b3aa93..6a1448d1b9 100644
--- a/src/gallium/winsys/drm/radeon/egl/Makefile
+++ b/src/gallium/winsys/drm/radeon/egl/Makefile
@@ -8,6 +8,7 @@ PIPE_DRIVERS = \
$(TOP)/src/gallium/state_trackers/egl/libegldrm.a \
$(GALLIUMDIR)/winsys/drm/radeon/core/libradeonwinsys.a \
$(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
+ $(TOP)/src/gallium/drivers/trace/libtrace.a \
$(TOP)/src/gallium/drivers/r300/libr300.a
DRIVER_SOURCES =
--
cgit v1.2.3
From 0e8c6e56e467864249dfa311be1eef4dfc381f2a Mon Sep 17 00:00:00 2001
From: Corbin Simpson
Date: Sat, 16 May 2009 10:03:46 -0700
Subject: intel-gallium: Fix trace_drm integration.
Compile-tested only, sorry.
---
src/gallium/winsys/drm/intel/gem/intel_be_api.c | 149 +-----------------------
1 file changed, 5 insertions(+), 144 deletions(-)
diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_api.c b/src/gallium/winsys/drm/intel/gem/intel_be_api.c
index 5853afa756..a74be13bf7 100644
--- a/src/gallium/winsys/drm/intel/gem/intel_be_api.c
+++ b/src/gallium/winsys/drm/intel/gem/intel_be_api.c
@@ -2,10 +2,12 @@
#include "intel_be_api.h"
#include "i915simple/i915_winsys.h"
-#ifndef DEBUG
-struct drm_api drm_api_hooks =
+#ifdef DEBUG
+#include "trace/trace_drm.h"
+
+struct drm_api hooks =
#else
-static struct drm_api hooks =
+struct drm_api drm_api_hooks =
#endif
{
/* intel_be_context.c */
@@ -17,144 +19,3 @@ static struct drm_api hooks =
.handle_from_buffer = intel_be_handle_from_buffer,
.global_handle_from_buffer = intel_be_global_handle_from_buffer,
};
-
-
-/*
- * Trace integration
- */
-
-#ifdef DEBUG
-#include "trace/tr_screen.h"
-#include "trace/tr_texture.h"
-#include "trace/tr_buffer.h"
-#include "trace/tr_context.h"
-
-static struct pipe_screen *
-trace_drm_create_screen(int fd, struct drm_create_screen_arg *arg)
-{
- struct pipe_screen *screen;
-
- if (arg && arg->mode != DRM_CREATE_NORMAL)
- return NULL;
-
- screen = hooks.create_screen(fd, arg);
-
- return trace_screen_create(screen);
-};
-
-static struct pipe_context *
-trace_drm_create_context(struct pipe_screen *_screen)
-{
- struct pipe_screen *screen;
- struct pipe_context *pipe;
-
- if (trace_enabled())
- screen = trace_screen(_screen)->screen;
- else
- screen = _screen;
-
- pipe = hooks.create_context(screen);
-
- if (trace_enabled())
- pipe = trace_context_create(_screen, pipe);
-
- return pipe;
-};
-
-static boolean
-trace_drm_buffer_from_texture(struct pipe_texture *_texture,
- struct pipe_buffer **_buffer,
- unsigned *stride)
-{
- struct pipe_texture *texture;
- struct pipe_buffer *buffer = NULL;
- boolean result;
-
- if (trace_enabled())
- texture = trace_texture(_texture)->texture;
- else
- texture = _texture;
-
- result = hooks.buffer_from_texture(texture, &buffer, stride);
-
- if (result && _buffer)
- buffer = trace_buffer_create(trace_screen(texture->screen), buffer);
-
- if (_buffer)
- *_buffer = buffer;
- else
- pipe_buffer_reference(&buffer, NULL);
-
- return result;
-}
-
-static struct pipe_buffer *
-trace_drm_buffer_from_handle(struct pipe_screen *_screen,
- const char *name,
- unsigned handle)
-{
- struct pipe_screen *screen;
- struct pipe_buffer *result;
-
- if (trace_enabled())
- screen = trace_screen(_screen)->screen;
- else
- screen = _screen;
-
- result = hooks.buffer_from_handle(screen, name, handle);
-
- if (trace_enabled())
- result = trace_buffer_create(trace_screen(_screen), result);
-
- return result;
-}
-
-static boolean
-trace_drm_handle_from_buffer(struct pipe_screen *_screen,
- struct pipe_buffer *_buffer,
- unsigned *handle)
-{
- struct pipe_screen *screen;
- struct pipe_buffer *buffer;
-
- if (trace_enabled()) {
- screen = trace_screen(_screen)->screen;
- buffer = trace_buffer(_buffer)->buffer;
- } else {
- screen = _screen;
- buffer = _buffer;
- }
-
- return hooks.handle_from_buffer(screen, buffer, handle);
-}
-
-static boolean
-trace_drm_global_handle_from_buffer(struct pipe_screen *_screen,
- struct pipe_buffer *_buffer,
- unsigned *handle)
-{
- struct pipe_screen *screen;
- struct pipe_buffer *buffer;
-
- if (trace_enabled()) {
- screen = trace_screen(_screen)->screen;
- buffer = trace_buffer(_buffer)->buffer;
- } else {
- screen = _screen;
- buffer = _buffer;
- }
-
- return hooks.global_handle_from_buffer(screen, buffer, handle);
-}
-
-struct drm_api drm_api_hooks =
-{
- .create_screen = trace_drm_create_screen,
- .create_context = trace_drm_create_context,
-
- .buffer_from_texture = trace_drm_buffer_from_texture,
- .buffer_from_handle = trace_drm_buffer_from_handle,
- .handle_from_buffer = trace_drm_handle_from_buffer,
- .global_handle_from_buffer = trace_drm_global_handle_from_buffer,
-};
-#endif
--
cgit v1.2.3
From 13f8e7bc9c5b4a7de0fe4f53af2eb6237b3e71fd Mon Sep 17 00:00:00 2001
From: Corbin Simpson
Date: Sat, 16 May 2009 10:46:55 -0700
Subject: r300-gallium: Update screen caps.
Anisotropic filtering should work, and OQ is broken.
---
src/gallium/drivers/r300/r300_screen.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index d2c5998c26..78ed2ad922 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -87,7 +87,6 @@ static int r300_get_param(struct pipe_screen* pscreen, int param)
} else {
return 0;
}
- return 0;
case PIPE_CAP_GLSL:
/* IN THEORY */
return 0;
@@ -95,15 +94,15 @@ static int r300_get_param(struct pipe_screen* pscreen, int param)
/* IN THEORY */
return 0;
case PIPE_CAP_ANISOTROPIC_FILTER:
- /* IN THEORY */
- return 0;
+ return 1;
case PIPE_CAP_POINT_SPRITE:
/* IN THEORY */
return 0;
case PIPE_CAP_MAX_RENDER_TARGETS:
return 4;
case PIPE_CAP_OCCLUSION_QUERY:
- return 1;
+ /* IN THEORY */
+ return 0;
case PIPE_CAP_TEXTURE_SHADOW_MAP:
/* IN THEORY */
return 0;
--
cgit v1.2.3
From 17b395638b92139feef9beaea4039f76710bb23a Mon Sep 17 00:00:00 2001
From: Corbin Simpson
Date: Sat, 16 May 2009 10:56:17 -0700
Subject: r300-gallium: Update floating-point params too.
Even though we *can* render 10,000-pixel-wide lines, let's not advertise it.
---
src/gallium/drivers/r300/r300_screen.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index 78ed2ad922..ab095028fb 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -151,17 +151,20 @@ static int r300_get_param(struct pipe_screen* pscreen, int param)
static float r300_get_paramf(struct pipe_screen* pscreen, int param)
{
+ struct r300_screen* r300screen = r300_screen(pscreen);
+
switch (param) {
case PIPE_CAP_MAX_LINE_WIDTH:
case PIPE_CAP_MAX_LINE_WIDTH_AA:
- /* XXX this is the biggest thing that will fit in that register.
- * Perhaps the actual rendering limits are less? */
- return 10922.0f;
case PIPE_CAP_MAX_POINT_WIDTH:
case PIPE_CAP_MAX_POINT_WIDTH_AA:
- /* XXX this is the biggest thing that will fit in that register.
- * Perhaps the actual rendering limits are less? */
- return 10922.0f;
+ /* The maximum dimensions of the colorbuffer are our practical
+ * rendering limits. 2048 pixels should be enough for anybody. */
+ if (r300screen->caps->is_r500) {
+ return 4096.0f;
+ } else {
+ return 2048.0f;
+ }
case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
return 16.0f;
case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
--
cgit v1.2.3
From 08ec7e0d329a72433b427e8167b2c3442d1f53b4 Mon Sep 17 00:00:00 2001
From: Corbin Simpson
Date: Sat, 16 May 2009 11:17:05 -0700
Subject: r300-gallium: Die on bad texture formats.
Odds are good that we'll die later anyway, so we might as well do it before
we start dancing on random memory.
---
src/gallium/drivers/r300/r300_screen.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index ab095028fb..6fe724cc92 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -232,9 +232,16 @@ static boolean r300_is_format_supported(struct pipe_screen* pscreen,
case PIPE_TEXTURE_2D:
return check_tex_2d_format(format,
r300_screen(pscreen)->caps->is_r500);
+ case PIPE_TEXTURE_1D:
+ case PIPE_TEXTURE_3D:
+ case PIPE_TEXTURE_CUBE:
+ debug_printf("r300: Implementation error: Unsupported format "
+ "target: %d\n", target);
+ break;
default:
- debug_printf("r300: Warning: Got unknown format target: %d\n",
- format);
+ debug_printf("r300: Fatal: This is not a format target: %d\n",
+ target);
+ assert(0);
break;
}
--
cgit v1.2.3
From 764bf9501adea0f3dbe8d7c718b22dfb067fbbfa Mon Sep 17 00:00:00 2001
From: Corbin Simpson
Date: Sun, 17 May 2009 09:39:06 -0700
Subject: r300-gallium: vs: Dupe tokens, better debug, count spurious insts.
---
src/gallium/drivers/r300/r300_debug.c | 10 ++++++----
src/gallium/drivers/r300/r300_state.c | 2 ++
src/gallium/drivers/r300/r300_state_tcl.c | 17 +++++++++++++++--
3 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_debug.c b/src/gallium/drivers/r300/r300_debug.c
index 1ff72172eb..ffc93eb591 100644
--- a/src/gallium/drivers/r300/r300_debug.c
+++ b/src/gallium/drivers/r300/r300_debug.c
@@ -152,10 +152,12 @@ void r500_fs_dump(struct r500_fragment_shader* fs)
static void r300_vs_op_dump(uint32_t op)
{
- if (op & 0x81) {
- debug_printf("PVS_MACRO_OP_2CLK_M2X_ADD\n");
- } else if (op & 0x80) {
- debug_printf(" PVS_MACRO_OP_2CLK_MADD\n");
+ if (op & 0x80) {
+ if (op & 0x1) {
+ debug_printf("PVS_MACRO_OP_2CLK_M2X_ADD\n");
+ } else {
+ debug_printf(" PVS_MACRO_OP_2CLK_MADD\n");
+ }
} else if (op & 0x40) {
debug_printf("%s\n", r300_vs_me_ops[op & 0x1f]);
} else {
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index 49b93a420b..0ae118dbb9 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -634,6 +634,7 @@ static void* r300_create_vs_state(struct pipe_context* pipe,
struct r300_vertex_shader* vs = CALLOC_STRUCT(r300_vertex_shader);
/* Copy state directly into shader. */
vs->state = *shader;
+ vs->state.tokens = tgsi_dup_tokens(shader->tokens);
tgsi_scan_shader(shader->tokens, &vs->info);
@@ -679,6 +680,7 @@ static void r300_delete_vs_state(struct pipe_context* pipe, void* shader)
struct r300_vertex_shader* vs = (struct r300_vertex_shader*)shader;
draw_delete_vertex_shader(r300->draw, vs->draw);
+ FREE(vs->state.tokens);
FREE(shader);
} else {
draw_delete_vertex_shader(r300->draw,
diff --git a/src/gallium/drivers/r300/r300_state_tcl.c b/src/gallium/drivers/r300/r300_state_tcl.c
index ed9164db49..8b7a2ec5e9 100644
--- a/src/gallium/drivers/r300/r300_state_tcl.c
+++ b/src/gallium/drivers/r300/r300_state_tcl.c
@@ -334,6 +334,8 @@ void r300_translate_vertex_shader(struct r300_context* r300,
int i;
struct r300_constant_buffer* consts =
&r300->shader_constants[PIPE_SHADER_VERTEX];
+ boolean end = FALSE;
+ int spurious = 0;
struct r300_vs_asm* assembler = CALLOC_STRUCT(r300_vs_asm);
if (assembler == NULL) {
@@ -373,8 +375,16 @@ void r300_translate_vertex_shader(struct r300_context* r300,
assembler->imm_count++;
break;
case TGSI_TOKEN_TYPE_INSTRUCTION:
- r300_vs_instruction(vs, assembler,
- &parser.FullToken.FullInstruction);
+ if (parser.FullToken.FullInstruction.Instruction.Opcode ==
+ TGSI_OPCODE_END) {
+ end = TRUE;
+ }
+ if (end) {
+ spurious++;
+ } else {
+ r300_vs_instruction(vs, assembler,
+ &parser.FullToken.FullInstruction);
+ }
break;
}
}
@@ -391,6 +401,9 @@ void r300_translate_vertex_shader(struct r300_context* r300,
debug_printf("r300: vs: tab: %d %d %d %d\n", assembler->tab[0],
assembler->tab[1], assembler->tab[2], assembler->tab[3]);
+ debug_printf("r300: vs: %d spurious instructions following END\n",
+ spurious - 1);
+
tgsi_dump(vs->state.tokens);
/* XXX finish r300 vertex shader dumper */
r300_vs_dump(vs);
--
cgit v1.2.3
From 7e97219ff8adce22d30abeda53144f7193589c30 Mon Sep 17 00:00:00 2001
From: Corbin Simpson
Date: Sun, 17 May 2009 09:44:14 -0700
Subject: r300-gallium: Comment out useless debugging code.
Those parts are nearly solid compared to the shaders.
---
src/gallium/drivers/r300/r300_emit.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index 3beb1b8c3f..b7d1cf8a92 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -236,7 +236,7 @@ void r300_emit_rs_block_state(struct r300_context* r300,
}
for (i = 0; i < 8; i++) {
OUT_CS(rs->ip[i]);
- debug_printf("ip %d: 0x%08x\n", i, rs->ip[i]);
+ /* debug_printf("ip %d: 0x%08x\n", i, rs->ip[i]); */
}
OUT_CS_REG_SEQ(R300_RS_COUNT, 2);
@@ -250,11 +250,11 @@ void r300_emit_rs_block_state(struct r300_context* r300,
}
for (i = 0; i < 8; i++) {
OUT_CS(rs->inst[i]);
- debug_printf("inst %d: 0x%08x\n", i, rs->inst[i]);
+ /* debug_printf("inst %d: 0x%08x\n", i, rs->inst[i]); */
}
- debug_printf("count: 0x%08x inst_count: 0x%08x\n", rs->count,
- rs->inst_count);
+ /* debug_printf("count: 0x%08x inst_count: 0x%08x\n", rs->count,
+ * rs->inst_count); */
END_CS;
}
@@ -336,22 +336,22 @@ void r300_emit_vertex_format_state(struct r300_context* r300)
OUT_CS_REG_SEQ(R300_VAP_OUTPUT_VTX_FMT_0, 2);
OUT_CS(r300->vertex_info.vinfo.hwfmt[2]);
OUT_CS(r300->vertex_info.vinfo.hwfmt[3]);
- for (i = 0; i < 4; i++) {
- debug_printf("hwfmt%d: 0x%08x\n", i,
- r300->vertex_info.vinfo.hwfmt[i]);
- }
+ /* for (i = 0; i < 4; i++) {
+ * debug_printf("hwfmt%d: 0x%08x\n", i,
+ * r300->vertex_info.vinfo.hwfmt[i]);
+ * } */
OUT_CS_REG_SEQ(R300_VAP_PROG_STREAM_CNTL_0, 8);
for (i = 0; i < 8; i++) {
OUT_CS(r300->vertex_info.vap_prog_stream_cntl[i]);
- debug_printf("prog_stream_cntl%d: 0x%08x\n", i,
- r300->vertex_info.vap_prog_stream_cntl[i]);
+ /* debug_printf("prog_stream_cntl%d: 0x%08x\n", i,
+ * r300->vertex_info.vap_prog_stream_cntl[i]); */
}
OUT_CS_REG_SEQ(R300_VAP_PROG_STREAM_CNTL_EXT_0, 8);
for (i = 0; i < 8; i++) {
OUT_CS(r300->vertex_info.vap_prog_stream_cntl_ext[i]);
- debug_printf("prog_stream_cntl_ext%d: 0x%08x\n", i,
- r300->vertex_info.vap_prog_stream_cntl_ext[i]);
+ /* debug_printf("prog_stream_cntl_ext%d: 0x%08x\n", i,
+ * r300->vertex_info.vap_prog_stream_cntl_ext[i]); */
}
END_CS;
}
--
cgit v1.2.3
From 8dae8f28e52ed20b087ecf0d09efe2d94bdd09cf Mon Sep 17 00:00:00 2001
From: Corbin Simpson
Date: Sun, 17 May 2009 10:30:59 -0700
Subject: r300-gallium: r500-fs: Enable depth writes, kinda.
Should work, but doesn't. Hm.
---
src/gallium/drivers/r300/r300_state_shader.c | 29 ++++++++++++++++++++++++----
src/gallium/drivers/r300/r300_state_shader.h | 6 ++++++
2 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_state_shader.c b/src/gallium/drivers/r300/r300_state_shader.c
index 1b02239ee7..7257638dbe 100644
--- a/src/gallium/drivers/r300/r300_state_shader.c
+++ b/src/gallium/drivers/r300/r300_state_shader.c
@@ -59,6 +59,12 @@ static void r300_fs_declare(struct r300_fs_asm* assembler,
}
break;
case TGSI_FILE_OUTPUT:
+ /* Depth write. Mark the position of the output so we can
+ * identify it later. */
+ if (decl->Semantic.SemanticName == TGSI_SEMANTIC_POSITION) {
+ assembler->depth_output = decl->DeclarationRange.First;
+ }
+ break;
case TGSI_FILE_CONSTANT:
break;
case TGSI_FILE_TEMPORARY:
@@ -120,6 +126,14 @@ static INLINE unsigned r300_fs_dst(struct r300_fs_asm* assembler,
return 0;
}
+static INLINE boolean r300_fs_is_depr(struct r300_fs_asm* assembler,
+ struct tgsi_dst_register* dst)
+{
+ return (assembler->writes_depth &&
+ (dst->File == TGSI_FILE_OUTPUT) &&
+ (dst->Index == assembler->depth_output));
+}
+
static INLINE unsigned r500_fix_swiz(unsigned s)
{
/* For historical reasons, the swizzle values x, y, z, w, and 0 are
@@ -302,16 +316,21 @@ static INLINE void r500_emit_alu(struct r500_fragment_shader* fs,
int i = fs->instruction_count;
if (dst->DstRegister.File == TGSI_FILE_OUTPUT) {
- fs->instructions[i].inst0 = R500_INST_TYPE_OUT |
- R500_ALU_OMASK(dst->DstRegister.WriteMask);
+ fs->instructions[i].inst0 = R500_INST_TYPE_OUT;
+ if (r300_fs_is_depr(assembler, dst)) {
+ fs->instructions[i].inst4 = R500_W_OMASK;
+ } else {
+ fs->instructions[i].inst0 |=
+ R500_ALU_OMASK(dst->DstRegister.WriteMask);
+ }
} else {
fs->instructions[i].inst0 = R500_INST_TYPE_ALU |
- R500_ALU_WMASK(dst->DstRegister.WriteMask);
+ R500_ALU_WMASK(dst->DstRegister.WriteMask);
}
fs->instructions[i].inst0 |= R500_INST_TEX_SEM_WAIT;
- fs->instructions[i].inst4 =
+ fs->instructions[i].inst4 |=
R500_ALPHA_ADDRD(r300_fs_dst(assembler, &dst->DstRegister));
fs->instructions[i].inst5 =
R500_ALU_RGBA_ADDRD(r300_fs_dst(assembler, &dst->DstRegister));
@@ -581,6 +600,8 @@ void r300_translate_fragment_shader(struct r300_context* r300,
}
/* Setup starting offset for immediates. */
assembler->imm_offset = consts->user_count;
+ /* Enable depth writes, if needed. */
+ assembler->writes_depth = fs->info.writes_z;
/* Make sure we start at the beginning of the shader. */
if (is_r500) {
diff --git a/src/gallium/drivers/r300/r300_state_shader.h b/src/gallium/drivers/r300/r300_state_shader.h
index 185fdd90f0..f4fb31d86c 100644
--- a/src/gallium/drivers/r300/r300_state_shader.h
+++ b/src/gallium/drivers/r300/r300_state_shader.h
@@ -57,6 +57,7 @@
#define R500_TEX_WMASK(x) ((x) << 11)
#define R500_ALU_WMASK(x) ((x) << 11)
#define R500_ALU_OMASK(x) ((x) << 15)
+#define R500_W_OMASK (1 << 31)
/* TGSI constants. TGSI is like XML: If it can't solve your problems, you're
* not using enough of it. */
@@ -99,6 +100,11 @@ struct r300_fs_asm {
unsigned imm_offset;
/* Number of immediate constants. */
unsigned imm_count;
+ /* Are depth writes enabled? */
+ boolean writes_depth;
+ /* Depth write offset. This is the TGSI output that corresponds to
+ * depth writes. */
+ unsigned depth_output;
};
void r300_translate_fragment_shader(struct r300_context* r300,
--
cgit v1.2.3
From 45435abcb967931c79aba1714ae797a1c5dc075e Mon Sep 17 00:00:00 2001
From: Corbin Simpson
Date: Sun, 17 May 2009 10:33:56 -0700
Subject: r300-gallium: vs: Fix vert shader init.
Makes the last three commits suck much less. :3
---
src/gallium/drivers/r300/r300_state_tcl.c | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_state_tcl.c b/src/gallium/drivers/r300/r300_state_tcl.c
index 8b7a2ec5e9..fdbcbf3db8 100644
--- a/src/gallium/drivers/r300/r300_state_tcl.c
+++ b/src/gallium/drivers/r300/r300_state_tcl.c
@@ -325,6 +325,8 @@ static void r300_vs_init(struct r300_vertex_shader* vs,
break;
}
}
+
+ vs->instruction_count = 0;
}
void r300_translate_vertex_shader(struct r300_context* r300,
@@ -334,8 +336,6 @@ void r300_translate_vertex_shader(struct r300_context* r300,
int i;
struct r300_constant_buffer* consts =
&r300->shader_constants[PIPE_SHADER_VERTEX];
- boolean end = FALSE;
- int spurious = 0;
struct r300_vs_asm* assembler = CALLOC_STRUCT(r300_vs_asm);
if (assembler == NULL) {
@@ -375,16 +375,8 @@ void r300_translate_vertex_shader(struct r300_context* r300,
assembler->imm_count++;
break;
case TGSI_TOKEN_TYPE_INSTRUCTION:
- if (parser.FullToken.FullInstruction.Instruction.Opcode ==
- TGSI_OPCODE_END) {
- end = TRUE;
- }
- if (end) {
- spurious++;
- } else {
- r300_vs_instruction(vs, assembler,
- &parser.FullToken.FullInstruction);
- }
+ r300_vs_instruction(vs, assembler,
+ &parser.FullToken.FullInstruction);
break;
}
}
@@ -401,9 +393,6 @@ void r300_translate_vertex_shader(struct r300_context* r300,
debug_printf("r300: vs: tab: %d %d %d %d\n", assembler->tab[0],
assembler->tab[1], assembler->tab[2], assembler->tab[3]);
- debug_printf("r300: vs: %d spurious instructions following END\n",
- spurious - 1);
-
tgsi_dump(vs->state.tokens);
/* XXX finish r300 vertex shader dumper */
r300_vs_dump(vs);
--
cgit v1.2.3
From fbcfcd9f5ce7523bde69103fcf1ebae30531a10c Mon Sep 17 00:00:00 2001
From: Corbin Simpson
Date: Sun, 17 May 2009 11:58:53 -0700
Subject: r300-gallium: Correct default MSPOS.
Per agd5f.
---
src/gallium/drivers/r300/r300_state_invariant.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_state_invariant.c b/src/gallium/drivers/r300/r300_state_invariant.c
index 8bd9b41bd7..3e1580c595 100644
--- a/src/gallium/drivers/r300/r300_state_invariant.c
+++ b/src/gallium/drivers/r300/r300_state_invariant.c
@@ -40,8 +40,8 @@ void r300_emit_invariant_state(struct r300_context* r300)
/* Various GB enables */
OUT_CS_REG(R300_GB_ENABLE, 0x0);
/* Subpixel multisampling for AA */
- OUT_CS_REG(R300_GB_MSPOS0, 0x66666666);
- OUT_CS_REG(R300_GB_MSPOS1, 0x66666666);
+ OUT_CS_REG(R300_GB_MSPOS0, 0x6666666);
+ OUT_CS_REG(R300_GB_MSPOS1, 0x6666666);
/* GB tile config and pipe setup */
OUT_CS_REG(R300_GB_TILE_CONFIG, R300_GB_TILE_DISABLE |
r300_translate_gb_pipes(caps->num_frag_pipes));
--
cgit v1.2.3
From e5f5390f4bcb0fb04dff11cd1333b426cba6d0d1 Mon Sep 17 00:00:00 2001
From: Corbin Simpson
Date: Sun, 17 May 2009 12:51:18 -0700
Subject: r300-gallium: Update XXX.
Lops work fine as long as HW TCL is off. (I think I know why.)
---
src/gallium/drivers/r300/r300_state.c | 7 +++----
src/gallium/drivers/r300/r300_state_shader.h | 16 ----------------
2 files changed, 3 insertions(+), 20 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index 0ae118dbb9..e818a77699 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -62,8 +62,6 @@ static void* r300_create_blend_state(struct pipe_context* pipe,
}
/* PIPE_LOGICOP_* don't need to be translated, fortunately. */
- /* XXX are logicops still allowed if blending's disabled?
- * Does Gallium take care of it for us? */
if (state->logicop_enable) {
blend->rop = R300_RB3D_ROPCNTL_ROP_ENABLE |
(state->logicop_func) << R300_RB3D_ROPCNTL_ROP_SHIFT;
@@ -121,7 +119,7 @@ static void r300_set_clip_state(struct pipe_context* pipe,
const struct pipe_clip_state* state)
{
struct r300_context* r300 = r300_context(pipe);
- /* XXX Draw */
+ /* XXX add HW TCL clipping setup */
draw_flush(r300->draw);
draw_set_clip_state(r300->draw, state);
}
@@ -257,6 +255,7 @@ static void r300_set_edgeflags(struct pipe_context* pipe,
const unsigned* bitfield)
{
/* XXX you know it's bad when i915 has this blank too */
+ /* XXX and even worse, I have no idea WTF the bitfield is */
}
static void
@@ -326,7 +325,7 @@ static void r300_delete_fs_state(struct pipe_context* pipe, void* shader)
static void r300_set_polygon_stipple(struct pipe_context* pipe,
const struct pipe_poly_stipple* state)
{
- /* XXX */
+ /* XXX no idea how to set this up, but not terribly important */
}
/* Create a new rasterizer state based on the CSO rasterizer state.
diff --git a/src/gallium/drivers/r300/r300_state_shader.h b/src/gallium/drivers/r300/r300_state_shader.h
index f4fb31d86c..06260e61fe 100644
--- a/src/gallium/drivers/r300/r300_state_shader.h
+++ b/src/gallium/drivers/r300/r300_state_shader.h
@@ -111,14 +111,6 @@ void r300_translate_fragment_shader(struct r300_context* r300,
struct r3xx_fragment_shader* fs);
static struct r300_fragment_shader r300_passthrough_fragment_shader = {
- /* XXX This is the emission code. TODO: decode
- OUT_CS_REG(R300_US_CONFIG, 0);
- OUT_CS_REG(R300_US_CODE_OFFSET, 0x0);
- OUT_CS_REG(R300_US_CODE_ADDR_0, 0x0);
- OUT_CS_REG(R300_US_CODE_ADDR_1, 0x0);
- OUT_CS_REG(R300_US_CODE_ADDR_2, 0x0);
- OUT_CS_REG(R300_US_CODE_ADDR_3, 0x400000);
-*/
.alu_instruction_count = 1,
.tex_instruction_count = 0,
.indirections = 0,
@@ -165,14 +157,6 @@ static struct r500_fragment_shader r500_passthrough_fragment_shader = {
};
static struct r300_fragment_shader r300_texture_fragment_shader = {
- /* XXX This is the emission code. TODO: decode
- OUT_CS_REG(R300_US_CONFIG, 0);
- OUT_CS_REG(R300_US_CODE_OFFSET, 0x0);
- OUT_CS_REG(R300_US_CODE_ADDR_0, 0x0);
- OUT_CS_REG(R300_US_CODE_ADDR_1, 0x0);
- OUT_CS_REG(R300_US_CODE_ADDR_2, 0x0);
- OUT_CS_REG(R300_US_CODE_ADDR_3, 0x400000);
-*/
.alu_instruction_count = 1,
.tex_instruction_count = 0,
.indirections = 0,
--
cgit v1.2.3
From 60665ae6277f15a1b5e48b65ba7d94cea2535c2c Mon Sep 17 00:00:00 2001
From: Corbin Simpson
Date: Sun, 17 May 2009 13:23:39 -0700
Subject: r300-gallium: Clean up more invariant state.
GA_ENHANCE is now the kernel's problem.
---
src/gallium/drivers/r300/r300_state_invariant.c | 27 +++++++------------------
src/gallium/drivers/r300/r300_surface.c | 10 +++++----
2 files changed, 13 insertions(+), 24 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_state_invariant.c b/src/gallium/drivers/r300/r300_state_invariant.c
index 3e1580c595..0acbcbff7f 100644
--- a/src/gallium/drivers/r300/r300_state_invariant.c
+++ b/src/gallium/drivers/r300/r300_state_invariant.c
@@ -34,7 +34,7 @@ void r300_emit_invariant_state(struct r300_context* r300)
struct r300_capabilities* caps = r300_screen(r300->context.screen)->caps;
CS_LOCALS(r300);
- BEGIN_CS(30 + (caps->has_tcl ? 2: 0));
+ BEGIN_CS(28 + (caps->has_tcl ? 2: 0));
/*** Graphics Backend (GB) ***/
/* Various GB enables */
@@ -50,20 +50,6 @@ void r300_emit_invariant_state(struct r300_context* r300)
/* AA enable */
OUT_CS_REG(R300_GB_AA_CONFIG, 0x0);
- /*** Geometry Assembly (GA) ***/
- /* GA errata fixes. */
- if (caps->is_r500) {
- OUT_CS_REG(R300_GA_ENHANCE,
- R300_GA_ENHANCE_DEADLOCK_CNTL_PREVENT_TCL |
- R300_GA_ENHANCE_FASTSYNC_CNTL_ENABLE |
- R500_GA_ENHANCE_REG_READWRITE_ENABLE |
- R500_GA_ENHANCE_REG_NOSTALL_ENABLE);
- } else {
- OUT_CS_REG(R300_GA_ENHANCE,
- R300_GA_ENHANCE_DEADLOCK_CNTL_PREVENT_TCL |
- R300_GA_ENHANCE_FASTSYNC_CNTL_ENABLE);
- }
-
/*** Fog (FG) ***/
OUT_CS_REG(R300_FG_FOG_BLEND, 0x0);
OUT_CS_REG(R300_FG_FOG_COLOR_R, 0x0);
@@ -86,7 +72,7 @@ void r300_emit_invariant_state(struct r300_context* r300)
END_CS;
/* XXX unsorted stuff from surface_fill */
- BEGIN_CS(79 + (caps->has_tcl ? 7 : 0));
+ BEGIN_CS(77 + (caps->has_tcl ? 7 : 0));
/* Flush PVS. */
OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0);
@@ -113,11 +99,14 @@ void r300_emit_invariant_state(struct r300_context* r300)
OUT_CS_32F(0.0);
OUT_CS_REG_SEQ(R300_GA_POINT_S1, 1);
OUT_CS_32F(1.0);
+ /* XXX line tex stuffing */
+ OUT_CS_REG_SEQ(R300_GA_LINE_S0, 1);
+ OUT_CS_32F(0.0);
+ OUT_CS_REG_SEQ(R300_GA_LINE_S1, 1);
+ OUT_CS_32F(1.0);
OUT_CS_REG(R300_GA_TRIANGLE_STIPPLE, 0x5 |
(0x5 << R300_GA_TRIANGLE_STIPPLE_Y_SHIFT_SHIFT));
/* XXX this big chunk should be refactored into rs_state */
- OUT_CS_REG(R300_GA_LINE_S0, 0x00000000);
- OUT_CS_REG(R300_GA_LINE_S1, 0x3F800000);
OUT_CS_REG(R300_GA_SOLID_RG, 0x00000000);
OUT_CS_REG(R300_GA_SOLID_BA, 0x00000000);
OUT_CS_REG(R300_GA_POLY_MODE, 0x00000000);
@@ -144,8 +133,6 @@ void r300_emit_invariant_state(struct r300_context* r300)
OUT_CS_REG(R300_VAP_VTX_STATE_CNTL, 0x1);
OUT_CS_REG(R300_VAP_VSM_VTX_ASSM, 0x405);
OUT_CS_REG(R300_SE_VTE_CNTL, 0x0000043F);
- /* Vertex size. */
- OUT_CS_REG(R300_VAP_VTX_SIZE, 0x8);
/* XXX */
OUT_CS_REG(R300_SC_CLIP_RULE, 0xaaaa);
diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c
index 17b42504d4..ceaafe11d5 100644
--- a/src/gallium/drivers/r300/r300_surface.c
+++ b/src/gallium/drivers/r300/r300_surface.c
@@ -179,6 +179,9 @@ static void r300_surface_fill(struct pipe_context* pipe,
((h * 6) & R300_POINTSIZE_Y_MASK) |
((w * 6) << R300_POINTSIZE_X_SHIFT));
+ /* Vertex size. */
+ OUT_CS_REG(R300_VAP_VTX_SIZE, 0x8);
+
/* Packet3 with our point vertex */
OUT_CS_PKT3(R200_3D_DRAW_IMMD_2, 8);
OUT_CS(R300_PRIM_TYPE_POINT | R300_PRIM_WALK_RING |
@@ -194,11 +197,7 @@ static void r300_surface_fill(struct pipe_context* pipe,
OUT_CS_32F(b);
OUT_CS_32F(a);
- /* XXX figure out why this is 0xA and not 0x2 */
OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT, 0xA);
- /* XXX OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT,
- R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE |
- R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE); */
END_CS;
@@ -287,6 +286,9 @@ static void r300_surface_copy(struct pipe_context* pipe,
/* Two components of texture 0 */
OUT_CS_REG(R300_VAP_OUTPUT_VTX_FMT_1, 0x2);
+ /* Vertex size. */
+ OUT_CS_REG(R300_VAP_VTX_SIZE, 0x8);
+
/* Packet3 with our texcoords */
OUT_CS_PKT3(R200_3D_DRAW_IMMD_2, 16);
OUT_CS(R300_PRIM_TYPE_QUADS | R300_PRIM_WALK_RING |
--
cgit v1.2.3
From d6e085bd76ad8e6cfb67c317dc1b32b04434a8b5 Mon Sep 17 00:00:00 2001
From: Corbin Simpson
Date: Sun, 17 May 2009 16:42:54 -0700
Subject: r300-gallium: Don't set GB_TILE_CONFIG (in userspace.)
This accompanies kernel patches that make GB_TILE_CONFIG's various members
completely controlled in DRM.
GB_TILE_CONFIG has the following controls:
- The number of GB (pixel) pipes enabled
- The size and style of tiling
- Subpixel precision (either 1/12 or 1/16)
Per airlied and glisse, userspace and kernel will now agree (always) on
a subpixel precision of 1/12, and tiling will always be kernel-controlled.
---
src/gallium/drivers/r300/r300_state_invariant.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_state_invariant.c b/src/gallium/drivers/r300/r300_state_invariant.c
index 0acbcbff7f..d74928ceca 100644
--- a/src/gallium/drivers/r300/r300_state_invariant.c
+++ b/src/gallium/drivers/r300/r300_state_invariant.c
@@ -34,7 +34,7 @@ void r300_emit_invariant_state(struct r300_context* r300)
struct r300_capabilities* caps = r300_screen(r300->context.screen)->caps;
CS_LOCALS(r300);
- BEGIN_CS(28 + (caps->has_tcl ? 2: 0));
+ BEGIN_CS(26 + (caps->has_tcl ? 2: 0));
/*** Graphics Backend (GB) ***/
/* Various GB enables */
@@ -42,9 +42,6 @@ void r300_emit_invariant_state(struct r300_context* r300)
/* Subpixel multisampling for AA */
OUT_CS_REG(R300_GB_MSPOS0, 0x6666666);
OUT_CS_REG(R300_GB_MSPOS1, 0x6666666);
- /* GB tile config and pipe setup */
- OUT_CS_REG(R300_GB_TILE_CONFIG, R300_GB_TILE_DISABLE |
- r300_translate_gb_pipes(caps->num_frag_pipes));
/* Source of fog depth */
OUT_CS_REG(R300_GB_SELECT, R300_GB_FOG_SELECT_1_1_W);
/* AA enable */
--
cgit v1.2.3
From 6a40d1e9d96f8e8c57bc3bbd6f567cacd4471f59 Mon Sep 17 00:00:00 2001
From: Corbin Simpson
Date: Sun, 17 May 2009 17:03:15 -0700
Subject: r300-gallium, radeon-gallium: Nuke gb_pipes from orbit.
See the previous commit for an explanation. This is just all the support code
for GB_TILE_CONFIG.
---
src/gallium/drivers/r300/r300_chipset.c | 1 -
src/gallium/drivers/r300/r300_chipset.h | 2 --
src/gallium/drivers/r300/r300_screen.c | 1 -
src/gallium/drivers/r300/r300_state_inlines.h | 19 -------------------
src/gallium/drivers/r300/r300_winsys.h | 3 ---
src/gallium/winsys/drm/radeon/core/radeon_r300.c | 22 ++--------------------
src/gallium/winsys/drm/radeon/core/radeon_r300.h | 3 ---
7 files changed, 2 insertions(+), 49 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_chipset.c b/src/gallium/drivers/r300/r300_chipset.c
index db09f27bfa..758f706c51 100644
--- a/src/gallium/drivers/r300/r300_chipset.c
+++ b/src/gallium/drivers/r300/r300_chipset.c
@@ -34,7 +34,6 @@ void r300_parse_chipset(struct r300_capabilities* caps)
caps->is_r500 = FALSE;
caps->num_vert_fpus = 4;
-
/* Note: These are not ordered by PCI ID. I leave that task to GCC,
* which will perform the ordering while collating jump tables. Instead,
* I've tried to group them according to capabilities and age. */
diff --git a/src/gallium/drivers/r300/r300_chipset.h b/src/gallium/drivers/r300/r300_chipset.h
index 21eebeae60..5b2e1f0568 100644
--- a/src/gallium/drivers/r300/r300_chipset.h
+++ b/src/gallium/drivers/r300/r300_chipset.h
@@ -34,8 +34,6 @@ struct r300_capabilities {
int family;
/* The number of vertex floating-point units */
int num_vert_fpus;
- /* The number of fragment pipes */
- int num_frag_pipes;
/* Whether or not TCL is physically present */
boolean has_tcl;
/* Whether or not this is an RV515 or newer; R500s have many differences
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index 6fe724cc92..04d6db81b0 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -346,7 +346,6 @@ struct pipe_screen* r300_create_screen(struct r300_winsys* r300_winsys)
return NULL;
caps->pci_id = r300_winsys->pci_id;
- caps->num_frag_pipes = r300_winsys->gb_pipes;
r300_parse_chipset(caps);
diff --git a/src/gallium/drivers/r300/r300_state_inlines.h b/src/gallium/drivers/r300/r300_state_inlines.h
index 91b93fc367..22c8e199ae 100644
--- a/src/gallium/drivers/r300/r300_state_inlines.h
+++ b/src/gallium/drivers/r300/r300_state_inlines.h
@@ -353,25 +353,6 @@ static INLINE uint32_t r300_translate_out_fmt(enum pipe_format format)
/* Non-CSO state. (For now.) */
-static INLINE uint32_t r300_translate_gb_pipes(int pipe_count)
-{
- switch (pipe_count) {
- case 1:
- return R300_GB_TILE_PIPE_COUNT_RV300;
- break;
- case 2:
- return R300_GB_TILE_PIPE_COUNT_R300;
- break;
- case 3:
- return R300_GB_TILE_PIPE_COUNT_R420_3P;
- break;
- case 4:
- return R300_GB_TILE_PIPE_COUNT_R420;
- break;
- }
- return 0;
-}
-
static INLINE uint32_t translate_vertex_data_type(int type) {
switch (type) {
case EMIT_1F:
diff --git a/src/gallium/drivers/r300/r300_winsys.h b/src/gallium/drivers/r300/r300_winsys.h
index a833bb0399..a5ced8041c 100644
--- a/src/gallium/drivers/r300/r300_winsys.h
+++ b/src/gallium/drivers/r300/r300_winsys.h
@@ -45,9 +45,6 @@ struct r300_winsys {
/* PCI ID */
uint32_t pci_id;
- /* GB pipe count */
- uint32_t gb_pipes;
-
/* GART size. */
uint32_t gart_size;
diff --git a/src/gallium/winsys/drm/radeon/core/radeon_r300.c b/src/gallium/winsys/drm/radeon/core/radeon_r300.c
index 56b0d00842..d257e01693 100644
--- a/src/gallium/winsys/drm/radeon/core/radeon_r300.c
+++ b/src/gallium/winsys/drm/radeon/core/radeon_r300.c
@@ -161,25 +161,7 @@ static void do_ioctls(struct r300_winsys* winsys, int fd)
info.value = ⌖
gp.value = ⌖
- /* First, get the number of pixel pipes */
- info.request = RADEON_INFO_NUM_GB_PIPES;
- retval = drmCommandWriteRead(fd, DRM_RADEON_INFO, &info, sizeof(info));
- if (retval) {
- fprintf(stderr, "%s: New ioctl for GB pipe count failed "
- "(error number %d), trying classic ioctl...\n",
- __FUNCTION__, retval);
- gp.param = RADEON_PARAM_NUM_GB_PIPES;
- retval = drmCommandWriteRead(fd, DRM_RADEON_GETPARAM, &gp,
- sizeof(gp));
- if (retval) {
- fprintf(stderr, "%s: Failed to get GB pipe count, "
- "error number %d\n", __FUNCTION__, retval);
- exit(1);
- }
- }
- winsys->gb_pipes = target;
-
- /* Then, get PCI ID */
+ /* First, get PCI ID */
info.request = RADEON_INFO_DEVICE_ID;
retval = drmCommandWriteRead(fd, DRM_RADEON_INFO, &info, sizeof(info));
if (retval) {
@@ -197,7 +179,7 @@ static void do_ioctls(struct r300_winsys* winsys, int fd)
}
winsys->pci_id = target;
- /* Finally, retrieve MM info */
+ /* Then, retrieve MM info */
retval = drmCommandWriteRead(fd, DRM_RADEON_GEM_INFO,
&gem_info, sizeof(gem_info));
if (retval) {
diff --git a/src/gallium/winsys/drm/radeon/core/radeon_r300.h b/src/gallium/winsys/drm/radeon/core/radeon_r300.h
index 19c7ed2626..a2e0e58248 100644
--- a/src/gallium/winsys/drm/radeon/core/radeon_r300.h
+++ b/src/gallium/winsys/drm/radeon/core/radeon_r300.h
@@ -32,9 +32,6 @@
#include "radeon_buffer.h"
/* protect us from bonghits */
-#ifndef RADEON_INFO_NUM_GB_PIPES
-#define RADEON_INFO_NUM_GB_PIPES 0
-#endif
#ifndef RADEON_INFO_DEVICE_ID
#define RADEON_INFO_DEVICE_ID 0
#endif
--
cgit v1.2.3
From 572d7d1358b60c93ec4f1f28151bb0e708a9df17 Mon Sep 17 00:00:00 2001
From: Corbin Simpson
Date: Sun, 17 May 2009 20:49:39 -0700
Subject: r300-gallium: Size mismatch.
---
src/gallium/drivers/r300/r300_surface.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c
index ceaafe11d5..acb6192492 100644
--- a/src/gallium/drivers/r300/r300_surface.c
+++ b/src/gallium/drivers/r300/r300_surface.c
@@ -147,7 +147,7 @@ static void r300_surface_fill(struct pipe_context* pipe,
r300_emit_rs_block_state(r300, &r300_rs_block_clear_state);
}
- BEGIN_CS(24);
+ BEGIN_CS(26);
/* VAP stream control, mapping from input memory to PVS/RS memory */
if (caps->has_tcl) {
--
cgit v1.2.3
From 06a7b798f2261a7faaede71946e4489979840713 Mon Sep 17 00:00:00 2001
From: Corbin Simpson
Date: Sun, 17 May 2009 21:10:07 -0700
Subject: r300-gallium: Add half-right COS and SIN.
HW trig does a premultiply by 2pi, where Mesa does another premultiply by pi.
This is a problem.
---
src/gallium/drivers/r300/r300_state_shader.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/gallium/drivers/r300/r300_state_shader.c b/src/gallium/drivers/r300/r300_state_shader.c
index 7257638dbe..0871aed2b4 100644
--- a/src/gallium/drivers/r300/r300_state_shader.c
+++ b/src/gallium/drivers/r300/r300_state_shader.c
@@ -208,10 +208,12 @@ static INLINE uint32_t r300_alpha_op(unsigned op)
static INLINE uint32_t r500_rgba_op(unsigned op)
{
switch (op) {
+ case TGSI_OPCODE_COS:
case TGSI_OPCODE_EX2:
case TGSI_OPCODE_LG2:
case TGSI_OPCODE_RCP:
case TGSI_OPCODE_RSQ:
+ case TGSI_OPCODE_SIN:
return R500_ALU_RGBA_OP_SOP;
case TGSI_OPCODE_FRC:
return R500_ALU_RGBA_OP_FRC;
@@ -238,6 +240,8 @@ static INLINE uint32_t r500_rgba_op(unsigned op)
static INLINE uint32_t r500_alpha_op(unsigned op)
{
switch (op) {
+ case TGSI_OPCODE_COS:
+ return R500_ALPHA_OP_COS;
case TGSI_OPCODE_EX2:
return R500_ALPHA_OP_EX2;
case TGSI_OPCODE_LG2:
@@ -248,6 +252,8 @@ static INLINE uint32_t r500_alpha_op(unsigned op)
return R500_ALPHA_OP_RSQ;
case TGSI_OPCODE_FRC:
return R500_ALPHA_OP_FRC;
+ case TGSI_OPCODE_SIN:
+ return R500_ALPHA_OP_SIN;
case TGSI_OPCODE_DP3:
case TGSI_OPCODE_DP4:
case TGSI_OPCODE_DPH:
@@ -460,6 +466,9 @@ static void r500_fs_instruction(struct r500_fragment_shader* fs,
* AMD/ATI names for opcodes, please, as it facilitates using the
* documentation. */
switch (inst->Instruction.Opcode) {
+ /* XXX trig needs extra prep */
+ case TGSI_OPCODE_COS:
+ case TGSI_OPCODE_SIN:
/* The simple scalar ops. */
case TGSI_OPCODE_EX2:
case TGSI_OPCODE_LG2:
--
cgit v1.2.3
From 0036f2ccba6720e06a578333f04086d100d188b1 Mon Sep 17 00:00:00 2001
From: Corbin Simpson
Date: Sun, 17 May 2009 21:39:11 -0700
Subject: dri-gallium: Add GLSL support.
Oh, look, it's more features. :3
---
src/gallium/state_trackers/dri/dri_extensions.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/gallium/state_trackers/dri/dri_extensions.c b/src/gallium/state_trackers/dri/dri_extensions.c
index 0c59d42d5c..2f48162526 100644
--- a/src/gallium/state_trackers/dri/dri_extensions.c
+++ b/src/gallium/state_trackers/dri/dri_extensions.c
@@ -36,9 +36,11 @@
#define need_GL_ARB_multisample
#define need_GL_ARB_occlusion_query
#define need_GL_ARB_point_parameters
+#define need_GL_ARB_shader_objects
#define need_GL_ARB_texture_compression
#define need_GL_ARB_vertex_buffer_object
#define need_GL_ARB_vertex_program
+#define need_GL_ARB_vertex_shader
#define need_GL_ARB_window_pos
#define need_GL_EXT_blend_color
#define need_GL_EXT_blend_equation_separate
@@ -50,16 +52,23 @@
#define need_GL_EXT_multi_draw_arrays
#define need_GL_EXT_secondary_color
#define need_GL_NV_vertex_program
+#define need_GL_VERSION_2_0
+#define need_GL_VERSION_2_1
#include "extension_helper.h"
/**
* Extension strings exported by the driver.
*/
const struct dri_extension card_extensions[] = {
+ {"GL_ARB_fragment_shader", NULL},
{"GL_ARB_multisample", GL_ARB_multisample_functions},
{"GL_ARB_multitexture", NULL},
{"GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions},
+ {"GL_ARB_pixel_buffer_object", NULL},
{"GL_ARB_point_parameters", GL_ARB_point_parameters_functions},
+ {"GL_ARB_shading_language_100", GL_VERSION_2_0_functions },
+ {"GL_ARB_shading_language_120", GL_VERSION_2_1_functions },
+ {"GL_ARB_shader_objects", GL_ARB_shader_objects_functions},
{"GL_ARB_texture_border_clamp", NULL},
{"GL_ARB_texture_compression", GL_ARB_texture_compression_functions},
{"GL_ARB_texture_cube_map", NULL},
@@ -69,7 +78,7 @@ const struct dri_extension card_extensions[] = {
{"GL_ARB_texture_mirrored_repeat", NULL},
{"GL_ARB_texture_rectangle", NULL},
{"GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions},
- {"GL_ARB_pixel_buffer_object", NULL},
+ {"GL_ARB_vertex_shader", GL_ARB_vertex_shader_functions},
{"GL_ARB_vertex_program", GL_ARB_vertex_program_functions},
{"GL_ARB_window_pos", GL_ARB_window_pos_functions},
{"GL_EXT_blend_color", GL_EXT_blend_color_functions},
--
cgit v1.2.3
From 9569221563fd0e9fba564126d61bf3786cf74715 Mon Sep 17 00:00:00 2001
From: Corbin Simpson
Date: Sun, 17 May 2009 21:40:16 -0700
Subject: r300-gallium: r500-fs: DDX and DDY support.
Oh, look, GLSL instructions. I wonder what I'll do next.
---
src/gallium/drivers/r300/r300_state_shader.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/gallium/drivers/r300/r300_state_shader.c b/src/gallium/drivers/r300/r300_state_shader.c
index 0871aed2b4..ed99c76c15 100644
--- a/src/gallium/drivers/r300/r300_state_shader.c
+++ b/src/gallium/drivers/r300/r300_state_shader.c
@@ -215,6 +215,10 @@ static INLINE uint32_t r500_rgba_op(unsigned op)
case TGSI_OPCODE_RSQ:
case TGSI_OPCODE_SIN:
return R500_ALU_RGBA_OP_SOP;
+ case TGSI_OPCODE_DDX:
+ return R500_ALU_RGBA_OP_MDH;
+ case TGSI_OPCODE_DDY:
+ return R500_ALU_RGBA_OP_MDV;
case TGSI_OPCODE_FRC:
return R500_ALU_RGBA_OP_FRC;
case TGSI_OPCODE_DP3:
@@ -254,6 +258,10 @@ static INLINE uint32_t r500_alpha_op(unsigned op)
return R500_ALPHA_OP_FRC;
case TGSI_OPCODE_SIN:
return R500_ALPHA_OP_SIN;
+ case TGSI_OPCODE_DDX:
+ return R500_ALPHA_OP_MDH;
+ case TGSI_OPCODE_DDY:
+ return R500_ALPHA_OP_MDV;
case TGSI_OPCODE_DP3:
case TGSI_OPCODE_DP4:
case TGSI_OPCODE_DPH:
@@ -480,6 +488,8 @@ static void r500_fs_instruction(struct r500_fragment_shader* fs,
inst->FullSrcRegisters[0].SrcRegister.SwizzleW =
inst->FullSrcRegisters[0].SrcRegister.SwizzleX;
/* Fall through */
+ case TGSI_OPCODE_DDX:
+ case TGSI_OPCODE_DDY:
case TGSI_OPCODE_FRC:
r500_emit_maths(fs, assembler, inst->FullSrcRegisters,
&inst->FullDstRegisters[0], inst->Instruction.Opcode, 1);
--
cgit v1.2.3
From 27206add2738f9813d1e9f42fe3b1bdfbd9b8aa4 Mon Sep 17 00:00:00 2001
From: Corbin Simpson
Date: Sun, 17 May 2009 21:41:25 -0700
Subject: r300-gallium: Enable GLSL for r500.
Before you get all excited, this is *not* to be construed as actual support
for GLSL shaders. The GL version is still 1.3, and stuff still sucks. Just
flicking it on so that it can be tested and developed a bit easier.
---
src/gallium/drivers/r300/r300_screen.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index 04d6db81b0..a6f1efe356 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -88,8 +88,11 @@ static int r300_get_param(struct pipe_screen* pscreen, int param)
return 0;
}
case PIPE_CAP_GLSL:
- /* IN THEORY */
- return 0;
+ if (r300screen->caps->is_r500) {
+ return 1;
+ } else {
+ return 0;
+ }
case PIPE_CAP_S3TC:
/* IN THEORY */
return 0;
--
cgit v1.2.3
From f2445dfd85b42aafe0634e17b2929b4122ff3f03 Mon Sep 17 00:00:00 2001
From: Aidan Thornton
Date: Mon, 18 May 2009 12:47:00 +0200
Subject: Initialize psp->waitX/waitGL for swrast_dri.so.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21053 .
---
src/glx/x11/drisw_glx.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/glx/x11/drisw_glx.c b/src/glx/x11/drisw_glx.c
index 5e3d763cff..b843ce484f 100644
--- a/src/glx/x11/drisw_glx.c
+++ b/src/glx/x11/drisw_glx.c
@@ -405,6 +405,8 @@ driCreateScreen(__GLXscreenConfigs * psc, int screen,
psp->createContext = driCreateContext;
psp->createDrawable = driCreateDrawable;
psp->swapBuffers = driSwapBuffers;
+ psp->waitX = NULL;
+ psp->waitGL = NULL;
return psp;
--
cgit v1.2.3
From da0d4e1db67d7641a535218de2db5f7bb00a6bb8 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Mon, 18 May 2009 07:17:36 -0600
Subject: docs: emphasize the incomplete status of the nouveau/R300 gallium
drivers
---
docs/relnotes-7.5.html | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/docs/relnotes-7.5.html b/docs/relnotes-7.5.html
index 3de243d1b2..d47b21d827 100644
--- a/docs/relnotes-7.5.html
+++ b/docs/relnotes-7.5.html
@@ -46,7 +46,7 @@ tbd
New features
-
Gallium - this is the new architecture for OS-independent and
+
Gallium3D - this is the new architecture for OS-independent and
API-independent 3D drivers.
Gallium3D is intended for GPUs that fully support vertex/fragment shaders.
The Gallium3D drivers currently included are:
@@ -54,8 +54,10 @@ tbd
nouveau - preliminary driver for NVIDIA GPUs (still under development)
-
r300 - preliminary driver for R300 (still under development)
+
nouveau (for NVIDIA GPUs) and R300 for (AMD/ATI R300).
+ PLEASE NOTE: these drivers are incomplete and still under development.
+ It's probably NOT worthwhile to report any bugs unless you have patches.
+