📄 hk_public.h
字号:
int picked_upick_id; int picked_svn; int start_en; int picked_en;};/* Pick results buffer */typedef struct Hk_pick_hits Hk_pick_hits;struct Hk_pick_hits { int max_num_pick_hits; int circular_writes; int pick_hits_detected; Hk_pick_hit pick_hit_item[1]; /* [max_num_pick_hits] */};/* Pick box */typedef struct Hk_pick_box Hk_pick_box;struct Hk_pick_box { float x_left; float y_bottom; float z_back; float x_right; float y_top; float z_front;};/* Light mask update */typedef struct Hk_light_mask_update Hk_light_mask_update;struct Hk_light_mask_update { unsigned light_mask_del; unsigned light_mask_add;};/* Light */typedef struct Hk_light Hk_light;struct Hk_light { Hk_light_type ls_type; float lr, lg, lb; /* Light color (Hk_rgb) */ float px, py, pz; /* Light position (Hk_xyz) */ float dx, dy, dz; /* Light direction (Hk_xyz) */ float ls_exp; float ls_atten1, ls_atten2; float ls_angle;};/* Light source */typedef struct Hk_light_source Hk_light_source;struct Hk_light_source { int light_num; Hk_light light;};/* Surface tessellation info */typedef struct Hk_surface_tessellation Hk_surface_tessellation;struct Hk_surface_tessellation { Hk_surface_tessellation **next; Hk_surf_type surf_approx_type; Hk_dmatrix matrix; Hk_matrix_type matrix_type; int trim_curves_exist; double trim_approx_value; Hk_curve_type trim_approx_type; Hk_curve_placement iso_curve_placement; int iso_curve_ucount; int iso_curve_vcount; int iso_curves_exist; float cutoff_top_u; float cutoff_bottom_u; float cutoff_top_v; float cutoff_bottom_v; unsigned packet[1];};/* Curve tessellation info */typedef struct Hk_curve_tessellation Hk_curve_tessellation;struct Hk_curve_tessellation { Hk_curve_tessellation **next; Hk_curve_type approx_type; Hk_dmatrix matrix; Hk_matrix_type matrix_type; float cutoff_top; float cutoff_bottom; unsigned packet[1];};/* Stochastic setup */typedef struct Hk_stochastic_setup Hk_stochastic_setup;struct Hk_stochastic_setup { int ss_pass_num; int ss_display_flag; float ss_norm_scale; float ss_x_offset; float ss_y_offset; float ss_filter_weights[HKSS_FILTER_SIZE_X][HKSS_FILTER_SIZE_Y];};/* Scratch buffer for annotation text and spline curves */typedef struct Hk_scratch_buffer Hk_scratch_buffer;struct Hk_scratch_buffer { int num_words; int buffer[1]; /* [num_words] */};/* Definition of state attribute mask (used by push/pop state, etc) */typedef unsigned Hk_state_list[HKST_NUM_WORDS];/* *********************************************************************** * WARNING: The following typedefs must be kept in sync with the * corresponding GT typedefs: Hk_buffer, Hk_plane_group, Hk_wlut_update, * and Hk_clut_update. *********************************************************************** *//* Window lookup table update structures */typedef struct Hk_wlut_update Hk_wlut_update;struct Hk_wlut_update { int entry; unsigned mask; Hk_buffer image_buffer; Hk_buffer overlay_buffer; Hk_plane_group plane_group; int clut; int fast_clear_set;};/* Color lookup table update structure */typedef struct Hk_clut_update Hk_clut_update;struct Hk_clut_update { int table; int start_entry; int num_entries; unsigned colors[1];};/* Fast clear background color structure */typedef struct Hk_fcbg_update Hk_fcbg_update;struct Hk_fcbg_update { int fast_clear_set; unsigned color; /* Packed RGB (actually abgr) */};#endif !LOCORE/* *-------------------------------------------------------------- * * Definition of state bits for push/pop state and restore partial ctx * * Several Hawk instructions take a bit mask which represents a list * of attributes to be saved/restored/flushed/etc. This bit mask is * stored as eight 32-bit words and is organized as follows: * * +----------------------+ * 0 | unbundled attributes | * 1 | | * +----------------------+ * 2 | bundle-able attrs | * 3 | (individual) | * +----------------------+ * 4 | bundle-able attrs | * 5 | (bundled) | * +----------------------+ * 6 | bundle-able attrs | * 7 | (asf) | * +----------------------+ * *-------------------------------------------------------------- *//* Bit definitions for word 0 of state list (unbundled attributes) */#define HKST0_OTHER 0x80000000#define HKST0_LINE_GEOM_FORMAT 0x40000000#define HKST0_LINE_OFF_COLOR 0x20000000#define HKST0_TRI_GEOM_FORMAT 0x10000000#define HKST0_USE_BACK_PROPS 0x08000000#define HKST0_SILHOUETTE_EDGE 0x04000000#define HKST0_FACE_CULLING_MODE 0x02000000#define HKST0_EDGE_OFF_COLOR 0x01000000#define HKST0_EDGE_Z_OFFSET 0x00800000#define HKST0_RTEXT_UP_VEC 0x00400000#define HKST0_RTEXT_PATH 0x00200000#define HKST0_RTEXT_HEIGHT 0x00100000#define HKST0_RTEXT_ALIGNMENT 0x00080000#define HKST0_RTEXT_SLANT 0x00040000#define HKST0_ATEXT_UP_VEC 0x00020000#define HKST0_ATEXT_PATH 0x00010000#define HKST0_ATEXT_HEIGHT 0x00008000#define HKST0_ATEXT_ALIGNMENT 0x00004000#define HKST0_ATEXT_STYLE 0x00002000#define HKST0_ATEXT_SLANT 0x00001000#define HKST0_MARKER_GEOM_FORMAT 0x00000800#define HKST0_Z_BUFFER_COMPARE 0x00000400#define HKST0_Z_BUFFER_UPDATE 0x00000200#define HKST0_DEPTH_CUE_ENABLE 0x00000100#define HKST0_DEPTH_CUE_PARAMETERS 0x00000080#define HKST0_DEPTH_CUE_COLOR 0x00000040#define HKST0_VIEW 0x00000020#define HKST0_Z_RANGE 0x00000010#define HKST0_GUARD_BAND 0x00000008#define HKST0_LMT 0x00000004#define HKST0_GMT 0x00000002#define HKST0_CMT 0x00000001/* Bit definitions for word 1 of state list (unbundled attributes) */#define HKST1_NAME_SET 0x80000000#define HKST1_MCP_MASK 0x40000000#define HKST1_NUM_MCP 0x20000000#define HKST1_MCP 0x10000000#define HKST1_CSVN 0x08000000#define HKST1_UPICK_ID 0x04000000#define HKST1_LIGHT_MASK 0x02000000#define HKST1_INVISIBILITY 0x01000000#define HKST1_RASTER_OP 0x00800000#define HKST1_PLANE_MASK 0x00400000#define HKST1_CURRENT_WID 0x00200000#define HKST1_WID_CLIP_MASK 0x00100000#define HKST1_WID_WRITE_MASK 0x00080000#define HKST1_HIGHLIGHT_COLOR 0x00040000/* * Bit definitions for the following: * * Word 2 of state list (bundle-able attributes -- individual) * Word 4 of state list (bundle-able attributes -- bundled) * Word 6 of state list (bundle-able attributes -- asf) */#define HKSTB0_LINE_COLOR 0x80000000#define HKSTB0_LINE_ANTIALIASING 0x40000000#define HKSTB0_LINE_SHADING_METHOD 0x20000000#define HKSTB0_LINE_STYLE 0x10000000#define HKSTB0_LINE_PATTERN 0x08000000#define HKSTB0_LINE_WIDTH 0x04000000#define HKSTB0_LINE_CAP 0x02000000#define HKSTB0_LINE_JOIN 0x01000000#define HKSTB0_LINE_MITER_LIMIT 0x00800000#define HKSTB0_CURVE_APPROX 0x00400000#define HKSTB0_TEXT_COLOR 0x00200000#define HKSTB0_TEXT_ANTIALIASING 0x00100000#define HKSTB0_TEXT_EXPANSION_FACTOR 0x00080000#define HKSTB0_TEXT_SPACING 0x00040000#define HKSTB0_TEXT_LINE_WIDTH 0x00020000#define HKSTB0_TEXT_CAP 0x00010000#define HKSTB0_TEXT_JOIN 0x00008000#define HKSTB0_TEXT_MITER_LIMIT 0x00004000#define HKSTB0_TEXT_CHARACTER_SET 0x00002000#define HKSTB0_TEXT_FONT 0x00001000#define HKSTB0_MARKER_COLOR 0x00000800#define HKSTB0_MARKER_ANTIALIASING 0x00000400#define HKSTB0_MARKER_SIZE 0x00000200#define HKSTB0_MARKER_TYPE 0x00000100/* * Bit definitions for the following: * * Word 3 of state list (bundle-able attributes -- individual) * Word 5 of state list (bundle-able attributes -- bundled) * Word 7 of state list (bundle-able attributes -- asf) */#define HKSTB1_FRONT_INTERIOR_STYLE 0x80000000#define HKSTB1_BACK_INTERIOR_STYLE 0x40000000#define HKSTB1_FRONT_GENERAL_STYLE 0x20000000#define HKSTB1_BACK_GENERAL_STYLE 0x10000000#define HKSTB1_FRONT_SURFACE_COLOR 0x08000000#define HKSTB1_BACK_SURFACE_COLOR 0x04000000#define HKSTB1_FRONT_SHADING_METHOD 0x02000000#define HKSTB1_BACK_SHADING_METHOD 0x01000000#define HKSTB1_FRONT_LIGHTING_DEGREE 0x00800000#define HKSTB1_BACK_LIGHTING_DEGREE 0x00400000#define HKSTB1_FRONT_MATERIAL_PROPERTIES 0x00200000#define HKSTB1_BACK_MATERIAL_PROPERTIES 0x00100000#define HKSTB1_FRONT_SPECULAR_COLOR 0x00080000#define HKSTB1_BACK_SPECULAR_COLOR 0x00040000#define HKSTB1_FRONT_TRANSPARENCY_DEGREE 0x00020000#define HKSTB1_BACK_TRANSPARENCY_DEGREE 0x00010000#define HKSTB1_FRONT_HATCH_STYLE 0x00008000#define HKSTB1_BACK_HATCH_STYLE 0x00004000#define HKSTB1_HOLLOW_ANTIALIASING 0x00002000#define HKSTB1_EDGE 0x00001000#define HKSTB1_EDGE_ANTIALIASING 0x00000800#define HKSTB1_EDGE_COLOR 0x00000400#define HKSTB1_EDGE_STYLE 0x00000200#define HKSTB1_EDGE_PATTERN 0x00000100#define HKSTB1_EDGE_WIDTH 0x00000080#define HKSTB1_EDGE_CAP 0x00000040#define HKSTB1_EDGE_JOIN 0x00000020#define HKSTB1_EDGE_MITER_LIMIT 0x00000010#define HKSTB1_SURF_APPROX 0x00000008#define HKSTB1_TRIM_APPROX 0x00000004#define HKSTB1_ISO_CURVE_INFO 0x00000002/* *-------------------------------------------------------------- * * Definitions for bit positions within command word * * The general format for the Hawk data manipulation opcodes: * * 3 2 2 1 1 1 1 * 1 4 1 9 8 6 5 0 * +--------+--+---+---+----------------+ * | op |--|reg|am | n | * +--------+--+---+---+----------------+ * * where: * op is the primary opcode * reg is the destination register (source for a store instrustion). * am is the addressing mode (or 2nd register for arithmetic instructions) * n is the count or offset for the command * * The format for Hawk geometry commands: * * 3 2 2 1 1 * 1 4 3 6 5 0 * +--------+--------+----------------+ * | op | flags | vertex_count | * +--------+--------+----------------+ * * where: * op is the primary opcode * flags is an optional geometry flags parameter * vertex_count is the number of vertices that follow * * The format for Hawk set attribute opcodes: * * 3 2 2 1 1 1 1 * 1 7 6 9 8 6 5 0 * +-----+--------+---+----------------+ * | op | attr |am | offset | * +-----+--------+---+----------------+ * * where: * op is the primary opcode (HK_OP_SET_ATTR_*) * Note: op is 8 bits normally. * attr is the secondary opcode (the attribute to set) * am is the addressing mode * offset is the offset for register indirect addressing * * The format for Hawk update lookup table opcodes: * * 3 2 22 1 1 1 * 1 4 32 8 6 5 0 * +--------+--+---+---+----------------+ * | op |so|---|am | offset | * +--------+--+---+---+----------------+ * * where: * op is the primary opcode (HK_OP_UPDATE_LUT) * so is the sub-opcode * am is the addressing mode * offset is the offset for register indirect addressing * *-------------------------------------------------------------- *//* For all commands */#define HK_OP_POS 24#define HK_OP_BITS 8#define HK_NUM_OP (1 << HK_OP_BITS)#define HK_OP_MASK (HK_NUM_OP - 1)/* Note: The definition of HK_EXTRACT_OP is being simplified to avoid * the overhead of masking off bits that are known to be 0. * The more general definition is: * * #define HK_EXTRACT_OP(inst) (((inst) >> HK_OP_POS) & HK_OP_MASK) * * The following is guaranteed to work because a right shift of an * unsigned integer zero-fills from the left and assures that all * bits which we would have masked off are already zero. */#define HK_EXTRACT_OP(inst) (((unsigned) (inst)) >> HK_OP_POS)/* Register for arithmetic and load/store commands */#define HK_REG_POS 19#define HK_REG_BITS 3#define HK_NUM_REG (1 << HK_REG_BITS)#define HK_REG_MASK (HK_NUM_REG - 1)#define HK_EXTRACT_REG(inst) (((inst) >> HK_REG_POS) & HK_REG_MASK)/* Addressing mode or 2nd register */#define HK_AM_POS 16#define HK_AM_BITS 3#define HK_NUM_AM (1 << HK_AM_BITS)#define HK_AM_MASK (HK_NUM_AM - 1)#define HK_EXTRACT_AM(inst) (((inst) >> HK_AM_POS) & HK_AM_MASK)/* Signed offset or count */#define HK_OFFSET_POS 0#define HK_OFFSET_BITS 16 /* Must be 16 bits */#define HK_NUM_OFFSET (1 << HK_OFFSET_BITS)#define HK_OFFSET_MASK (HK_NUM_OFFSET - 1)#define HK_EXTRACT_OFFSET(inst) (((inst) >> HK_OFFSET_POS) & HK_OFFSET_MASK)#define HK_EXTRACT_SHORT_INT(inst) (((inst) >> HK_OFFSET_POS) & HK_OFFSET_MASK)#define HK_MAX_OFFSET (HK_OFFSET_MASK >> 1) /* +32767 */#define HK_MIN_OFFSET (-HK_MAX_OFFSET - 1) /* -32768 *//* Unsigned vertex count */#define HK_VCOUNT_POS 0#define HK_VCOUNT_BITS 16#define HK_NUM_VCOUNT (1 << HK_VCOUNT_BITS)#define HK_VCOUNT_MASK (HK_NUM_VCOUNT - 1)#define HK_EXTRACT_VCOUNT(inst) (((inst) >> HK_VCOUNT_POS) & HK_VCOUNT_MASK)/* Geometry flags */#define HK_GFLAGS_POS 16#define HK_GFLAGS_BITS 8#define HK_NUM_GFLAGS (1 << HK_GFLAGS_BITS)#define HK_GFLAGS_MASK (HK_NUM_GFLAGS - 1)#define HK_EXTRACT_GFLAGS(inst) (((inst) >> HK_GFLAGS_POS) & HK_GFLAGS_MASK)/* Code for TRAP instructions */#define HK_TCODE_POS 16#define HK_TCODE_BITS 8#define HK_NUM_TCODE (1 << HK_TCODE_BITS)#define HK_TCODE_MASK (HK_NUM_TCODE - 1)#define HK_EXTRACT_TCODE(inst) (((inst) >> HK_TCODE_POS) & HK_TCODE_MASK)/* Attribute to set for SET_ATTR command */#define HK_ATTR_POS 19#define HK_ATTR_BITS 8#define HK_NUM_ATTR (1 << HK_ATTR_BITS)#define HK_ATTR_MASK (HK_NUM_ATTR - 1)/* Bits to look at once the main command is decoded */#define HK_ATTR_SUB_BITS 5#define HK_NUM_SUB_ATTR (1 << HK_ATTR_SUB_BITS)#define HK_ATTR_SUB_MASK (HK_NUM_SUB_ATTR - 1)#define HK_EXTRACT_ATTR(inst) (((inst) >> HK_ATTR_POS) & HK_ATTR_SUB_MASK)/* ASF bit position for the SET_ATTR command */#define HK_ASF_POS 0#define HK_ASF_BITS 1#define HK_NUM_ASF (1 << HK_ASF_BITS)#define HK_ASF_MASK (HK_NUM_ASF - 1)#define HK_EXTRACT_ASF(inst) (((inst) >> HK_ASF_POS) & HK_ASF_MASK)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -