1 /* 2 * Copyright © 2014 Rob Clark <[email protected]> 3 * SPDX-License-Identifier: MIT 4 * 5 * Authors: 6 * Rob Clark <[email protected]> 7 */ 8 9 #ifndef FD4_PROGRAM_H_ 10 #define FD4_PROGRAM_H_ 11 12 #include "pipe/p_context.h" 13 #include "freedreno_context.h" 14 15 #include "ir3/ir3_cache.h" 16 #include "ir3/ir3_shader.h" 17 18 struct fd4_emit; 19 20 struct fd4_program_state { 21 struct ir3_program_state base; 22 const struct ir3_shader_variant *bs; /* VS for when emit->binning */ 23 const struct ir3_shader_variant *vs; 24 const struct ir3_shader_variant *fs; /* FS for when !emit->binning */ 25 }; 26 27 static inline struct fd4_program_state * fd4_program_state(struct ir3_program_state * state)28fd4_program_state(struct ir3_program_state *state) 29 { 30 return (struct fd4_program_state *)state; 31 } 32 33 void fd4_emit_shader(struct fd_ringbuffer *ring, 34 const struct ir3_shader_variant *so); 35 36 void fd4_program_emit(struct fd_ringbuffer *ring, struct fd4_emit *emit, int nr, 37 struct pipe_surface **bufs); 38 39 void fd4_prog_init(struct pipe_context *pctx); 40 41 #endif /* FD4_PROGRAM_H_ */ 42