2 * Copyright 2010 Ben Skeggs
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
19 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 #ifndef __NV50_PROG_H__
24 #define __NV50_PROG_H__
28 #include "pipe/p_state.h"
29 #include "pipe/p_shader_tokens.h"
32 uint8_t id
; /* tgsi index */
33 uint8_t hw
; /* hw index, nv50 wants flat FP inputs last */
39 ubyte sn
; /* semantic name */
40 ubyte si
; /* semantic index */
43 struct nv50_stream_output_state
47 uint8_t num_attribs
[4];
53 struct pipe_shader_state pipe
;
63 unsigned parm_size
; /* size limit of uniform buffer */
64 uint32_t tls_space
; /* required local memory per thread */
66 ubyte max_gpr
; /* REG_ALLOC_TEMP */
67 ubyte max_out
; /* REG_ALLOC_RESULT or FP_RESULT_COUNT */
71 struct nv50_varying in
[16];
72 struct nv50_varying out
[16];
75 uint32_t attrs
[3]; /* VP_ATTR_EN_0,1 and VP_GP_BUILTIN_ATTR_EN */
76 ubyte psiz
; /* output slot of point size */
77 ubyte bfc
[2]; /* indices into varying for FFC (FP) or BFC (VP) */
79 ubyte clpd
[2]; /* output slot of clip distance[i]'s 1st component */
84 uint32_t flags
[2]; /* 0x19a8, 196c */
85 uint32_t interp
; /* 0x1988 */
86 uint32_t colors
; /* 0x1904 */
90 ubyte primid
; /* primitive id output register */
92 uint8_t prim_type
; /* point, line strip or tri strip */
95 void *fixups
; /* relocation records */
97 struct nouveau_heap
*mem
;
99 struct nv50_stream_output_state
*so
;
102 boolean
nv50_program_translate(struct nv50_program
*, uint16_t chipset
);
103 boolean
nv50_program_upload_code(struct nv50_context
*, struct nv50_program
*);
104 void nv50_program_destroy(struct nv50_context
*, struct nv50_program
*);
106 #endif /* __NV50_PROG_H__ */