diff options
author | Nicolai Hähnle <[email protected]> | 2017-06-09 15:12:23 +0200 |
---|---|---|
committer | Nicolai Hähnle <[email protected]> | 2017-07-05 12:27:11 +0200 |
commit | d91f97f91db4a826f7d5909a2a63a028a81188bb (patch) | |
tree | 402952f3b784482fe4b51d9fab77885d52307bb4 /src/gallium/drivers/ddebug/dd_context.c | |
parent | 10e1d2d9aa4b8fb240923c7b9b3d0bb3ce3b731a (diff) |
ddebug: handle some cases of non-TGSI shaders
NIR shaders are not captured properly in pipelined mode currently. This
would require shader cloning, which requires linking all the Gallium
drivers against NIR. We can always do that later.
v2: avoid immediate crashes in pipelined mode
Reviewed-by: Marek Olšák <[email protected]> (v1)
Diffstat (limited to 'src/gallium/drivers/ddebug/dd_context.c')
-rw-r--r-- | src/gallium/drivers/ddebug/dd_context.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/ddebug/dd_context.c b/src/gallium/drivers/ddebug/dd_context.c index 1ace9e52eb7..6b1ddc9d46b 100644 --- a/src/gallium/drivers/ddebug/dd_context.c +++ b/src/gallium/drivers/ddebug/dd_context.c @@ -314,7 +314,8 @@ DD_CSO_DELETE(vertex_elements) struct dd_state *hstate = state; \ \ pipe->delete_##name##_state(pipe, hstate->cso); \ - tgsi_free_tokens(hstate->state.shader.tokens); \ + if (hstate->state.shader.type == PIPE_SHADER_IR_TGSI) \ + tgsi_free_tokens(hstate->state.shader.tokens); \ FREE(hstate); \ } @@ -330,7 +331,8 @@ DD_CSO_DELETE(vertex_elements) return NULL; \ hstate->cso = pipe->create_##name##_state(pipe, state); \ hstate->state.shader = *state; \ - hstate->state.shader.tokens = tgsi_dup_tokens(state->tokens); \ + if (hstate->state.shader.type == PIPE_SHADER_IR_TGSI) \ + hstate->state.shader.tokens = tgsi_dup_tokens(state->tokens); \ return hstate; \ } \ \ |