summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_rast.h
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2013-09-19 14:10:08 -0400
committerZack Rusin <zackr@vmware.com>2013-09-23 14:53:07 -0400
commit755c11dc5e94f17097c186edaaa39d818396f14c (patch)
tree7b84e6163cf9970cd3e91b28080c534c45921f64 /src/gallium/drivers/llvmpipe/lp_rast.h
parent6d29db715b8d60718ada1ab8ad19d969cac43caf (diff)
downloadexternal_mesa3d-755c11dc5e94f17097c186edaaa39d818396f14c.zip
external_mesa3d-755c11dc5e94f17097c186edaaa39d818396f14c.tar.gz
external_mesa3d-755c11dc5e94f17097c186edaaa39d818396f14c.tar.bz2
llvmpipe: increase number of subpixel bits to eight
Unfortunately d3d10 requires a lot higher precision (e.g. wgf11clipping tests for it). The smallest number of precision bits with which it passes is 8. That means that we need to decrease the maximum length of an edge that we can handle without subdivision by 4 bits. Abstracted the code a bit to make it easier to change once to switch to 64bit rasterization. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: José Fonseca <jfonseca@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_rast.h')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_rast.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.h b/src/gallium/drivers/llvmpipe/lp_rast.h
index c57f2ea..39ff6af 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.h
+++ b/src/gallium/drivers/llvmpipe/lp_rast.h
@@ -46,10 +46,20 @@ struct lp_scene;
struct lp_fence;
struct cmd_bin;
+#define FIXED_TYPE_WIDTH 32
/** For sub-pixel positioning */
-#define FIXED_ORDER 4
+#define FIXED_ORDER 8
#define FIXED_ONE (1<<FIXED_ORDER)
+/** Maximum length of an edge in a primitive in pixels.
+ * If the framebuffer is large we have to think about fixed-point
+ * integer overflow. Coordinates need ((FIXED_TYPE_WIDTH/2) - 1) bits
+ * to be able to fit product of two such coordinates inside
+ * FIXED_TYPE_WIDTH, any larger and we could overflow a
+ * FIXED_TYPE_WIDTH_-bit int.
+ */
+#define MAX_FIXED_LENGTH (1 << (((FIXED_TYPE_WIDTH/2) - 1) - FIXED_ORDER))
+
/* Rasterizer output size going to jit fs, width/height */
#define LP_RASTER_BLOCK_SIZE 4