aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/d3d1x/gd3d11
diff options
context:
space:
mode:
authorLuca Barbieri <[email protected]>2010-09-23 18:03:06 +0200
committerLuca Barbieri <[email protected]>2010-09-24 09:15:49 +0200
commitf71f8c7d18a1a92681c337cb6dbf507ab06b62b1 (patch)
tree961310273c901eaa9e3ebe45227dfa3ea7144b4e /src/gallium/state_trackers/d3d1x/gd3d11
parent11cd1612a1f0f7225ccb22c1197074c57b46aa26 (diff)
d3d1x: add shader dumping
Diffstat (limited to 'src/gallium/state_trackers/d3d1x/gd3d11')
-rw-r--r--src/gallium/state_trackers/d3d1x/gd3d11/d3d11.cpp1
-rw-r--r--src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h10
2 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11.cpp b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11.cpp
index 962bea5ce95..42678fab4d0 100644
--- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11.cpp
+++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11.cpp
@@ -30,6 +30,7 @@ extern "C"
{
#include "util/u_gen_mipmap.h"
#include "tgsi/tgsi_ureg.h"
+#include "tgsi/tgsi_dump.h"
#include "cso_cache/cso_context.h"
}
diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h
index 61b1ba2bd3e..c41117080a2 100644
--- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h
+++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h
@@ -24,6 +24,8 @@
*
**************************************************************************/
+DEBUG_GET_ONCE_BOOL_OPTION(dump_shaders, "D3D1X_DUMP_SHADERS", FALSE);
+
/* These cap sets are much more correct than the ones in u_caps.c */
/* TODO: it seems cube levels should be the same as 2D levels */
@@ -1166,6 +1168,8 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen
#endif
)
{
+ bool dump = debug_get_option_dump_shaders();
+
dxbc_chunk_header* sm4_chunk = dxbc_find_shader_bytecode(shader_bytecode, bytecode_length);
if(!sm4_chunk)
return 0;
@@ -1174,12 +1178,18 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen
if(!sm4.get())
return 0;
+ if(dump)
+ sm4->dump();
+
struct pipe_shader_state tgsi_shader;
memset(&tgsi_shader, 0, sizeof(tgsi_shader));
tgsi_shader.tokens = (const tgsi_token*)sm4_to_tgsi(*sm4);
if(!tgsi_shader.tokens)
return 0;
+ if(dump)
+ tgsi_dump(tgsi_shader.tokens, 0);
+
void* shader_cso;
GalliumD3D11Shader<>* shader;