#include "lp_rast_priv.h"
#include "lp_state_fs.h"
-static INLINE int u_bit_scan(unsigned *mask)
-{
- int i = ffs(*mask) - 1;
- *mask &= ~(1 << i);
- return i;
-}
-
struct tile {
int coverage;
int overdraw;
const struct cmd_block *block,
int k )
{
+ if (!state)
+ return NULL;
+
if (block->cmd[k] == LP_RAST_OP_SHADE_TILE ||
block->cmd[k] == LP_RAST_OP_SHADE_TILE_OPAQUE ||
block->cmd[k] == LP_RAST_OP_TRIANGLE_1 ||
static void
debug_bin( const struct cmd_bin *bin )
{
- const struct lp_rast_state *state;
+ const struct lp_rast_state *state = NULL;
const struct cmd_block *head = bin->head;
int i, j = 0;
char val)
{
const struct lp_rast_shader_inputs *inputs = arg.shade_tile;
- boolean blend = tile->state->variant->key.blend.rt[0].blend_enable;
+ boolean blend;
unsigned i,j;
+ if (!tile->state)
+ return 0;
+
+ blend = tile->state->variant->key.blend.rt[0].blend_enable;
+
if (inputs->disable)
return 0;
memset(tile->data, ' ', sizeof tile->data);
tile->coverage = 0;
tile->overdraw = 0;
+ tile->state = NULL;
for (block = bin->head; block; block = block->next) {
for (k = 0; k < block->count; k++, j++) {
for (y = 0; y < scene->tiles_y; y++) {
for (x = 0; x < scene->tiles_x; x++) {
const char *bits = " ...,-~:;=o+xaw*#XAWWWWWWWWWWWWWWWW";
- int sz = lp_scene_bin_size(scene, x, y);
- int sz2 = util_unsigned_logbase2(sz);
+ unsigned sz = lp_scene_bin_size(scene, x, y);
+ unsigned sz2 = util_logbase2(sz);
debug_printf("%c", bits[MIN2(sz2,32)]);
}
debug_printf("\n");