1af69d88dSmrg/* 2af69d88dSmrg * Copyright (C) 2012 Rob Clark <robclark@freedesktop.org> 3af69d88dSmrg * 4af69d88dSmrg * Permission is hereby granted, free of charge, to any person obtaining a 5af69d88dSmrg * copy of this software and associated documentation files (the "Software"), 6af69d88dSmrg * to deal in the Software without restriction, including without limitation 7af69d88dSmrg * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8af69d88dSmrg * and/or sell copies of the Software, and to permit persons to whom the 9af69d88dSmrg * Software is furnished to do so, subject to the following conditions: 10af69d88dSmrg * 11af69d88dSmrg * The above copyright notice and this permission notice (including the next 12af69d88dSmrg * paragraph) shall be included in all copies or substantial portions of the 13af69d88dSmrg * Software. 14af69d88dSmrg * 15af69d88dSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16af69d88dSmrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17af69d88dSmrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18af69d88dSmrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19af69d88dSmrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20af69d88dSmrg * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21af69d88dSmrg * SOFTWARE. 22af69d88dSmrg * 23af69d88dSmrg * Authors: 24af69d88dSmrg * Rob Clark <robclark@freedesktop.org> 25af69d88dSmrg */ 26af69d88dSmrg 27af69d88dSmrg#ifndef FREEDRENO_STATE_H_ 28af69d88dSmrg#define FREEDRENO_STATE_H_ 29af69d88dSmrg 30af69d88dSmrg#include "pipe/p_context.h" 31af69d88dSmrg#include "freedreno_context.h" 32af69d88dSmrg 337ec681f3Smrgstatic inline bool 347ec681f3Smrgfd_depth_enabled(struct fd_context *ctx) assert_dt 35af69d88dSmrg{ 367ec681f3Smrg return ctx->zsa && ctx->zsa->depth_enabled; 37af69d88dSmrg} 38af69d88dSmrg 397ec681f3Smrgstatic inline bool 407ec681f3Smrgfd_depth_write_enabled(struct fd_context *ctx) assert_dt 419f464c52Smaya{ 427ec681f3Smrg return ctx->zsa && ctx->zsa->depth_writemask; 439f464c52Smaya} 449f464c52Smaya 457ec681f3Smrgstatic inline bool 467ec681f3Smrgfd_stencil_enabled(struct fd_context *ctx) assert_dt 47af69d88dSmrg{ 487ec681f3Smrg return ctx->zsa && ctx->zsa->stencil[0].enabled; 49af69d88dSmrg} 50af69d88dSmrg 517ec681f3Smrgstatic inline bool 527ec681f3Smrgfd_blend_enabled(struct fd_context *ctx, unsigned n) assert_dt 53af69d88dSmrg{ 547ec681f3Smrg return ctx->blend && ctx->blend->rt[n].blend_enable; 55af69d88dSmrg} 56af69d88dSmrg 577ec681f3Smrgstatic inline bool 587ec681f3Smrgfd_depth_clamp_enabled(struct fd_context *ctx) assert_dt 59af69d88dSmrg{ 607ec681f3Smrg return !(ctx->rasterizer->depth_clip_near && 617ec681f3Smrg ctx->rasterizer->depth_clip_far); 62af69d88dSmrg} 63af69d88dSmrg 647ec681f3Smrgvoid fd_set_shader_images(struct pipe_context *pctx, 657ec681f3Smrg enum pipe_shader_type shader, unsigned start, 667ec681f3Smrg unsigned count, unsigned unbind_num_trailing_slots, 677ec681f3Smrg const struct pipe_image_view *images); 687ec681f3Smrg 697ec681f3Smrgvoid fd_set_framebuffer_state(struct pipe_context *pctx, 707ec681f3Smrg const struct pipe_framebuffer_state *framebuffer) in_dt; 717ec681f3Smrg 72af69d88dSmrgvoid fd_state_init(struct pipe_context *pctx); 73af69d88dSmrg 74af69d88dSmrg#endif /* FREEDRENO_STATE_H_ */ 75