summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/glsl/emit_glsl_composite.cpp
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-05-28 02:31:03 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:36 +0200
commita752ec88d06c6bcfb13605447a164c6b6915ed6e (patch)
tree5e0bb8f30120199ed4955d402ff0b554db257e2c /src/shader_recompiler/backend/glsl/emit_glsl_composite.cpp
parentglsl: Fix non-immediate buffer access (diff)
downloadyuzu-a752ec88d06c6bcfb13605447a164c6b6915ed6e.tar
yuzu-a752ec88d06c6bcfb13605447a164c6b6915ed6e.tar.gz
yuzu-a752ec88d06c6bcfb13605447a164c6b6915ed6e.tar.bz2
yuzu-a752ec88d06c6bcfb13605447a164c6b6915ed6e.tar.lz
yuzu-a752ec88d06c6bcfb13605447a164c6b6915ed6e.tar.xz
yuzu-a752ec88d06c6bcfb13605447a164c6b6915ed6e.tar.zst
yuzu-a752ec88d06c6bcfb13605447a164c6b6915ed6e.zip
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
ctx.AddU32("{}={}.{};", inst, composite, SWIZZLE[index]);
}
-void EmitCompositeInsertU32x2([[maybe_unused]] EmitContext& ctx,
- [[maybe_unused]] std::string_view composite,
- [[maybe_unused]] std::string_view object,
- [[maybe_unused]] u32 index) {
- throw NotImplementedException("GLSL Instruction");
+void EmitCompositeInsertU32x2(EmitContext& ctx, std::string_view composite, std::string_view object,
+ u32 index) {
+ ctx.Add("{}.{}={};", composite, SWIZZLE[index], object);
}
-void EmitCompositeInsertU32x3([[maybe_unused]] EmitContext& ctx,
- [[maybe_unused]] std::string_view composite,
- [[maybe_unused]] std::string_view object,
- [[maybe_unused]] u32 index) {
- throw NotImplementedException("GLSL Instruction");
+void EmitCompositeInsertU32x3(EmitContext& ctx, std::string_view composite, std::string_view object,
+ u32 index) {
+ ctx.Add("{}.{}={};", composite, SWIZZLE[index], object);
}
-void EmitCompositeInsertU32x4([[maybe_unused]] EmitContext& ctx,
- [[maybe_unused]] std::string_view composite,
- [[maybe_unused]] std::string_view object,
- [[maybe_unused]] u32 index) {
- throw NotImplementedException("GLSL Instruction");
+void EmitCompositeInsertU32x4(EmitContext& ctx, std::string_view composite, std::string_view object,
+ u32 index) {
+ ctx.Add("{}.{}={};", composite, SWIZZLE[index], object);
}
void EmitCompositeConstructF16x2([[maybe_unused]] EmitContext& ctx,
@@ -153,25 +147,19 @@ void EmitCompositeExtractF32x4(EmitContext& ctx, IR::Inst& inst, std::string_vie
ctx.AddF32("{}={}.{};", inst, composite, SWIZZLE[index]);
}
-void EmitCompositeInsertF32x2([[maybe_unused]] EmitContext& ctx,
- [[maybe_unused]] std::string_view composite,
- [[maybe_unused]] std::string_view object,
- [[maybe_unused]] u32 index) {
- throw NotImplementedException("GLSL Instruction");
+void EmitCompositeInsertF32x2(EmitContext& ctx, std::string_view composite, std::string_view object,
+ u32 index) {
+ ctx.Add("{}.{}={};", composite, SWIZZLE[index], object);
}
-void EmitCompositeInsertF32x3([[maybe_unused]] EmitContext& ctx,
- [[maybe_unused]] std::string_view composite,
- [[maybe_unused]] std::string_view object,
- [[maybe_unused]] u32 index) {
- throw NotImplementedException("GLSL Instruction");
+void EmitCompositeInsertF32x3(EmitContext& ctx, std::string_view composite, std::string_view object,
+ u32 index) {
+ ctx.Add("{}.{}={};", composite, SWIZZLE[index], object);
}
-void EmitCompositeInsertF32x4([[maybe_unused]] EmitContext& ctx,
- [[maybe_unused]] std::string_view composite,
- [[maybe_unused]] std::string_view object,
- [[maybe_unused]] u32 index) {
- throw NotImplementedException("GLSL Instruction");
+void EmitCompositeInsertF32x4(EmitContext& ctx, std::string_view composite, std::string_view object,
+ u32 index) {
+ ctx.Add("{}.{}={};", composite, SWIZZLE[index], object);
}
void EmitCompositeConstructF64x2([[maybe_unused]] EmitContext& ctx) {
@@ -198,24 +186,18 @@ void EmitCompositeExtractF64x4([[maybe_unused]] EmitContext& ctx) {
throw NotImplementedException("GLSL Instruction");
}
-void EmitCompositeInsertF64x2([[maybe_unused]] EmitContext& ctx,
- [[maybe_unused]] std::string_view composite,
- [[maybe_unused]] std::string_view object,
- [[maybe_unused]] u32 index) {
- throw NotImplementedException("GLSL Instruction");
+void EmitCompositeInsertF64x2(EmitContext& ctx, std::string_view composite, std::string_view object,
+ u32 index) {
+ ctx.Add("{}.{}={};", composite, SWIZZLE[index], object);
}
-void EmitCompositeInsertF64x3([[maybe_unused]] EmitContext& ctx,
- [[maybe_unused]] std::string_view composite,
- [[maybe_unused]] std::string_view object,
- [[maybe_unused]] u32 index) {
- throw NotImplementedException("GLSL Instruction");
+void EmitCompositeInsertF64x3(EmitContext& ctx, std::string_view composite, std::string_view object,
+ u32 index) {
+ ctx.Add("{}.{}={};", composite, SWIZZLE[index], object);
}
-void EmitCompositeInsertF64x4([[maybe_unused]] EmitContext& ctx,
- [[maybe_unused]] std::string_view composite,
- [[maybe_unused]] std::string_view object,
- [[maybe_unused]] u32 index) {
- throw NotImplementedException("GLSL Instruction");
+void EmitCompositeInsertF64x4(EmitContext& ctx, std::string_view composite, std::string_view object,
+ u32 index) {
+ ctx.Add("{}.{}={};", composite, SWIZZLE[index], object);
}
} // namespace Shader::Backend::GLSL