ps->arrays[n].gpr_count = size;
}
-static unsigned tgsi_get_processor_type(const struct tgsi_token *tokens)
-{
- struct tgsi_parse_context parse;
-
- if (tgsi_parse_init( &parse, tokens ) != TGSI_PARSE_OK) {
- debug_printf("tgsi_parse_init() failed in %s:%i!\n", __func__, __LINE__);
- return ~0;
- }
- return parse.FullHeader.Processor.Processor;
-}
-
-static bool r600_can_dump_shader(struct r600_screen *rscreen, unsigned processor_type)
-{
- switch (processor_type) {
- case TGSI_PROCESSOR_VERTEX:
- return (rscreen->b.debug_flags & DBG_VS) != 0;
- case TGSI_PROCESSOR_GEOMETRY:
- return (rscreen->b.debug_flags & DBG_GS) != 0;
- case TGSI_PROCESSOR_FRAGMENT:
- return (rscreen->b.debug_flags & DBG_PS) != 0;
- case TGSI_PROCESSOR_COMPUTE:
- return (rscreen->b.debug_flags & DBG_CS) != 0;
- default:
- return false;
- }
-}
-
static void r600_dump_streamout(struct pipe_stream_output_info *so)
{
unsigned i;
struct r600_pipe_shader_selector *sel = shader->selector;
int r, i;
uint32_t *ptr;
- bool dump = r600_can_dump_shader(rctx->screen, tgsi_get_processor_type(sel->tokens));
+ bool dump = r600_can_dump_shader(&rctx->screen->b, sel->tokens);
unsigned use_sb = !(rctx->screen->b.debug_flags & DBG_NO_SB);
unsigned sb_disasm = use_sb || (rctx->screen->b.debug_flags & DBG_SB_DISASM);
if (use_llvm) {
struct radeon_llvm_context radeon_llvm_ctx;
LLVMModuleRef mod;
- bool dump = r600_can_dump_shader(rscreen, ctx.type);
+ bool dump = r600_can_dump_shader(&rscreen->b, tokens);
boolean use_kill = false;
memset(&radeon_llvm_ctx, 0, sizeof(radeon_llvm_ctx));
*/
#include "r600_pipe_common.h"
+#include "tgsi/tgsi_parse.h"
static const struct debug_named_value common_debug_options[] = {
/* logging */
rctx->vram += rr->buf->size;
}
}
+
+static unsigned tgsi_get_processor_type(const struct tgsi_token *tokens)
+{
+ struct tgsi_parse_context parse;
+
+ if (tgsi_parse_init( &parse, tokens ) != TGSI_PARSE_OK) {
+ debug_printf("tgsi_parse_init() failed in %s:%i!\n", __func__, __LINE__);
+ return ~0;
+ }
+ return parse.FullHeader.Processor.Processor;
+}
+
+bool r600_can_dump_shader(struct r600_common_screen *rscreen,
+ const struct tgsi_token *tokens)
+{
+ switch (tgsi_get_processor_type(tokens)) {
+ case TGSI_PROCESSOR_VERTEX:
+ return (rscreen->debug_flags & DBG_VS) != 0;
+ case TGSI_PROCESSOR_GEOMETRY:
+ return (rscreen->debug_flags & DBG_GS) != 0;
+ case TGSI_PROCESSOR_FRAGMENT:
+ return (rscreen->debug_flags & DBG_PS) != 0;
+ case TGSI_PROCESSOR_COMPUTE:
+ return (rscreen->debug_flags & DBG_CS) != 0;
+ default:
+ return false;
+ }
+}
struct r600_common_screen *rscreen);
void r600_common_context_cleanup(struct r600_common_context *rctx);
void r600_context_add_resource_size(struct pipe_context *ctx, struct pipe_resource *r);
+bool r600_can_dump_shader(struct r600_common_screen *rscreen,
+ const struct tgsi_token *tokens);
/* r600_streamout.c */
void r600_streamout_buffers_dirty(struct r600_common_context *rctx);
static const struct u_resource_vtbl r600_texture_vtbl;
-DEBUG_GET_ONCE_BOOL_OPTION(print_texdepth, "RADEON_PRINT_TEXDEPTH", FALSE);
-
/* The number of samples can be specified independently of the texture. */
static void r600_texture_get_fmask_info(struct r600_screen *rscreen,
struct r600_texture *rtex,
memset(map + rtex->cmask.offset, 0xCC, rtex->cmask.size);
}
- if (debug_get_option_print_texdepth() && rtex->is_depth) {
+ if (rscreen->b.debug_flags & DBG_TEX_DEPTH && rtex->is_depth) {
printf("Texture: npix_x=%u, npix_y=%u, npix_z=%u, blk_w=%u, "
"blk_h=%u, blk_d=%u, array_size=%u, last_level=%u, "
"bpe=%u, nsamples=%u, flags=%u\n",
r600_common_screen_init(&rscreen->b, ws);
+ if (debug_get_bool_option("RADEON_PRINT_TEXDEPTH", FALSE))
+ rscreen->b.debug_flags |= DBG_TEX_DEPTH;
+ if (debug_get_bool_option("RADEON_DUMP_SHADERS", FALSE))
+ rscreen->b.debug_flags |= DBG_FS | DBG_VS | DBG_GS | DBG_PS | DBG_CS;
+
if (r600_init_tiling(rscreen)) {
FREE(rscreen);
return NULL;
{
unsigned i;
uint32_t *ptr;
- bool dump;
struct radeon_llvm_binary binary;
-
- dump = debug_get_bool_option("RADEON_DUMP_SHADERS", FALSE);
+ bool dump = r600_can_dump_shader(&rctx->screen->b, shader->selector->tokens);
memset(&binary, 0, sizeof(binary));
radeon_llvm_compile(mod, &binary,
struct tgsi_shader_info shader_info;
struct lp_build_tgsi_context * bld_base;
LLVMModuleRef mod;
- bool dump;
int r = 0;
-
- dump = debug_get_bool_option("RADEON_DUMP_SHADERS", FALSE);
+ bool dump = r600_can_dump_shader(&rctx->screen->b, shader->selector->tokens);
assert(shader->shader.noutput == 0);
assert(shader->shader.ninterp == 0);