nv50: handle VP without inputs
PATCH 1/1 nv50: handle VP without inputs
Fixes 3 piglit tests:
general/pos-array
shaders/glsl-novertexdata
shaders/glsl-vs-point-size
and makes shaders/vp-ignore-input not trigger PGRAPH DATA_ERROR
---
It's a bit ugly... If there's a way to fix it properly, I'm open to suggestions.
--- src/gallium/drivers/nv50/nv50_program.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
src/gallium/drivers/nv50/nv50_program.c +7 -0
@@ -53,6 +53,13 @@ nv50_vertprog_assign_slots(struct nv50_ir_prog_info *info)if (info->in[i].mask & (1 << c)) info->in[i].slot[c] = n++; } + +// Corner case: VP has no inputs, but we will still need to submit data to +// draw it. HW will shout at us and won't draw anything if we don't enable +// any input, so let's just pretend it's the first one. +if (info->numInputs ==0 ) + prog->vp.attrs[0 ] |=0xf ; + prog->in_nr = info->numInputs;for (i =0 ; i < info->numSysVals; ++i) {
Signature · 1 line
1.7.8.5
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 19 lines · Marcin Slusarz
Fixes 3 piglit tests:
general/pos-array
shaders/glsl-novertexdata
shaders/glsl-vs-point-size
and makes shaders/vp-ignore-input not trigger PGRAPHDATA_ERROR
---
It's a bit ugly... If there's a way to fix it properly, I'm open to suggestions.--- src/gallium/drivers/nv50/nv50_program.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)src/gallium/drivers/nv50/nv50_program.c +0
-0@@ -53,6 +53,13 @@ nv50_vertprog_assign_slots(struct nv50_ir_prog_info *info)if (info->in[i].mask & (1 << c)) info->in[i].slot[c] = n++; }
src/gallium/drivers/nv50/nv50_program.c nv50_vertprog_assign_slots(struct nv50_ir_prog_info *info) · line 65
Quoted 10 lines
src/gallium/drivers/nv50/nv50_program.c +7
-0+ +// Corner case: VP has no inputs, but we will still need to submit data to +// draw it. HW will shout at us and won't draw anything if we don't enable +// any input, so let's just pretend it's the first one. +if (info->numInputs ==0 ) + prog->vp.attrs[0 ] |=0xf ; + prog->in_nr = info->numInputs;for (i =0 ; i < info->numSysVals; ++i) {
Ah thank you, I've been wondering how to make the nv50 draw without any inputs (on nvc0 it just works even if you don't enable any).
2 issues though:
- please don't use C++ style comments in here (the style guardians would sooner or later patch this up)
- if InstanceID or VertexID are used, enabling any inputs will move them to a different position in input space, they always come after all the ordinary vertex attributes; see usage of the "unsigned n" in the code directly above & below
A message that is not in the archive (sent off-list or not yet received): 4FA6CB71.9070308-oe7qfRrRQffzPE21tAIdciO7C/[email protected]
Quoted 33 lines · Christoph Bumiller
Quoted 19 lines · Marcin Slusarz
Fixes 3 piglit tests:
general/pos-array
shaders/glsl-novertexdata
shaders/glsl-vs-point-size
and makes shaders/vp-ignore-input not trigger PGRAPHDATA_ERROR
---
It's a bit ugly... If there's a way to fix it properly, I'm open to suggestions.--- src/gallium/drivers/nv50/nv50_program.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)src/gallium/drivers/nv50/nv50_program.c +0
-0@@ -53,6 +53,13 @@ nv50_vertprog_assign_slots(struct nv50_ir_prog_info *info)if (info->in[i].mask & (1 << c)) info->in[i].slot[c] = n++; }src/gallium/drivers/nv50/nv50_program.c nv50_vertprog_assign_slots(struct nv50_ir_prog_info *info) · line 65
Quoted 10 lines
src/gallium/drivers/nv50/nv50_program.c +7
-0+ +// Corner case: VP has no inputs, but we will still need to submit data to +// draw it. HW will shout at us and won't draw anything if we don't enable +// any input, so let's just pretend it's the first one. +if (info->numInputs ==0 ) + prog->vp.attrs[0 ] |=0xf ; + prog->in_nr = info->numInputs;for (i =0 ; i < info->numSysVals; ++i) {Ah thank you, I've been wondering how to make the nv50 draw without any inputs (on nvc0 it just works even if you don't enable any).
Quoted 7 lines
2 issues though:
- please don't use C++ style comments in here (the style guardians would sooner or later patch this up)
- if InstanceID or VertexID are used, enabling any inputs will move them to a different position in input space, they always come after all the ordinary vertex attributes; see usage of the "unsigned n" in the code directly above & below
Thanks. I hacked glsl-vs-point-size test to use gl_VertexID/gl_InstanceID and it indeed failed. But patch below works in all cases :).
---
From: Marcin Slusarz <[email protected]>
Subject: [PATCH] nv50: handle VP without inputs
Fixes 3 piglit tests:
general/pos-array
shaders/glsl-novertexdata
shaders/glsl-vs-point-size
and makes shaders/vp-ignore-input not trigger PGRAPH DATA_ERROR
--- src/gallium/drivers/nv50/nv50_program.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
src/gallium/drivers/nv50/nv50_program.c +11 -0
@@ -68,6 +68,17 @@ nv50_vertprog_assign_slots(struct nv50_ir_prog_info *info)break ; } } + +/* +* Corner case: VP has no inputs, but we will still need to submit data to +* draw it. HW will shout at us and won't draw anything if we don't enable +* any input, so let's just pretend it's the first one. +*/ +if (prog->vp.attrs[0 ] ==0 && + prog->vp.attrs[1 ] ==0 && + prog->vp.attrs[2 ] ==0 ) + prog->vp.attrs[0 ] |=0xf ; +/* VertexID before InstanceID */ if (info->io.vertexId < info->numSysVals) info->sv[info->io.vertexId].slot[0 ] = n++;
Signature · 1 line
1.7.8.5