1668
1670
release_tmps( c, mark );
1673
/* For the four-dimensional case, the little micro-optimisation benefits
1674
we obtain by unrolling all the loops aren't worth the massive bloat it
1675
now causes. Instead, we loop twice around performing a similar operation
1676
to noise3, once for the w=0 cube and once for the w=1, with a bit more
1677
code to glue it all together. */
1678
static void noise4_sub( struct brw_wm_compile *c ) {
1680
struct brw_compile *p = &c->func;
1681
struct brw_reg param[ 4 ],
1682
x0y0, x0y1, x1y0, x1y1, /* gradients at four of the corners */
1683
w0, /* noise for the w=0 cube */
1684
floors[ 2 ], /* integer coordinates of base corner of hypercube */
1685
interp[ 4 ], /* interpolation coefficients */
1686
t, tmp[ 8 ], /* float temporaries */
1687
itmp[ 8 ], /* unsigned integer temporaries (aliases of floats above) */
1688
wtmp[ 8 ]; /* 16-way unsigned word temporaries (aliases of above) */
1690
int mark = mark_tmps( c );
1691
GLuint loop, origin;
1693
x0y0 = alloc_tmp( c );
1694
x0y1 = alloc_tmp( c );
1695
x1y0 = alloc_tmp( c );
1696
x1y1 = alloc_tmp( c );
1698
w0 = alloc_tmp( c );
1699
floors[ 0 ] = retype( alloc_tmp( c ), BRW_REGISTER_TYPE_UD );
1700
floors[ 1 ] = retype( alloc_tmp( c ), BRW_REGISTER_TYPE_UD );
1702
for( i = 0; i < 4; i++ ) {
1703
param[ i ] = lookup_tmp( c, mark - 5 + i );
1704
interp[ i ] = alloc_tmp( c );
1707
for( i = 0; i < 8; i++ ) {
1708
tmp[ i ] = alloc_tmp( c );
1709
itmp[ i ] = retype( tmp[ i ], BRW_REGISTER_TYPE_UD );
1710
wtmp[ i ] = brw_uw16_grf( tmp[ i ].nr, 0 );
1713
brw_set_access_mode( p, BRW_ALIGN_1 );
1715
/* We only want 16 bits of precision from the integral part of each
1716
co-ordinate, but unfortunately the RNDD semantics would saturate
1717
at 16 bits if we performed the operation directly to a 16-bit
1718
destination. Therefore, we round to 32-bit temporaries where
1719
appropriate, and then store only the lower 16 bits. */
1720
brw_RNDD( p, retype( floors[ 0 ], BRW_REGISTER_TYPE_D ), param[ 0 ] );
1721
brw_RNDD( p, retype( itmp[ 0 ], BRW_REGISTER_TYPE_D ), param[ 1 ] );
1722
brw_RNDD( p, retype( floors[ 1 ], BRW_REGISTER_TYPE_D ), param[ 2 ] );
1723
brw_RNDD( p, retype( itmp[ 1 ], BRW_REGISTER_TYPE_D ), param[ 3 ] );
1724
brw_MOV( p, high_words( floors[ 0 ] ), low_words( itmp[ 0 ] ) );
1725
brw_MOV( p, high_words( floors[ 1 ] ), low_words( itmp[ 1 ] ) );
1727
/* Modify the flag register here, because the side effect is useful
1728
later (see below). We know for certain that all flags will be
1729
cleared, since the FRC instruction cannot possibly generate
1730
negative results. Even for exceptional inputs (infinities, denormals,
1731
NaNs), the architecture guarantees that the L conditional is false. */
1732
brw_set_conditionalmod( p, BRW_CONDITIONAL_L );
1733
brw_FRC( p, param[ 0 ], param[ 0 ] );
1734
brw_set_predicate_control( p, BRW_PREDICATE_NONE );
1735
for( i = 1; i < 4; i++ )
1736
brw_FRC( p, param[ i ], param[ i ] );
1738
/* Calculate the interpolation coefficients (6t^5 - 15t^4 + 10t^3) first
1740
for( i = 0; i < 4; i++ )
1741
brw_MUL( p, interp[ i ], param[ i ], brw_imm_f( 6.0 ) );
1742
for( i = 0; i < 4; i++ )
1743
brw_ADD( p, interp[ i ], interp[ i ], brw_imm_f( -15.0 ) );
1744
for( i = 0; i < 4; i++ )
1745
brw_MUL( p, interp[ i ], interp[ i ], param[ i ] );
1746
for( i = 0; i < 4; i++ )
1747
brw_ADD( p, interp[ i ], interp[ i ], brw_imm_f( 10.0 ) );
1748
for( j = 0; j < 3; j++ )
1749
for( i = 0; i < 4; i++ )
1750
brw_MUL( p, interp[ i ], interp[ i ], param[ i ] );
1752
/* Mark the current address, as it will be a jump destination. The
1753
following code will be executed twice: first, with the flag
1754
register clear indicating the w=0 case, and second with flags
1758
/* Arrange the eight corner coordinates into scalars (itmp0..itmp3) to
1759
be hashed. Since we have only 16 bits of precision in the hash, we
1760
must be careful about thorough mixing to maintain entropy as we
1761
squash the input vector into a small scalar. */
1762
brw_MUL( p, brw_null_reg(), low_words( floors[ 0 ] ),
1763
brw_imm_uw( 0xBC8F ) );
1764
brw_MAC( p, brw_null_reg(), high_words( floors[ 0 ] ),
1765
brw_imm_uw( 0xD0BD ) );
1766
brw_MAC( p, brw_null_reg(), low_words( floors[ 1 ] ),
1767
brw_imm_uw( 0x9B93 ) );
1768
brw_MAC( p, low_words( itmp[ 0 ] ), high_words( floors[ 1 ] ),
1769
brw_imm_uw( 0xA359 ) );
1770
brw_ADD( p, high_words( itmp[ 0 ] ), low_words( itmp[ 0 ] ),
1771
brw_imm_uw( 0xBC8F ) );
1773
/* Temporarily disable the execution mask while we work with ExecSize=16
1774
channels (the mask is set for ExecSize=8 and is probably incorrect).
1775
Although this might cause execution of unwanted channels, the code
1776
writes only to temporary registers and has no side effects, so
1777
disabling the mask is harmless. */
1778
brw_push_insn_state( p );
1779
brw_set_mask_control( p, BRW_MASK_DISABLE );
1780
brw_ADD( p, wtmp[ 1 ], wtmp[ 0 ], brw_imm_uw( 0xD0BD ) );
1781
brw_ADD( p, wtmp[ 2 ], wtmp[ 0 ], brw_imm_uw( 0x9B93 ) );
1782
brw_ADD( p, wtmp[ 3 ], wtmp[ 1 ], brw_imm_uw( 0x9B93 ) );
1784
/* We're now ready to perform the hashing. The eight hashes are
1785
interleaved for performance. The hash function used is
1786
designed to rapidly achieve avalanche and require only 16x16
1787
bit multiplication, and 8-bit swizzles (which we get for
1789
for( i = 0; i < 4; i++ )
1790
brw_MUL( p, wtmp[ i ], wtmp[ i ], brw_imm_uw( 0x28D9 ) );
1791
for( i = 0; i < 4; i++ )
1792
brw_XOR( p, even_bytes( wtmp[ i ] ), even_bytes( wtmp[ i ] ),
1793
odd_bytes( wtmp[ i ] ) );
1794
for( i = 0; i < 4; i++ )
1795
brw_MUL( p, wtmp[ i ], wtmp[ i ], brw_imm_uw( 0xC6D5 ) );
1796
for( i = 0; i < 4; i++ )
1797
brw_XOR( p, even_bytes( wtmp[ i ] ), even_bytes( wtmp[ i ] ),
1798
odd_bytes( wtmp[ i ] ) );
1799
brw_pop_insn_state( p );
1801
/* Now we want to initialise the four rear gradients based on the
1802
hashes. Format conversion from signed integer to float leaves
1803
everything scaled too high by a factor of pow( 2, 15 ), but
1804
we correct for that right at the end. */
1806
brw_ADD( p, t, param[ 0 ], brw_imm_f( -1.0 ) );
1807
brw_MOV( p, x0y0, low_words( tmp[ 0 ] ) );
1808
brw_MOV( p, x0y1, low_words( tmp[ 1 ] ) );
1809
brw_MOV( p, x1y0, high_words( tmp[ 0 ] ) );
1810
brw_MOV( p, x1y1, high_words( tmp[ 1 ] ) );
1812
brw_push_insn_state( p );
1813
brw_set_mask_control( p, BRW_MASK_DISABLE );
1814
brw_SHL( p, wtmp[ 0 ], wtmp[ 0 ], brw_imm_uw( 4 ) );
1815
brw_SHL( p, wtmp[ 1 ], wtmp[ 1 ], brw_imm_uw( 4 ) );
1816
brw_pop_insn_state( p );
1818
brw_MUL( p, x1y0, x1y0, t );
1819
brw_MUL( p, x1y1, x1y1, t );
1820
brw_ADD( p, t, param[ 1 ], brw_imm_f( -1.0 ) );
1821
brw_MUL( p, x0y0, x0y0, param[ 0 ] );
1822
brw_MUL( p, x0y1, x0y1, param[ 0 ] );
1825
brw_MOV( p, tmp[ 5 ], low_words( tmp[ 1 ] ) );
1826
brw_MOV( p, tmp[ 7 ], high_words( tmp[ 1 ] ) );
1827
brw_MOV( p, tmp[ 4 ], low_words( tmp[ 0 ] ) );
1828
brw_MOV( p, tmp[ 6 ], high_words( tmp[ 0 ] ) );
1830
brw_push_insn_state( p );
1831
brw_set_mask_control( p, BRW_MASK_DISABLE );
1832
brw_SHL( p, wtmp[ 0 ], wtmp[ 0 ], brw_imm_uw( 4 ) );
1833
brw_SHL( p, wtmp[ 1 ], wtmp[ 1 ], brw_imm_uw( 4 ) );
1834
brw_pop_insn_state( p );
1836
brw_MUL( p, tmp[ 5 ], tmp[ 5 ], t );
1837
brw_MUL( p, tmp[ 7 ], tmp[ 7 ], t );
1838
/* prepare t for the w component (used below): w the first time through
1839
the loop; w - 1 the second time) */
1840
brw_set_predicate_control( p, BRW_PREDICATE_NORMAL );
1841
brw_ADD( p, t, param[ 3 ], brw_imm_f( -1.0 ) );
1842
p->current->header.predicate_inverse = 1;
1843
brw_MOV( p, t, param[ 3 ] );
1844
p->current->header.predicate_inverse = 0;
1845
brw_set_predicate_control( p, BRW_PREDICATE_NONE );
1846
brw_MUL( p, tmp[ 4 ], tmp[ 4 ], param[ 1 ] );
1847
brw_MUL( p, tmp[ 6 ], tmp[ 6 ], param[ 1 ] );
1849
brw_ADD( p, x0y1, x0y1, tmp[ 5 ] );
1850
brw_ADD( p, x1y1, x1y1, tmp[ 7 ] );
1851
brw_ADD( p, x0y0, x0y0, tmp[ 4 ] );
1852
brw_ADD( p, x1y0, x1y0, tmp[ 6 ] );
1855
brw_MOV( p, tmp[ 4 ], low_words( tmp[ 0 ] ) );
1856
brw_MOV( p, tmp[ 5 ], low_words( tmp[ 1 ] ) );
1857
brw_MOV( p, tmp[ 6 ], high_words( tmp[ 0 ] ) );
1858
brw_MOV( p, tmp[ 7 ], high_words( tmp[ 1 ] ) );
1860
brw_push_insn_state( p );
1861
brw_set_mask_control( p, BRW_MASK_DISABLE );
1862
brw_SHL( p, wtmp[ 0 ], wtmp[ 0 ], brw_imm_uw( 4 ) );
1863
brw_SHL( p, wtmp[ 1 ], wtmp[ 1 ], brw_imm_uw( 4 ) );
1864
brw_pop_insn_state( p );
1866
brw_MUL( p, tmp[ 4 ], tmp[ 4 ], param[ 2 ] );
1867
brw_MUL( p, tmp[ 5 ], tmp[ 5 ], param[ 2 ] );
1868
brw_MUL( p, tmp[ 6 ], tmp[ 6 ], param[ 2 ] );
1869
brw_MUL( p, tmp[ 7 ], tmp[ 7 ], param[ 2 ] );
1871
brw_ADD( p, x0y0, x0y0, tmp[ 4 ] );
1872
brw_ADD( p, x0y1, x0y1, tmp[ 5 ] );
1873
brw_ADD( p, x1y0, x1y0, tmp[ 6 ] );
1874
brw_ADD( p, x1y1, x1y1, tmp[ 7 ] );
1877
brw_MOV( p, tmp[ 4 ], low_words( tmp[ 0 ] ) );
1878
brw_MOV( p, tmp[ 5 ], low_words( tmp[ 1 ] ) );
1879
brw_MOV( p, tmp[ 6 ], high_words( tmp[ 0 ] ) );
1880
brw_MOV( p, tmp[ 7 ], high_words( tmp[ 1 ] ) );
1882
brw_MUL( p, tmp[ 4 ], tmp[ 4 ], t );
1883
brw_MUL( p, tmp[ 5 ], tmp[ 5 ], t );
1884
brw_MUL( p, tmp[ 6 ], tmp[ 6 ], t );
1885
brw_MUL( p, tmp[ 7 ], tmp[ 7 ], t );
1886
brw_ADD( p, t, param[ 0 ], brw_imm_f( -1.0 ) );
1888
brw_ADD( p, x0y0, x0y0, tmp[ 4 ] );
1889
brw_ADD( p, x0y1, x0y1, tmp[ 5 ] );
1890
brw_ADD( p, x1y0, x1y0, tmp[ 6 ] );
1891
brw_ADD( p, x1y1, x1y1, tmp[ 7 ] );
1893
/* Here we interpolate in the y dimension... */
1894
brw_ADD( p, x0y1, x0y1, negate( x0y0 ) );
1895
brw_ADD( p, x1y1, x1y1, negate( x1y0 ) );
1896
brw_MUL( p, x0y1, x0y1, interp[ 1 ] );
1897
brw_MUL( p, x1y1, x1y1, interp[ 1 ] );
1898
brw_ADD( p, x0y0, x0y0, x0y1 );
1899
brw_ADD( p, x1y0, x1y0, x1y1 );
1901
/* And now in x. Leave the result in tmp[ 0 ] (see below)... */
1902
brw_ADD( p, x1y0, x1y0, negate( x0y0 ) );
1903
brw_MUL( p, x1y0, x1y0, interp[ 0 ] );
1904
brw_ADD( p, tmp[ 0 ], x0y0, x1y0 );
1906
/* Now do the same thing for the front four gradients... */
1908
brw_MOV( p, x0y0, low_words( tmp[ 2 ] ) );
1909
brw_MOV( p, x0y1, low_words( tmp[ 3 ] ) );
1910
brw_MOV( p, x1y0, high_words( tmp[ 2 ] ) );
1911
brw_MOV( p, x1y1, high_words( tmp[ 3 ] ) );
1913
brw_push_insn_state( p );
1914
brw_set_mask_control( p, BRW_MASK_DISABLE );
1915
brw_SHL( p, wtmp[ 2 ], wtmp[ 2 ], brw_imm_uw( 4 ) );
1916
brw_SHL( p, wtmp[ 3 ], wtmp[ 3 ], brw_imm_uw( 4 ) );
1917
brw_pop_insn_state( p );
1919
brw_MUL( p, x1y0, x1y0, t );
1920
brw_MUL( p, x1y1, x1y1, t );
1921
brw_ADD( p, t, param[ 1 ], brw_imm_f( -1.0 ) );
1922
brw_MUL( p, x0y0, x0y0, param[ 0 ] );
1923
brw_MUL( p, x0y1, x0y1, param[ 0 ] );
1926
brw_MOV( p, tmp[ 5 ], low_words( tmp[ 3 ] ) );
1927
brw_MOV( p, tmp[ 7 ], high_words( tmp[ 3 ] ) );
1928
brw_MOV( p, tmp[ 4 ], low_words( tmp[ 2 ] ) );
1929
brw_MOV( p, tmp[ 6 ], high_words( tmp[ 2 ] ) );
1931
brw_push_insn_state( p );
1932
brw_set_mask_control( p, BRW_MASK_DISABLE );
1933
brw_SHL( p, wtmp[ 2 ], wtmp[ 2 ], brw_imm_uw( 4 ) );
1934
brw_SHL( p, wtmp[ 3 ], wtmp[ 3 ], brw_imm_uw( 4 ) );
1935
brw_pop_insn_state( p );
1937
brw_MUL( p, tmp[ 5 ], tmp[ 5 ], t );
1938
brw_MUL( p, tmp[ 7 ], tmp[ 7 ], t );
1939
brw_ADD( p, t, param[ 2 ], brw_imm_f( -1.0 ) );
1940
brw_MUL( p, tmp[ 4 ], tmp[ 4 ], param[ 1 ] );
1941
brw_MUL( p, tmp[ 6 ], tmp[ 6 ], param[ 1 ] );
1943
brw_ADD( p, x0y1, x0y1, tmp[ 5 ] );
1944
brw_ADD( p, x1y1, x1y1, tmp[ 7 ] );
1945
brw_ADD( p, x0y0, x0y0, tmp[ 4 ] );
1946
brw_ADD( p, x1y0, x1y0, tmp[ 6 ] );
1949
brw_MOV( p, tmp[ 4 ], low_words( tmp[ 2 ] ) );
1950
brw_MOV( p, tmp[ 5 ], low_words( tmp[ 3 ] ) );
1951
brw_MOV( p, tmp[ 6 ], high_words( tmp[ 2 ] ) );
1952
brw_MOV( p, tmp[ 7 ], high_words( tmp[ 3 ] ) );
1954
brw_push_insn_state( p );
1955
brw_set_mask_control( p, BRW_MASK_DISABLE );
1956
brw_SHL( p, wtmp[ 2 ], wtmp[ 2 ], brw_imm_uw( 4 ) );
1957
brw_SHL( p, wtmp[ 3 ], wtmp[ 3 ], brw_imm_uw( 4 ) );
1958
brw_pop_insn_state( p );
1960
brw_MUL( p, tmp[ 4 ], tmp[ 4 ], t );
1961
brw_MUL( p, tmp[ 5 ], tmp[ 5 ], t );
1962
brw_MUL( p, tmp[ 6 ], tmp[ 6 ], t );
1963
brw_MUL( p, tmp[ 7 ], tmp[ 7 ], t );
1964
/* prepare t for the w component (used below): w the first time through
1965
the loop; w - 1 the second time) */
1966
brw_set_predicate_control( p, BRW_PREDICATE_NORMAL );
1967
brw_ADD( p, t, param[ 3 ], brw_imm_f( -1.0 ) );
1968
p->current->header.predicate_inverse = 1;
1969
brw_MOV( p, t, param[ 3 ] );
1970
p->current->header.predicate_inverse = 0;
1971
brw_set_predicate_control( p, BRW_PREDICATE_NONE );
1973
brw_ADD( p, x0y0, x0y0, tmp[ 4 ] );
1974
brw_ADD( p, x0y1, x0y1, tmp[ 5 ] );
1975
brw_ADD( p, x1y0, x1y0, tmp[ 6 ] );
1976
brw_ADD( p, x1y1, x1y1, tmp[ 7 ] );
1979
brw_MOV( p, tmp[ 4 ], low_words( tmp[ 2 ] ) );
1980
brw_MOV( p, tmp[ 5 ], low_words( tmp[ 3 ] ) );
1981
brw_MOV( p, tmp[ 6 ], high_words( tmp[ 2 ] ) );
1982
brw_MOV( p, tmp[ 7 ], high_words( tmp[ 3 ] ) );
1984
brw_MUL( p, tmp[ 4 ], tmp[ 4 ], t );
1985
brw_MUL( p, tmp[ 5 ], tmp[ 5 ], t );
1986
brw_MUL( p, tmp[ 6 ], tmp[ 6 ], t );
1987
brw_MUL( p, tmp[ 7 ], tmp[ 7 ], t );
1989
brw_ADD( p, x0y0, x0y0, tmp[ 4 ] );
1990
brw_ADD( p, x0y1, x0y1, tmp[ 5 ] );
1991
brw_ADD( p, x1y0, x1y0, tmp[ 6 ] );
1992
brw_ADD( p, x1y1, x1y1, tmp[ 7 ] );
1994
/* Interpolate in the y dimension: */
1995
brw_ADD( p, x0y1, x0y1, negate( x0y0 ) );
1996
brw_ADD( p, x1y1, x1y1, negate( x1y0 ) );
1997
brw_MUL( p, x0y1, x0y1, interp[ 1 ] );
1998
brw_MUL( p, x1y1, x1y1, interp[ 1 ] );
1999
brw_ADD( p, x0y0, x0y0, x0y1 );
2000
brw_ADD( p, x1y0, x1y0, x1y1 );
2002
/* And now in x. The rear face is in tmp[ 0 ] (see above), so this
2003
time put the front face in tmp[ 1 ] and we're nearly there... */
2004
brw_ADD( p, x1y0, x1y0, negate( x0y0 ) );
2005
brw_MUL( p, x1y0, x1y0, interp[ 0 ] );
2006
brw_ADD( p, tmp[ 1 ], x0y0, x1y0 );
2008
/* Another interpolation, in the z dimension: */
2009
brw_ADD( p, tmp[ 1 ], tmp[ 1 ], negate( tmp[ 0 ] ) );
2010
brw_MUL( p, tmp[ 1 ], tmp[ 1 ], interp[ 2 ] );
2011
brw_ADD( p, tmp[ 0 ], tmp[ 0 ], tmp[ 1 ] );
2013
/* Exit the loop if we've computed both cubes... */
2014
origin = p->nr_insn;
2015
brw_push_insn_state( p );
2016
brw_set_predicate_control( p, BRW_PREDICATE_NORMAL );
2017
brw_set_mask_control( p, BRW_MASK_DISABLE );
2018
brw_ADD( p, brw_ip_reg(), brw_ip_reg(), brw_imm_d( 0 ) );
2019
brw_pop_insn_state( p );
2021
/* Save the result for the w=0 case, and increment the w coordinate: */
2022
brw_MOV( p, w0, tmp[ 0 ] );
2023
brw_ADD( p, high_words( floors[ 1 ] ), high_words( floors[ 1 ] ),
2026
/* Loop around for the other cube. Explicitly set the flag register
2027
(unfortunately we must spend an extra instruction to do this: we
2028
can't rely on a side effect of the previous MOV or ADD because
2029
conditional modifiers which are normally true might be false in
2030
exceptional circumstances, e.g. given a NaN input; the add to
2031
brw_ip_reg() is not suitable because the IP is not an 8-vector). */
2032
brw_push_insn_state( p );
2033
brw_set_mask_control( p, BRW_MASK_DISABLE );
2034
brw_MOV( p, brw_flag_reg(), brw_imm_uw( 0xFF ) );
2035
brw_ADD( p, brw_ip_reg(), brw_ip_reg(),
2036
brw_imm_d( ( loop - p->nr_insn ) << 4 ) );
2037
brw_pop_insn_state( p );
2039
/* Patch the previous conditional branch now that we know the
2040
destination address. */
2041
brw_set_src1( p->store + origin,
2042
brw_imm_d( ( p->nr_insn - origin ) << 4 ) );
2044
/* The very last interpolation. */
2045
brw_ADD( p, tmp[ 0 ], tmp[ 0 ], negate( w0 ) );
2046
brw_MUL( p, tmp[ 0 ], tmp[ 0 ], interp[ 3 ] );
2047
brw_ADD( p, tmp[ 0 ], tmp[ 0 ], w0 );
2049
/* scale by pow( 2, -15 ), as described above */
2050
brw_MUL( p, param[ 0 ], tmp[ 0 ], brw_imm_f( 0.000030517578125 ) );
2052
release_tmps( c, mark );
2055
static void emit_noise4( struct brw_wm_compile *c,
2056
struct prog_instruction *inst )
2058
struct brw_compile *p = &c->func;
2059
struct brw_reg src0, src1, src2, src3, param0, param1, param2, param3, dst;
2060
GLuint mask = inst->DstReg.WriteMask;
2062
int mark = mark_tmps( c );
2064
assert( mark == 0 );
2066
src0 = get_src_reg( c, inst->SrcReg, 0, 1 );
2067
src1 = get_src_reg( c, inst->SrcReg, 1, 1 );
2068
src2 = get_src_reg( c, inst->SrcReg, 2, 1 );
2069
src3 = get_src_reg( c, inst->SrcReg, 3, 1 );
2071
param0 = alloc_tmp( c );
2072
param1 = alloc_tmp( c );
2073
param2 = alloc_tmp( c );
2074
param3 = alloc_tmp( c );
2076
brw_MOV( p, param0, src0 );
2077
brw_MOV( p, param1, src1 );
2078
brw_MOV( p, param2, src2 );
2079
brw_MOV( p, param3, src3 );
2081
invoke_subroutine( c, SUB_NOISE4, noise4_sub );
2083
/* Fill in the result: */
2084
brw_set_saturate( p, inst->SaturateMode == SATURATE_ZERO_ONE );
2085
for (i = 0 ; i < 4; i++) {
2086
if (mask & (1<<i)) {
2087
dst = get_dst_reg(c, inst, i, 1);
2088
brw_MOV( p, dst, param0 );
2091
if( inst->SaturateMode == SATURATE_ZERO_ONE )
2092
brw_set_saturate( p, 0 );
2094
release_tmps( c, mark );
1671
2097
static void emit_wpos_xy(struct brw_wm_compile *c,
1672
2098
struct prog_instruction *inst)