summaryrefslogtreecommitdiff
path: root/src/sna/sna_stream.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-07-31 18:39:17 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-07-31 19:11:08 +0100
commit492093d04b1486dd34aafe2f109a77ddeb836f18 (patch)
treec6e9f1958e920a886089649d11175026188fa73f /src/sna/sna_stream.c
parent6a5ed88f9fab654c9c11c566b841d42150d26c5d (diff)
sna: Generate shaders for SNB+ 8-pixel dispatch
Not ideal yet, sampling an alpha-only surface using SIMD8 only seems to ever return 0... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_stream.c')
-rw-r--r--src/sna/sna_stream.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/sna/sna_stream.c b/src/sna/sna_stream.c
index 66a8c461..1a0a86b9 100644
--- a/src/sna/sna_stream.c
+++ b/src/sna/sna_stream.c
@@ -97,7 +97,7 @@ struct kgem_bo *sna_static_stream_fini(struct sna *sna,
unsigned
sna_static_stream_compile_sf(struct sna *sna,
struct sna_static_stream *stream,
- void (*compile)(struct brw_compile *))
+ bool (*compile)(struct brw_compile *))
{
struct brw_compile p;
@@ -105,7 +105,11 @@ sna_static_stream_compile_sf(struct sna *sna,
sna_static_stream_map(stream,
64*sizeof(uint32_t), 64));
- compile(&p);
+ if (!compile(&p)) {
+ stream->used -= 64*sizeof(uint32_t);
+ return 0;
+ }
+
assert(p.nr_insn*sizeof(struct brw_instruction) <= 64*sizeof(uint32_t));
stream->used -= 64*sizeof(uint32_t) - p.nr_insn*sizeof(struct brw_instruction);
@@ -115,7 +119,7 @@ sna_static_stream_compile_sf(struct sna *sna,
unsigned
sna_static_stream_compile_wm(struct sna *sna,
struct sna_static_stream *stream,
- void (*compile)(struct brw_compile *, int),
+ bool (*compile)(struct brw_compile *, int),
int dispatch_width)
{
struct brw_compile p;
@@ -124,7 +128,11 @@ sna_static_stream_compile_wm(struct sna *sna,
sna_static_stream_map(stream,
256*sizeof(uint32_t), 64));
- compile(&p, dispatch_width);
+ if (!compile(&p, dispatch_width)) {
+ stream->used -= 256*sizeof(uint32_t);
+ return 0;
+ }
+
assert(p.nr_insn*sizeof(struct brw_instruction) <= 256*sizeof(uint32_t));
stream->used -= 256*sizeof(uint32_t) - p.nr_insn*sizeof(struct brw_instruction);