From 492093d04b1486dd34aafe2f109a77ddeb836f18 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 31 Jul 2012 18:39:17 +0100 Subject: 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 --- src/sna/sna_stream.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/sna/sna_stream.c') 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); -- cgit v1.2.3