virgl: add debug-switch to output TGSI
This is quite useful for debugging shader-transpiling issues in virglrenderer. Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
This commit is contained in:
parent
4ab06cc56e
commit
a4e60ccb56
|
@ -274,6 +274,9 @@ int virgl_encode_shader_state(struct virgl_context *ctx,
|
||||||
if (bret == false)
|
if (bret == false)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (virgl_debug & VIRGL_DEBUG_TGSI)
|
||||||
|
debug_printf("TGSI:\n---8<---\n%s\n---8<---\n", str);
|
||||||
|
|
||||||
shader_len = strlen(str) + 1;
|
shader_len = strlen(str) + 1;
|
||||||
|
|
||||||
left_bytes = shader_len;
|
left_bytes = shader_len;
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
int virgl_debug = 0;
|
int virgl_debug = 0;
|
||||||
static const struct debug_named_value debug_options[] = {
|
static const struct debug_named_value debug_options[] = {
|
||||||
{ "verbose", VIRGL_DEBUG_VERBOSE, NULL },
|
{ "verbose", VIRGL_DEBUG_VERBOSE, NULL },
|
||||||
|
{ "tgsi", VIRGL_DEBUG_TGSI, NULL },
|
||||||
DEBUG_NAMED_VALUE_END
|
DEBUG_NAMED_VALUE_END
|
||||||
};
|
};
|
||||||
DEBUG_GET_ONCE_FLAGS_OPTION(virgl_debug, "VIRGL_DEBUG", debug_options, 0)
|
DEBUG_GET_ONCE_FLAGS_OPTION(virgl_debug, "VIRGL_DEBUG", debug_options, 0)
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "virgl_winsys.h"
|
#include "virgl_winsys.h"
|
||||||
|
|
||||||
#define VIRGL_DEBUG_VERBOSE 1
|
#define VIRGL_DEBUG_VERBOSE 1
|
||||||
|
#define VIRGL_DEBUG_TGSI 2
|
||||||
extern int virgl_debug;
|
extern int virgl_debug;
|
||||||
|
|
||||||
struct virgl_screen {
|
struct virgl_screen {
|
||||||
|
|
Loading…
Reference in New Issue