summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/radeonsi_pipe.c
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2012-08-08 15:35:42 +0200
committerMichel Dänzer <[email protected]>2012-08-08 15:33:38 +0200
commit82cd9c0fc2838a153006a646b0d356ed54b8680e (patch)
tree6e7665c1a14593555c74839da57b165cfe0dd994 /src/gallium/drivers/radeonsi/radeonsi_pipe.c
parentbe42a45e023aed5fd82647719bb81bee49a9a2ac (diff)
radeonsi: If pixel shader compilation fails, use a dummy shader.
Otherwise we're likely to hang the GPU. Signed-off-by: Michel Dänzer <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/radeonsi_pipe.c')
-rw-r--r--src/gallium/drivers/radeonsi/radeonsi_pipe.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/radeonsi_pipe.c b/src/gallium/drivers/radeonsi/radeonsi_pipe.c
index 3c5eaf7d61c..9ee96a06200 100644
--- a/src/gallium/drivers/radeonsi/radeonsi_pipe.c
+++ b/src/gallium/drivers/radeonsi/radeonsi_pipe.c
@@ -37,6 +37,7 @@
#include "util/u_pack_color.h"
#include "util/u_memory.h"
#include "util/u_inlines.h"
+#include "util/u_simple_shaders.h"
#include "util/u_upload_mgr.h"
#include "vl/vl_decoder.h"
#include "vl/vl_video_buffer.h"
@@ -171,6 +172,9 @@ static void r600_destroy_context(struct pipe_context *context)
{
struct r600_context *rctx = (struct r600_context *)context;
+ if (rctx->dummy_pixel_shader) {
+ rctx->context.delete_fs_state(&rctx->context, rctx->dummy_pixel_shader);
+ }
rctx->context.delete_depth_stencil_alpha_state(&rctx->context, rctx->custom_dsa_flush);
util_unreference_framebuffer_state(&rctx->framebuffer);
@@ -251,6 +255,12 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void
r600_get_backend_mask(rctx); /* this emits commands and must be last */
+ rctx->dummy_pixel_shader =
+ util_make_fragment_cloneinput_shader(&rctx->context, 0,
+ TGSI_SEMANTIC_GENERIC,
+ TGSI_INTERPOLATE_CONSTANT);
+ rctx->context.bind_fs_state(&rctx->context, rctx->dummy_pixel_shader);
+
return &rctx->context;
}