Path: blob/21.2-virgl/src/gallium/drivers/freedreno/freedreno_state.h
4570 views
/*1* Copyright (C) 2012 Rob Clark <[email protected]>2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice (including the next11* paragraph) shall be included in all copies or substantial portions of the12* Software.13*14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR15* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,16* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL17* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER18* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,19* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE20* SOFTWARE.21*22* Authors:23* Rob Clark <[email protected]>24*/2526#ifndef FREEDRENO_STATE_H_27#define FREEDRENO_STATE_H_2829#include "pipe/p_context.h"30#include "freedreno_context.h"3132static inline bool33fd_depth_enabled(struct fd_context *ctx) assert_dt34{35return ctx->zsa && ctx->zsa->depth_enabled;36}3738static inline bool39fd_depth_write_enabled(struct fd_context *ctx) assert_dt40{41return ctx->zsa && ctx->zsa->depth_writemask;42}4344static inline bool45fd_stencil_enabled(struct fd_context *ctx) assert_dt46{47return ctx->zsa && ctx->zsa->stencil[0].enabled;48}4950static inline bool51fd_blend_enabled(struct fd_context *ctx, unsigned n) assert_dt52{53return ctx->blend && ctx->blend->rt[n].blend_enable;54}5556static inline bool57fd_depth_clamp_enabled(struct fd_context *ctx) assert_dt58{59return !(ctx->rasterizer->depth_clip_near &&60ctx->rasterizer->depth_clip_far);61}6263void fd_set_shader_images(struct pipe_context *pctx,64enum pipe_shader_type shader, unsigned start,65unsigned count, unsigned unbind_num_trailing_slots,66const struct pipe_image_view *images);6768void fd_set_framebuffer_state(struct pipe_context *pctx,69const struct pipe_framebuffer_state *framebuffer) in_dt;7071void fd_state_init(struct pipe_context *pctx);7273#endif /* FREEDRENO_STATE_H_ */747576