r600g: add draw_vbo check for a NULL pixel shader
authorConstantine Kharlamov <Hi-Angel@yandex.ru>
Mon, 10 Apr 2017 20:04:36 +0000 (23:04 +0300)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 10 Apr 2017 20:45:22 +0000 (22:45 +0200)
Taken from radeonsi, required to remove dummy pixel shader in the next patch

Signed-off-by: Constantine Kharlamov <Hi-Angel@yandex.ru>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_pipe.h
src/gallium/drivers/r600/r600_state.c
src/gallium/drivers/r600/r600_state_common.c

index 371e7ce212298ba4b37b947b69f12a45e4155ac2..5697da4af9dc544ab97f03dd2fddad701c93a454 100644 (file)
@@ -471,6 +471,7 @@ static void *evergreen_create_rs_state(struct pipe_context *ctx,
        rs->clip_halfz = state->clip_halfz;
        rs->flatshade = state->flatshade;
        rs->sprite_coord_enable = state->sprite_coord_enable;
+       rs->rasterizer_discard = state->rasterizer_discard;
        rs->two_side = state->light_twoside;
        rs->clip_plane_enable = state->clip_plane_enable;
        rs->pa_sc_line_stipple = state->line_stipple_enable ?
index 86634b8681f18b59781fed638af022762dbfad96..7f1ecc278b68949322ead605c7f7c3f13c82b397 100644 (file)
@@ -279,6 +279,7 @@ struct r600_rasterizer_state {
        bool                            scissor_enable;
        bool                            multisample_enable;
        bool                            clip_halfz;
+       bool                            rasterizer_discard;
 };
 
 struct r600_poly_offset_state {
index 1f7e9b3aa52fd1f156aaeb2ff97af28e8c4c0b5b..06100abc4a4c2f4acc3d750da529dc83d2c4e9a8 100644 (file)
@@ -470,6 +470,7 @@ static void *r600_create_rs_state(struct pipe_context *ctx,
        rs->clip_halfz = state->clip_halfz;
        rs->flatshade = state->flatshade;
        rs->sprite_coord_enable = state->sprite_coord_enable;
+       rs->rasterizer_discard = state->rasterizer_discard;
        rs->two_side = state->light_twoside;
        rs->clip_plane_enable = state->clip_plane_enable;
        rs->pa_sc_line_stipple = state->line_stipple_enable ?
@@ -622,7 +623,7 @@ static void *r600_create_sampler_state(struct pipe_context *ctx,
 static struct pipe_sampler_view *
 texture_buffer_sampler_view(struct r600_pipe_sampler_view *view,
                            unsigned width0, unsigned height0)
-                           
+
 {
        struct r600_texture *tmp = (struct r600_texture*)view->base.texture;
        int stride = util_format_get_blocksize(view->base.format);
index 922030a1eda040735ef33fff609edaa111299bf5..5be49dcdfe94dc2bb6c1e3ab9e25cfdb27ad4497 100644 (file)
@@ -1712,7 +1712,12 @@ static void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info
                return;
        }
 
-       if (unlikely(!rctx->vs_shader || !rctx->ps_shader)) {
+       if (unlikely(!rctx->vs_shader)) {
+               assert(0);
+               return;
+       }
+       if (unlikely(!rctx->ps_shader &&
+                    (!rctx->rasterizer || !rctx->rasterizer->rasterizer_discard))) {
                assert(0);
                return;
        }