summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/glsl/emit_glsl_composite.cpp
diff options
context:
space:
mode:
authorGravatar ameerj2021-05-27 20:31:03 -0400
committerGravatar ameerj2021-07-22 21:51:36 -0400
commita752ec88d06c6bcfb13605447a164c6b6915ed6e (patch)
tree5e0bb8f30120199ed4955d402ff0b554db257e2c /src/shader_recompiler/backend/glsl/emit_glsl_composite.cpp
parentglsl: Fix non-immediate buffer access (diff)
downloadyuzu-a752ec88d06c6bcfb13605447a164c6b6915ed6e.tar.gz
yuzu-a752ec88d06c6bcfb13605447a164c6b6915ed6e.tar.xz
yuzu-a752ec88d06c6bcfb13605447a164c6b6915ed6e.zip
glsl: Implement derivatives and YDirection
plus some other misc additions/changed
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_glsl_composite.cpp')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_composite.cpp72
1 files changed, 27 insertions, 45 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_composite.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_composite.cpp
index aa966a304..22e489aa9 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_composite.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_composite.cpp
@@ -42,25 +42,19 @@ void EmitCompositeExtractU32x4(EmitContext& ctx, IR::Inst& inst, std::string_vie
42 ctx.AddU32("{}={}.{};", inst, composite, SWIZZLE[index]); 42 ctx.AddU32("{}={}.{};", inst, composite, SWIZZLE[index]);
43} 43}
44 44
45void EmitCompositeInsertU32x2([[maybe_unused]] EmitContext& ctx, 45void EmitCompositeInsertU32x2(EmitContext& ctx, std::string_view composite, std::string_view object,
46 [[maybe_unused]] std::string_view composite, 46 u32 index) {
47 [[maybe_unused]] std::string_view object, 47 ctx.Add("{}.{}={};", composite, SWIZZLE[index], object);
48 [[maybe_unused]] u32 index) {
49 throw NotImplementedException("GLSL Instruction");
50} 48}
51 49
52void EmitCompositeInsertU32x3([[maybe_unused]] EmitContext& ctx, 50void EmitCompositeInsertU32x3(EmitContext& ctx, std::string_view composite, std::string_view object,
53 [[maybe_unused]] std::string_view composite, 51 u32 index) {
54 [[maybe_unused]] std::string_view object, 52 ctx.Add("{}.{}={};", composite, SWIZZLE[index], object);
55 [[maybe_unused]] u32 index) {
56 throw NotImplementedException("GLSL Instruction");
57} 53}
58 54
59void EmitCompositeInsertU32x4([[maybe_unused]] EmitContext& ctx, 55void EmitCompositeInsertU32x4(EmitContext& ctx, std::string_view composite, std::string_view object,
60 [[maybe_unused]] std::string_view composite, 56 u32 index) {
61 [[maybe_unused]] std::string_view object, 57 ctx.Add("{}.{}={};", composite, SWIZZLE[index], object);
62 [[maybe_unused]] u32 index) {
63 throw NotImplementedException("GLSL Instruction");
64} 58}
65 59
66void EmitCompositeConstructF16x2([[maybe_unused]] EmitContext& ctx, 60void EmitCompositeConstructF16x2([[maybe_unused]] EmitContext& ctx,
@@ -153,25 +147,19 @@ void EmitCompositeExtractF32x4(EmitContext& ctx, IR::Inst& inst, std::string_vie
153 ctx.AddF32("{}={}.{};", inst, composite, SWIZZLE[index]); 147 ctx.AddF32("{}={}.{};", inst, composite, SWIZZLE[index]);
154} 148}
155 149
156void EmitCompositeInsertF32x2([[maybe_unused]] EmitContext& ctx, 150void EmitCompositeInsertF32x2(EmitContext& ctx, std::string_view composite, std::string_view object,
157 [[maybe_unused]] std::string_view composite, 151 u32 index) {
158 [[maybe_unused]] std::string_view object, 152 ctx.Add("{}.{}={};", composite, SWIZZLE[index], object);
159 [[maybe_unused]] u32 index) {
160 throw NotImplementedException("GLSL Instruction");
161} 153}
162 154
163void EmitCompositeInsertF32x3([[maybe_unused]] EmitContext& ctx, 155void EmitCompositeInsertF32x3(EmitContext& ctx, std::string_view composite, std::string_view object,
164 [[maybe_unused]] std::string_view composite, 156 u32 index) {
165 [[maybe_unused]] std::string_view object, 157 ctx.Add("{}.{}={};", composite, SWIZZLE[index], object);
166 [[maybe_unused]] u32 index) {
167 throw NotImplementedException("GLSL Instruction");
168} 158}
169 159
170void EmitCompositeInsertF32x4([[maybe_unused]] EmitContext& ctx, 160void EmitCompositeInsertF32x4(EmitContext& ctx, std::string_view composite, std::string_view object,
171 [[maybe_unused]] std::string_view composite, 161 u32 index) {
172 [[maybe_unused]] std::string_view object, 162 ctx.Add("{}.{}={};", composite, SWIZZLE[index], object);
173 [[maybe_unused]] u32 index) {
174 throw NotImplementedException("GLSL Instruction");
175} 163}
176 164
177void EmitCompositeConstructF64x2([[maybe_unused]] EmitContext& ctx) { 165void EmitCompositeConstructF64x2([[maybe_unused]] EmitContext& ctx) {
@@ -198,24 +186,18 @@ void EmitCompositeExtractF64x4([[maybe_unused]] EmitContext& ctx) {
198 throw NotImplementedException("GLSL Instruction"); 186 throw NotImplementedException("GLSL Instruction");
199} 187}
200 188
201void EmitCompositeInsertF64x2([[maybe_unused]] EmitContext& ctx, 189void EmitCompositeInsertF64x2(EmitContext& ctx, std::string_view composite, std::string_view object,
202 [[maybe_unused]] std::string_view composite, 190 u32 index) {
203 [[maybe_unused]] std::string_view object, 191 ctx.Add("{}.{}={};", composite, SWIZZLE[index], object);
204 [[maybe_unused]] u32 index) {
205 throw NotImplementedException("GLSL Instruction");
206} 192}
207 193
208void EmitCompositeInsertF64x3([[maybe_unused]] EmitContext& ctx, 194void EmitCompositeInsertF64x3(EmitContext& ctx, std::string_view composite, std::string_view object,
209 [[maybe_unused]] std::string_view composite, 195 u32 index) {
210 [[maybe_unused]] std::string_view object, 196 ctx.Add("{}.{}={};", composite, SWIZZLE[index], object);
211 [[maybe_unused]] u32 index) {
212 throw NotImplementedException("GLSL Instruction");
213} 197}
214 198
215void EmitCompositeInsertF64x4([[maybe_unused]] EmitContext& ctx, 199void EmitCompositeInsertF64x4(EmitContext& ctx, std::string_view composite, std::string_view object,
216 [[maybe_unused]] std::string_view composite, 200 u32 index) {
217 [[maybe_unused]] std::string_view object, 201 ctx.Add("{}.{}={};", composite, SWIZZLE[index], object);
218 [[maybe_unused]] u32 index) {
219 throw NotImplementedException("GLSL Instruction");
220} 202}
221} // namespace Shader::Backend::GLSL 203} // namespace Shader::Backend::GLSL