diff options
| author | 2021-04-23 17:47:54 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:30 -0400 | |
| commit | 7ecc6de56ae01602b25408db8b6658d7a41a419a (patch) | |
| tree | 2bff17b5b55e9f37ac5e4031c77962216813d5d5 /src/shader_recompiler/frontend/ir/ir_emitter.cpp | |
| parent | shader: Initial OpenGL implementation (diff) | |
| download | yuzu-7ecc6de56ae01602b25408db8b6658d7a41a419a.tar.gz yuzu-7ecc6de56ae01602b25408db8b6658d7a41a419a.tar.xz yuzu-7ecc6de56ae01602b25408db8b6658d7a41a419a.zip | |
shader: Implement Int32 SUATOM/SURED
Diffstat (limited to 'src/shader_recompiler/frontend/ir/ir_emitter.cpp')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.cpp | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp index 5913fdeff..354d72c9b 100644 --- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp +++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp | |||
| @@ -1869,6 +1869,95 @@ void IREmitter::ImageWrite(const Value& handle, const Value& coords, const Value | |||
| 1869 | Inst(op, Flags{info}, handle, coords, color); | 1869 | Inst(op, Flags{info}, handle, coords, color); |
| 1870 | } | 1870 | } |
| 1871 | 1871 | ||
| 1872 | Value IREmitter::ImageAtomicIAdd(const Value& handle, const Value& coords, const Value& value, | ||
| 1873 | TextureInstInfo info) { | ||
| 1874 | const Opcode op{handle.IsImmediate() ? Opcode::BoundImageAtomicIAdd32 | ||
| 1875 | : Opcode::BindlessImageAtomicIAdd32}; | ||
| 1876 | return Inst(op, Flags{info}, handle, coords, value); | ||
| 1877 | } | ||
| 1878 | |||
| 1879 | Value IREmitter::ImageAtomicSMin(const Value& handle, const Value& coords, const Value& value, | ||
| 1880 | TextureInstInfo info) { | ||
| 1881 | const Opcode op{handle.IsImmediate() ? Opcode::BoundImageAtomicSMin32 | ||
| 1882 | : Opcode::BindlessImageAtomicSMin32}; | ||
| 1883 | return Inst(op, Flags{info}, handle, coords, value); | ||
| 1884 | } | ||
| 1885 | |||
| 1886 | Value IREmitter::ImageAtomicUMin(const Value& handle, const Value& coords, const Value& value, | ||
| 1887 | TextureInstInfo info) { | ||
| 1888 | const Opcode op{handle.IsImmediate() ? Opcode::BoundImageAtomicUMin32 | ||
| 1889 | : Opcode::BindlessImageAtomicUMin32}; | ||
| 1890 | return Inst(op, Flags{info}, handle, coords, value); | ||
| 1891 | } | ||
| 1892 | |||
| 1893 | Value IREmitter::ImageAtomicIMin(const Value& handle, const Value& coords, const Value& value, | ||
| 1894 | bool is_signed, TextureInstInfo info) { | ||
| 1895 | return is_signed ? ImageAtomicSMin(handle, coords, value, info) | ||
| 1896 | : ImageAtomicUMin(handle, coords, value, info); | ||
| 1897 | } | ||
| 1898 | |||
| 1899 | Value IREmitter::ImageAtomicSMax(const Value& handle, const Value& coords, const Value& value, | ||
| 1900 | TextureInstInfo info) { | ||
| 1901 | const Opcode op{handle.IsImmediate() ? Opcode::BoundImageAtomicSMax32 | ||
| 1902 | : Opcode::BindlessImageAtomicSMax32}; | ||
| 1903 | return Inst(op, Flags{info}, handle, coords, value); | ||
| 1904 | } | ||
| 1905 | |||
| 1906 | Value IREmitter::ImageAtomicUMax(const Value& handle, const Value& coords, const Value& value, | ||
| 1907 | TextureInstInfo info) { | ||
| 1908 | const Opcode op{handle.IsImmediate() ? Opcode::BoundImageAtomicUMax32 | ||
| 1909 | : Opcode::BindlessImageAtomicUMax32}; | ||
| 1910 | return Inst(op, Flags{info}, handle, coords, value); | ||
| 1911 | } | ||
| 1912 | |||
| 1913 | Value IREmitter::ImageAtomicIMax(const Value& handle, const Value& coords, const Value& value, | ||
| 1914 | bool is_signed, TextureInstInfo info) { | ||
| 1915 | return is_signed ? ImageAtomicSMax(handle, coords, value, info) | ||
| 1916 | : ImageAtomicUMax(handle, coords, value, info); | ||
| 1917 | } | ||
| 1918 | |||
| 1919 | Value IREmitter::ImageAtomicInc(const Value& handle, const Value& coords, const Value& value, | ||
| 1920 | TextureInstInfo info) { | ||
| 1921 | const Opcode op{handle.IsImmediate() ? Opcode::BoundImageAtomicInc32 | ||
| 1922 | : Opcode::BindlessImageAtomicInc32}; | ||
| 1923 | return Inst(op, Flags{info}, handle, coords, value); | ||
| 1924 | } | ||
| 1925 | |||
| 1926 | Value IREmitter::ImageAtomicDec(const Value& handle, const Value& coords, const Value& value, | ||
| 1927 | TextureInstInfo info) { | ||
| 1928 | const Opcode op{handle.IsImmediate() ? Opcode::BoundImageAtomicDec32 | ||
| 1929 | : Opcode::BindlessImageAtomicDec32}; | ||
| 1930 | return Inst(op, Flags{info}, handle, coords, value); | ||
| 1931 | } | ||
| 1932 | |||
| 1933 | Value IREmitter::ImageAtomicAnd(const Value& handle, const Value& coords, const Value& value, | ||
| 1934 | TextureInstInfo info) { | ||
| 1935 | const Opcode op{handle.IsImmediate() ? Opcode::BoundImageAtomicAnd32 | ||
| 1936 | : Opcode::BindlessImageAtomicAnd32}; | ||
| 1937 | return Inst(op, Flags{info}, handle, coords, value); | ||
| 1938 | } | ||
| 1939 | |||
| 1940 | Value IREmitter::ImageAtomicOr(const Value& handle, const Value& coords, const Value& value, | ||
| 1941 | TextureInstInfo info) { | ||
| 1942 | const Opcode op{handle.IsImmediate() ? Opcode::BoundImageAtomicOr32 | ||
| 1943 | : Opcode::BindlessImageAtomicOr32}; | ||
| 1944 | return Inst(op, Flags{info}, handle, coords, value); | ||
| 1945 | } | ||
| 1946 | |||
| 1947 | Value IREmitter::ImageAtomicXor(const Value& handle, const Value& coords, const Value& value, | ||
| 1948 | TextureInstInfo info) { | ||
| 1949 | const Opcode op{handle.IsImmediate() ? Opcode::BoundImageAtomicXor32 | ||
| 1950 | : Opcode::BindlessImageAtomicXor32}; | ||
| 1951 | return Inst(op, Flags{info}, handle, coords, value); | ||
| 1952 | } | ||
| 1953 | |||
| 1954 | Value IREmitter::ImageAtomicExchange(const Value& handle, const Value& coords, const Value& value, | ||
| 1955 | TextureInstInfo info) { | ||
| 1956 | const Opcode op{handle.IsImmediate() ? Opcode::BoundImageAtomicExchange32 | ||
| 1957 | : Opcode::BindlessImageAtomicExchange32}; | ||
| 1958 | return Inst(op, Flags{info}, handle, coords, value); | ||
| 1959 | } | ||
| 1960 | |||
| 1872 | U1 IREmitter::VoteAll(const U1& value) { | 1961 | U1 IREmitter::VoteAll(const U1& value) { |
| 1873 | return Inst<U1>(Opcode::VoteAll, value); | 1962 | return Inst<U1>(Opcode::VoteAll, value); |
| 1874 | } | 1963 | } |