freedreno/a6xx: Add ARB_depth_clamp and separate clamp support.
[mesa.git] / src / gallium / drivers / freedreno / freedreno_state.h
index c966bdcc51d213a9553e96724e44ce45c3dac8b1..ac65c44921db88b8990625be483c71cb92f7b534 100644 (file)
@@ -1,5 +1,3 @@
-/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
-
 /*
  * Copyright (C) 2012 Rob Clark <robclark@freedesktop.org>
  *
 
 static inline bool fd_depth_enabled(struct fd_context *ctx)
 {
-       return ctx->zsa->depth.enabled;
+       return ctx->zsa && ctx->zsa->depth.enabled;
+}
+
+static inline bool fd_depth_write_enabled(struct fd_context *ctx)
+{
+       return ctx->zsa && ctx->zsa->depth.writemask;
 }
 
 static inline bool fd_stencil_enabled(struct fd_context *ctx)
 {
-       return ctx->zsa->stencil[0].enabled;
+       return ctx->zsa && ctx->zsa->stencil[0].enabled;
+}
+
+static inline bool fd_logicop_enabled(struct fd_context *ctx)
+{
+       return ctx->blend && ctx->blend->logicop_enable;
 }
 
+static inline bool fd_blend_enabled(struct fd_context *ctx, unsigned n)
+{
+       return ctx->blend && ctx->blend->rt[n].blend_enable;
+}
+
+static inline bool fd_depth_clamp_enabled(struct fd_context *ctx)
+{
+       return !(ctx->rasterizer->depth_clip_near && ctx->rasterizer->depth_clip_far);
+}
+
+void fd_set_shader_images(struct pipe_context *pctx,
+               enum pipe_shader_type shader,
+               unsigned start, unsigned count,
+               const struct pipe_image_view *images);
+
 void fd_state_init(struct pipe_context *pctx);
 
 #endif /* FREEDRENO_STATE_H_ */