diff options
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r-- | src/gallium/drivers/r300/r300_debug.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_fs.c | 5 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_screen.c | 11 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_screen.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_state_derived.c | 12 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_vs.c | 5 |
6 files changed, 24 insertions, 11 deletions
diff --git a/src/gallium/drivers/r300/r300_debug.c b/src/gallium/drivers/r300/r300_debug.c index 145a7985da3..f78fe34790c 100644 --- a/src/gallium/drivers/r300/r300_debug.c +++ b/src/gallium/drivers/r300/r300_debug.c @@ -29,6 +29,7 @@ static const struct debug_named_value debug_options[] = { { "fp", DBG_FP, "Log fragment program compilation" }, { "vp", DBG_VP, "Log vertex program compilation" }, + { "pstat", DBG_P_STAT, "Log vertex/fragment program stats" }, { "draw", DBG_DRAW, "Log draw calls" }, { "swtcl", DBG_SWTCL, "Log SWTCL-specific info" }, { "rsblock", DBG_RS_BLOCK, "Log rasterizer registers" }, diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c index d9d4a9304df..c91532eb7b3 100644 --- a/src/gallium/drivers/r300/r300_fs.c +++ b/src/gallium/drivers/r300/r300_fs.c @@ -378,7 +378,8 @@ static void r300_translate_fragment_shader( /* Setup the compiler. */ memset(&compiler, 0, sizeof(compiler)); rc_init(&compiler.Base); - compiler.Base.Debug = DBG_ON(r300, DBG_FP); + DBG_ON(r300, DBG_FP) ? compiler.Base.Debug |= RC_DBG_LOG : 0; + DBG_ON(r300, DBG_P_STAT) ? compiler.Base.Debug |= RC_DBG_STATS : 0; compiler.code = &shader->code; compiler.state = shader->compare_state; @@ -395,7 +396,7 @@ static void r300_translate_fragment_shader( find_output_registers(&compiler, shader); - if (compiler.Base.Debug) { + if (compiler.Base.Debug & RC_DBG_LOG) { DBG(r300, DBG_FP, "r300: Initial fragment program\n"); tgsi_dump(tokens, 0); } diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 7f41ff0e2ec..d445df408dd 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -124,6 +124,9 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param) case PIPE_CAP_INDEP_BLEND_FUNC: case PIPE_CAP_DEPTH_CLAMP: /* XXX implemented, but breaks Regnum Online */ case PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE: + case PIPE_CAP_SHADER_STENCIL_EXPORT: + case PIPE_CAP_STREAM_OUTPUT: + case PIPE_CAP_PRIMITIVE_RESTART: return 0; /* Texturing. */ @@ -153,8 +156,8 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param) case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER: return 0; default: - fprintf(stderr, "r300: Implementation error: Bad param %d\n", - param); + debug_printf("r300: Warning: Unknown CAP %d in get_param.\n", + param); return 0; } } @@ -264,8 +267,8 @@ static float r300_get_paramf(struct pipe_screen* pscreen, enum pipe_cap param) case PIPE_CAP_MAX_TEXTURE_LOD_BIAS: return 16.0f; default: - fprintf(stderr, "r300: Implementation error: Bad paramf %d\n", - param); + debug_printf("r300: Warning: Unknown CAP %d in get_paramf.\n", + param); return 0.0f; } } diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h index dc2bc7e8279..8b7f1fab61b 100644 --- a/src/gallium/drivers/r300/r300_screen.h +++ b/src/gallium/drivers/r300/r300_screen.h @@ -102,6 +102,7 @@ r300_winsys_screen(struct pipe_screen *screen) { #define DBG_NO_CBZB (1 << 21) /* Statistics. */ #define DBG_STATS (1 << 24) +#define DBG_P_STAT (1 << 25) /*@}*/ static INLINE boolean SCREEN_DBG_ON(struct r300_screen * screen, unsigned flags) diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index 904736ef06d..50366e32c2b 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -620,14 +620,20 @@ static uint32_t r300_get_border_color(enum pipe_format format, } break; + case 16: + r = ((float_to_ubyte(border_swizzled[2]) & 0xff) << 0) | + ((float_to_ubyte(border_swizzled[1]) & 0xff) << 8) | + ((float_to_ubyte(border_swizzled[0]) & 0xff) << 16) | + ((float_to_ubyte(border_swizzled[3]) & 0xff) << 24); + break; + + case 8: default: - /* I think the fat formats (16, 32) are specified - * as the 8-bit ones. I am not sure how compressed formats - * work here. */ r = ((float_to_ubyte(border_swizzled[0]) & 0xff) << 0) | ((float_to_ubyte(border_swizzled[1]) & 0xff) << 8) | ((float_to_ubyte(border_swizzled[2]) & 0xff) << 16) | ((float_to_ubyte(border_swizzled[3]) & 0xff) << 24); + break; } return r; diff --git a/src/gallium/drivers/r300/r300_vs.c b/src/gallium/drivers/r300/r300_vs.c index e2b9af9d018..65696555ac3 100644 --- a/src/gallium/drivers/r300/r300_vs.c +++ b/src/gallium/drivers/r300/r300_vs.c @@ -202,7 +202,8 @@ void r300_translate_vertex_shader(struct r300_context *r300, memset(&compiler, 0, sizeof(compiler)); rc_init(&compiler.Base); - compiler.Base.Debug = DBG_ON(r300, DBG_VP); + DBG_ON(r300, DBG_VP) ? compiler.Base.Debug |= RC_DBG_LOG : 0; + DBG_ON(r300, DBG_P_STAT) ? compiler.Base.Debug |= RC_DBG_STATS : 0; compiler.code = &vs->code; compiler.UserData = vs; compiler.Base.is_r500 = r300->screen->caps.is_r500; @@ -214,7 +215,7 @@ void r300_translate_vertex_shader(struct r300_context *r300, compiler.Base.max_alu_insts = r300->screen->caps.is_r500 ? 1024 : 256; compiler.Base.remove_unused_constants = TRUE; - if (compiler.Base.Debug) { + if (compiler.Base.Debug & RC_DBG_LOG) { DBG(r300, DBG_VP, "r300: Initial vertex program\n"); tgsi_dump(vs->state.tokens, 0); } |