diff options
author | Zack Rusin <[email protected]> | 2013-09-25 19:38:33 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2013-10-09 18:30:31 -0400 |
commit | edde6c77bd1cb91f6f7c42010919e6f406f507ce (patch) | |
tree | 26039517cd76354dc4d1182052ef71e6ec220f47 /src/gallium/drivers/llvmpipe/lp_rast.h | |
parent | 87fe4a33d30b78549426d9af7ad121eff38fa29b (diff) |
llvmpipe: abstract the code to set number of subpixel bits
As we're moving towards expanding the number of subpixel
bits and the width of the variables used in the computations
we need to make this code a bit more centralized.
Signed-off-by: Zack Rusin <[email protected]>
Reviewed-by: José Fonseca <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_rast.h')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_rast.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.h b/src/gallium/drivers/llvmpipe/lp_rast.h index c57f2ea11de..43c598d5117 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.h +++ b/src/gallium/drivers/llvmpipe/lp_rast.h @@ -46,9 +46,18 @@ struct lp_scene; struct lp_fence; struct cmd_bin; +#define FIXED_TYPE_WIDTH 32 /** For sub-pixel positioning */ #define FIXED_ORDER 4 #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 |