summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_setup.c
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2013-09-25 19:38:33 -0400
committerZack Rusin <[email protected]>2013-10-09 18:30:31 -0400
commitedde6c77bd1cb91f6f7c42010919e6f406f507ce (patch)
tree26039517cd76354dc4d1182052ef71e6ec220f47 /src/gallium/drivers/llvmpipe/lp_setup.c
parent87fe4a33d30b78549426d9af7ad121eff38fa29b (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_setup.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c
index c8199b496f9..9b277d32ddc 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
@@ -1007,16 +1007,12 @@ try_update_scene_state( struct lp_setup_context *setup )
&setup->draw_regions[i]);
}
}
- /* If the framebuffer is large we have to think about fixed-point
- * integer overflow. For 2K by 2K images, coordinates need 15 bits
- * (2^11 + 4 subpixel bits). The product of two such numbers would
- * use 30 bits. Any larger and we could overflow a 32-bit int.
- *
- * To cope with this problem we check if triangles are large and
- * subdivide them if needed.
+ /*
+ * Subdivide triangles if the framebuffer is larger than the
+ * MAX_FIXED_LENGTH.
*/
- setup->subdivide_large_triangles = (setup->fb.width > 2048 ||
- setup->fb.height > 2048);
+ setup->subdivide_large_triangles = (setup->fb.width > MAX_FIXED_LENGTH ||
+ setup->fb.height > MAX_FIXED_LENGTH);
}
setup->dirty = 0;