diff options
Diffstat (limited to 'src/gallium/drivers/softpipe')
-rw-r--r-- | src/gallium/drivers/softpipe/SConscript | 2 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_quad_depth_test.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_screen.c | 12 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_tex_sample.c | 57 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_tile_cache.h | 2 |
5 files changed, 59 insertions, 15 deletions
diff --git a/src/gallium/drivers/softpipe/SConscript b/src/gallium/drivers/softpipe/SConscript index d5f4d28aef..ea10e8a9f9 100644 --- a/src/gallium/drivers/softpipe/SConscript +++ b/src/gallium/drivers/softpipe/SConscript @@ -37,4 +37,6 @@ softpipe = env.ConvenienceLibrary( 'sp_tile_cache.c', ]) +env.Alias('softpipe', softpipe) + Export('softpipe') diff --git a/src/gallium/drivers/softpipe/sp_quad_depth_test.c b/src/gallium/drivers/softpipe/sp_quad_depth_test.c index c8f5f89568..89b2a91fc1 100644 --- a/src/gallium/drivers/softpipe/sp_quad_depth_test.c +++ b/src/gallium/drivers/softpipe/sp_quad_depth_test.c @@ -860,6 +860,7 @@ choose_depth_test(struct quad_stage *qs, /* look for special cases */ if (!alpha && !depth && + !occlusion && !stencil) { qs->run = depth_noop; } diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index a2bfa1bd8d..5f171d314a 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -64,7 +64,12 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param) case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS: return PIPE_MAX_SAMPLERS; case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS: +#ifdef HAVE_LLVM + /* Softpipe doesn't yet know how to tell draw/llvm about textures */ + return 0; +#else return PIPE_MAX_VERTEX_SAMPLERS; +#endif case PIPE_CAP_MAX_COMBINED_SAMPLERS: return PIPE_MAX_SAMPLERS + PIPE_MAX_VERTEX_SAMPLERS; case PIPE_CAP_NPOT_TEXTURES: @@ -209,13 +214,6 @@ softpipe_is_format_supported( struct pipe_screen *screen, if (format_desc->block.width != 1 || format_desc->block.height != 1) return FALSE; - - /* - * TODO: Unfortunately we cannot render into anything more than 32 bits - * because we encode color clear values into a 32bit word. - */ - if (format_desc->block.bits > 32) - return FALSE; } if (bind & PIPE_BIND_DEPTH_STENCIL) { diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c index 088e48f81f..2eac4c7a82 100644 --- a/src/gallium/drivers/softpipe/sp_tex_sample.c +++ b/src/gallium/drivers/softpipe/sp_tex_sample.c @@ -44,6 +44,9 @@ #include "sp_tex_tile_cache.h" +/** Set to one to help debug texture sampling */ +#define DEBUG_TEX 0 + /* * Return fractional part of 'f'. Used for computing interpolation weights. @@ -774,6 +777,18 @@ pot_level_size(unsigned base_pot, unsigned level) } +static void +print_sample(const char *function, float rgba[NUM_CHANNELS][QUAD_SIZE]) +{ + debug_printf("%s %g %g %g %g, %g %g %g %g, %g %g %g %g, %g %g %g %g\n", + function, + rgba[0][0], rgba[1][0], rgba[2][0], rgba[3][0], + rgba[0][1], rgba[1][1], rgba[2][1], rgba[3][1], + rgba[0][2], rgba[1][2], rgba[2][2], rgba[3][2], + rgba[0][3], rgba[1][3], rgba[2][3], rgba[3][3]); +} + + /* Some image-filter fastpaths: */ static INLINE void @@ -832,6 +847,10 @@ img_filter_2d_linear_repeat_POT(struct tgsi_sampler *tgsi_sampler, tx[2][c], tx[3][c]); } } + + if (DEBUG_TEX) { + print_sample(__FUNCTION__, rgba); + } } @@ -872,6 +891,10 @@ img_filter_2d_nearest_repeat_POT(struct tgsi_sampler *tgsi_sampler, rgba[c][j] = out[c]; } } + + if (DEBUG_TEX) { + print_sample(__FUNCTION__, rgba); + } } @@ -921,6 +944,10 @@ img_filter_2d_nearest_clamp_POT(struct tgsi_sampler *tgsi_sampler, rgba[c][j] = out[c]; } } + + if (DEBUG_TEX) { + print_sample(__FUNCTION__, rgba); + } } @@ -957,6 +984,10 @@ img_filter_1d_nearest(struct tgsi_sampler *tgsi_sampler, rgba[c][j] = out[c]; } } + + if (DEBUG_TEX) { + print_sample(__FUNCTION__, rgba); + } } @@ -997,6 +1028,10 @@ img_filter_2d_nearest(struct tgsi_sampler *tgsi_sampler, rgba[c][j] = out[c]; } } + + if (DEBUG_TEX) { + print_sample(__FUNCTION__, rgba); + } } @@ -1045,6 +1080,10 @@ img_filter_cube_nearest(struct tgsi_sampler *tgsi_sampler, rgba[c][j] = out[c]; } } + + if (DEBUG_TEX) { + print_sample(__FUNCTION__, rgba); + } } @@ -1357,6 +1396,10 @@ mip_filter_linear(struct tgsi_sampler *tgsi_sampler, } } } + + if (DEBUG_TEX) { + print_sample(__FUNCTION__, rgba); + } } @@ -1402,13 +1445,9 @@ mip_filter_nearest(struct tgsi_sampler *tgsi_sampler, samp->min_img_filter(tgsi_sampler, s, t, p, NULL, tgsi_sampler_lod_bias, rgba); } -#if 0 - printf("RGBA %g %g %g %g, %g %g %g %g, %g %g %g %g, %g %g %g %g\n", - rgba[0][0], rgba[1][0], rgba[2][0], rgba[3][0], - rgba[0][1], rgba[1][1], rgba[2][1], rgba[3][1], - rgba[0][2], rgba[1][2], rgba[2][2], rgba[3][2], - rgba[0][3], rgba[1][3], rgba[2][3], rgba[3][3]); -#endif + if (DEBUG_TEX) { + print_sample(__FUNCTION__, rgba); + } } @@ -1510,6 +1549,10 @@ mip_filter_linear_2d_linear_repeat_POT( } } } + + if (DEBUG_TEX) { + print_sample(__FUNCTION__, rgba); + } } diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.h b/src/gallium/drivers/softpipe/sp_tile_cache.h index 031c7c1ea5..4151a47c32 100644 --- a/src/gallium/drivers/softpipe/sp_tile_cache.h +++ b/src/gallium/drivers/softpipe/sp_tile_cache.h @@ -86,7 +86,7 @@ struct softpipe_tile_cache struct softpipe_cached_tile *entries[NUM_ENTRIES]; uint clear_flags[(MAX_WIDTH / TILE_SIZE) * (MAX_HEIGHT / TILE_SIZE) / 32]; float clear_color[4]; /**< for color bufs */ - uint clear_val; /**< for z+stencil, or packed color clear value */ + uint clear_val; /**< for z+stencil */ boolean depth_stencil; /**< Is the surface a depth/stencil format? */ struct softpipe_cached_tile *tile; /**< scratch tile for clears */ |