Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. /*
  2.  Copyright (C) Intel Corp.  2006.  All Rights Reserved.
  3.  Intel funded Tungsten Graphics to
  4.  develop this 3D driver.
  5.  
  6.  Permission is hereby granted, free of charge, to any person obtaining
  7.  a copy of this software and associated documentation files (the
  8.  "Software"), to deal in the Software without restriction, including
  9.  without limitation the rights to use, copy, modify, merge, publish,
  10.  distribute, sublicense, and/or sell copies of the Software, and to
  11.  permit persons to whom the Software is furnished to do so, subject to
  12.  the following conditions:
  13.  
  14.  The above copyright notice and this permission notice (including the
  15.  next paragraph) shall be included in all copies or substantial
  16.  portions of the Software.
  17.  
  18.  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  19.  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  20.  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  21.  IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
  22.  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  23.  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  24.  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  25.  
  26.  **********************************************************************/
  27.  /*
  28.   * Authors:
  29.   *   Keith Whitwell <keithw@vmware.com>
  30.   */
  31.  
  32.  
  33. #ifndef BRW_SF_H
  34. #define BRW_SF_H
  35.  
  36.  
  37. #include "program/program.h"
  38. #include "brw_context.h"
  39. #include "brw_eu.h"
  40.  
  41.  
  42. #define SF_POINTS    0
  43. #define SF_LINES     1
  44. #define SF_TRIANGLES 2
  45. #define SF_UNFILLED_TRIS   3
  46.  
  47. struct brw_sf_prog_key {
  48.    GLbitfield64 attrs;
  49.    struct interpolation_mode_map interpolation_mode;
  50.    uint8_t point_sprite_coord_replace;
  51.    GLuint primitive:2;
  52.    GLuint do_twoside_color:1;
  53.    GLuint frontface_ccw:1;
  54.    GLuint do_point_sprite:1;
  55.    GLuint do_point_coord:1;
  56.    GLuint sprite_origin_lower_left:1;
  57.    GLuint userclip_active:1;
  58. };
  59.  
  60. struct brw_sf_compile {
  61.    struct brw_codegen func;
  62.    struct brw_sf_prog_key key;
  63.    struct brw_sf_prog_data prog_data;
  64.  
  65.    struct brw_reg pv;
  66.    struct brw_reg det;
  67.    struct brw_reg dx0;
  68.    struct brw_reg dx2;
  69.    struct brw_reg dy0;
  70.    struct brw_reg dy2;
  71.  
  72.    /* z and 1/w passed in seperately:
  73.     */
  74.    struct brw_reg z[3];
  75.    struct brw_reg inv_w[3];
  76.  
  77.    /* The vertices:
  78.     */
  79.    struct brw_reg vert[3];
  80.  
  81.     /* Temporaries, allocated after last vertex reg.
  82.     */
  83.    struct brw_reg inv_det;
  84.    struct brw_reg a1_sub_a0;
  85.    struct brw_reg a2_sub_a0;
  86.    struct brw_reg tmp;
  87.  
  88.    struct brw_reg m1Cx;
  89.    struct brw_reg m2Cy;
  90.    struct brw_reg m3C0;
  91.  
  92.    GLuint nr_verts;
  93.    GLuint nr_attr_regs;
  94.    GLuint nr_setup_regs;
  95.    int urb_entry_read_offset;
  96.  
  97.    /** The last known value of the f0.0 flag register. */
  98.    unsigned flag_value;
  99.  
  100.    struct brw_vue_map vue_map;
  101.    bool has_flat_shading;
  102. };
  103.  
  104.  
  105. void brw_emit_tri_setup( struct brw_sf_compile *c, bool allocate );
  106. void brw_emit_line_setup( struct brw_sf_compile *c, bool allocate );
  107. void brw_emit_point_setup( struct brw_sf_compile *c, bool allocate );
  108. void brw_emit_point_sprite_setup( struct brw_sf_compile *c, bool allocate );
  109. void brw_emit_anyprim_setup( struct brw_sf_compile *c );
  110.  
  111. #endif
  112.