Roy Spliet
2012-May-09  22:06 UTC
[Nouveau] [Patches]mesa/nv30: Diverse set of patches that improve NV3x render quality
For all these patches I'd say: testers are welcome. The first three patches seem good enough to push as we speak IMHO (so if you agree, go ahead!), whereas for the fourth I don't know if this is the desired way to fix. The result of these four patches is that NV34 gives a nearly-correct desktop experience, where only some fading animations appear broken. It's quite useable now! [1/4]: Fixes nearly all piglit vertprog testcases, due to it now being able to pass the results on to the fragment shader. [2/4]: Fixes shader compiler assertion errors: src[1] was uninitialised or filled with rubbish. Fixes several piglits. [3/4]: as it says [4/4]: Avoids the case where the framebuffer (?) is assumed to be swizzling and linear. Due to the current OR-logic this results in a type of 0x3, which simply does not exist in NV30 hardware. A better fix can be proposed, but as far as I know this does no harm even if the bug I hit was only due to a broken mesa setup.
Roy Spliet
2012-May-09  22:06 UTC
[Nouveau] [PATCH 1/4] nv30: Fix generic passing to fragment program in NV34
fixes over 800 piglit cases in quick-driver suite for NV34
Signed-off-by: Roy Spliet <r.spliet at student.tudelft.nl>
---
 src/gallium/drivers/nv30/nvfx_fragprog.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/nv30/nvfx_fragprog.c
b/src/gallium/drivers/nv30/nvfx_fragprog.c
index 592ad21..da6e234 100644
--- a/src/gallium/drivers/nv30/nvfx_fragprog.c
+++ b/src/gallium/drivers/nv30/nvfx_fragprog.c
@@ -959,8 +959,12 @@ nvfx_fragprog_assign_generic(struct nv30_context *nvfx,
struct nvfx_fpc *fpc,
          for (hw = 0; hw < num_texcoords; hw++) {
             if (fpc->fp->texcoord[hw] == 0xffff) {
                fpc->fp->texcoord[hw] = fdec->Semantic.Index;
-               if (hw <= 7) fpc->fp->vp_or |= (0x00004000 <<
hw);
-               else         fpc->fp->vp_or |= (0x00001000 << (hw -
8));
+               if (hw <= 7) {
+                  fpc->fp->vp_or |= (0x00004000 << hw);
+                  fpc->fp->samplers |= (0x1 << hw);
+               } else {
+                  fpc->fp->vp_or |= (0x00001000 << (hw - 8));
+               }
                if (fdec->Semantic.Index == 9)
                   fpc->fp->point_sprite_control |= (0x00000100 <<
hw);
                hw = NVFX_FP_OP_INPUT_SRC_TC(hw);
-- 
1.7.7.6
Roy Spliet
2012-May-09  22:06 UTC
[Nouveau] [PATCH 2/4] nv30/vertprog: SSG only requires one source register
Fixes crashing due to assertion error
Signed-off-by: Roy Spliet <r.spliet at student.tudelft.nl>
---
 src/gallium/drivers/nv30/nvfx_vertprog.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/gallium/drivers/nv30/nvfx_vertprog.c
b/src/gallium/drivers/nv30/nvfx_vertprog.c
index 82972b3..f41f82d 100644
--- a/src/gallium/drivers/nv30/nvfx_vertprog.c
+++ b/src/gallium/drivers/nv30/nvfx_vertprog.c
@@ -668,7 +668,7 @@ nvfx_vertprog_parse_instruction(struct nv30_context *nv30,
struct nvfx_vpc *vpc,
       nvfx_vp_emit(vpc, arith(sat, VEC, SNE, dst, mask, src[0], src[1], none));
       break;
    case TGSI_OPCODE_SSG:
-      nvfx_vp_emit(vpc, arith(sat, VEC, SSG, dst, mask, src[0], src[1], none));
+      nvfx_vp_emit(vpc, arith(sat, VEC, SSG, dst, mask, src[0], none, none));
       break;
    case TGSI_OPCODE_STR:
       nvfx_vp_emit(vpc, arith(sat, VEC, STR, dst, mask, src[0], src[1], none));
-- 
1.7.7.6
Signed-off-by: Roy Spliet <r.spliet at student.tudelft.nl>
---
 src/gallium/drivers/nv30/nv30_screen.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/gallium/drivers/nv30/nv30_screen.c
b/src/gallium/drivers/nv30/nv30_screen.c
index d355f74..26e41c2 100644
--- a/src/gallium/drivers/nv30/nv30_screen.c
+++ b/src/gallium/drivers/nv30/nv30_screen.c
@@ -111,6 +111,10 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum
pipe_cap param)
    case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
    case PIPE_CAP_MIXED_COLORBUFFER_FORMATS:
       return 0;
+   case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:
+   case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY:
+   case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY:
+      return 1;
    default:
       debug_printf("unknown param %d\n", param);
       return 0;
-- 
1.7.7.6
Signed-off-by: Roy Spliet <r.spliet at student.tudelft.nl>
---
 src/gallium/drivers/nv30/nv30_state_validate.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/gallium/drivers/nv30/nv30_state_validate.c
b/src/gallium/drivers/nv30/nv30_state_validate.c
index ae7955b..87c1978 100644
--- a/src/gallium/drivers/nv30/nv30_state_validate.c
+++ b/src/gallium/drivers/nv30/nv30_state_validate.c
@@ -95,6 +95,7 @@ nv30_validate_fb(struct nv30_context *nv30)
    if (rt_format & NV30_3D_RT_FORMAT_TYPE_SWIZZLED) {
       rt_format |= util_logbase2(w) << 16;
       rt_format |= util_logbase2(h) << 24;
+      rt_format &= ~NV30_3D_RT_FORMAT_TYPE_LINEAR;
    }
 
    if (!PUSH_SPACE(push, 64))
-- 
1.7.7.6
Seemingly Similar Threads
- [Patches] mesa/nv30: Diverse set of patches that improve NV3x render quality V2
 - [PATCH 1/4] nv30: remove use_nv4x, it is identical to is_nv4x
 - [PATCH 2/2] nv30/draw: switch varying hookup logic to know about texcoords
 - [PATCH 2/2] nv30/draw: switch varying hookup logic to know about texcoords
 - [PATCH 1/2] nv30/draw: rework some of the output vertex buffer logic