Path: blob/21.2-virgl/src/gallium/drivers/freedreno/a6xx/fd6_program.h
4574 views
/*1* Copyright (C) 2016 Rob Clark <[email protected]>2* Copyright © 2018 Google, Inc.3*4* Permission is hereby granted, free of charge, to any person obtaining a5* copy of this software and associated documentation files (the "Software"),6* to deal in the Software without restriction, including without limitation7* the rights to use, copy, modify, merge, publish, distribute, sublicense,8* and/or sell copies of the Software, and to permit persons to whom the9* Software is furnished to do so, subject to the following conditions:10*11* The above copyright notice and this permission notice (including the next12* paragraph) shall be included in all copies or substantial portions of the13* Software.14*15* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR16* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,17* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL18* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER19* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,20* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE21* SOFTWARE.22*23* Authors:24* Rob Clark <[email protected]>25*/2627#ifndef FD6_PROGRAM_H_28#define FD6_PROGRAM_H_2930#include "pipe/p_context.h"31#include "freedreno_context.h"3233#include "ir3/ir3_shader.h"34#include "ir3_cache.h"3536struct fd6_emit;3738struct fd6_program_state {39struct ir3_program_state base;40struct ir3_shader_variant *bs; /* binning pass vs */41struct ir3_shader_variant *vs;42struct ir3_shader_variant *hs;43struct ir3_shader_variant *ds;44struct ir3_shader_variant *gs;45struct ir3_shader_variant *fs;46struct fd_ringbuffer *config_stateobj;47struct fd_ringbuffer *interp_stateobj;48struct fd_ringbuffer *binning_stateobj;49struct fd_ringbuffer *streamout_stateobj;50struct fd_ringbuffer *stateobj;5152struct ir3_stream_output_info *stream_output;5354/**55* Output components from frag shader. It is possible to have56* a fragment shader that only writes a subset of the bound57* render targets.58*/59uint32_t mrt_components;60};6162static inline struct fd6_program_state *63fd6_program_state(struct ir3_program_state *state)64{65return (struct fd6_program_state *)state;66}6768static inline const struct ir3_shader_variant *69fd6_last_shader(const struct fd6_program_state *state)70{71if (state->gs)72return state->gs;73else if (state->ds)74return state->ds;75else76return state->vs;77}7879void fd6_emit_shader(struct fd_context *ctx, struct fd_ringbuffer *ring,80const struct ir3_shader_variant *so) assert_dt;8182struct fd_ringbuffer *fd6_program_interp_state(struct fd6_emit *emit) assert_dt;8384void fd6_prog_init(struct pipe_context *pctx);8586#endif /* FD6_PROGRAM_H_ */878889