/*
* Note that we'd actually want to skip position (as we won't use
* the attribute in the fs) but can't. The reason is that we don't
- * actually have a input/output map for setup (even though it looks
+ * actually have an input/output map for setup (even though it looks
* like we do...). Could adjust for this though even without a map
* (in llvmpipe_create_fs_state()).
*/
/* This needs LP_NEW_RASTERIZER because of draw_prepare_shader_outputs(). */
if (llvmpipe->dirty & (LP_NEW_RASTERIZER |
LP_NEW_FS |
+ LP_NEW_GS |
+ LP_NEW_TCS |
+ LP_NEW_TES |
LP_NEW_VS))
compute_vertex_info(llvmpipe);
LP_NEW_SAMPLER |
LP_NEW_SAMPLER_VIEW |
LP_NEW_OCCLUSION_QUERY))
- llvmpipe_update_fs( llvmpipe );
+ llvmpipe_update_fs(llvmpipe);
- if (llvmpipe->dirty & (LP_NEW_RASTERIZER)) {
+ if (llvmpipe->dirty & (LP_NEW_FS |
+ LP_NEW_FRAMEBUFFER |
+ LP_NEW_RASTERIZER |
+ LP_NEW_DEPTH_STENCIL_ALPHA)) {
+
+ /*
+ * Rasterization is disabled if there is no pixel shader and
+ * both depth and stencil testing are disabled:
+ * http://msdn.microsoft.com/en-us/library/windows/desktop/bb205125
+ * FIXME: set rasterizer_discard in state tracker instead.
+ */
+ boolean null_fs = !llvmpipe->fs ||
+ llvmpipe->fs->info.base.num_instructions <= 1;
boolean discard =
(llvmpipe->sample_mask & 1) == 0 ||
- (llvmpipe->rasterizer ? llvmpipe->rasterizer->rasterizer_discard : FALSE);
-
+ (llvmpipe->rasterizer ? llvmpipe->rasterizer->rasterizer_discard : FALSE) ||
+ (null_fs &&
+ !llvmpipe->depth_stencil->depth.enabled &&
+ !llvmpipe->depth_stencil->stencil[0].enabled);
lp_setup_set_rasterizer_discard(llvmpipe->setup, discard);
}
llvmpipe->stencil_ref.ref_value);
}
- if (llvmpipe->dirty & LP_NEW_CONSTANTS)
+ if (llvmpipe->dirty & LP_NEW_FS_CONSTANTS)
lp_setup_set_fs_constants(llvmpipe->setup,
- Elements(llvmpipe->constants[PIPE_SHADER_FRAGMENT]),
+ ARRAY_SIZE(llvmpipe->constants[PIPE_SHADER_FRAGMENT]),
llvmpipe->constants[PIPE_SHADER_FRAGMENT]);
+ if (llvmpipe->dirty & LP_NEW_FS_SSBOS)
+ lp_setup_set_fs_ssbos(llvmpipe->setup,
+ ARRAY_SIZE(llvmpipe->ssbos[PIPE_SHADER_FRAGMENT]),
+ llvmpipe->ssbos[PIPE_SHADER_FRAGMENT]);
+
+ if (llvmpipe->dirty & LP_NEW_FS_IMAGES)
+ lp_setup_set_fs_images(llvmpipe->setup,
+ ARRAY_SIZE(llvmpipe->images[PIPE_SHADER_FRAGMENT]),
+ llvmpipe->images[PIPE_SHADER_FRAGMENT]);
+
if (llvmpipe->dirty & (LP_NEW_SAMPLER_VIEW))
lp_setup_set_fragment_sampler_views(llvmpipe->setup,
llvmpipe->num_sampler_views[PIPE_SHADER_FRAGMENT],