diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-05-27 00:26:16 -0400 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-22 21:51:36 -0400 |
commit | ed14d31f663e126a8f9fe0ea8abff8e27c46248b (patch) | |
tree | 6bfe4bec1eda9960aef7c80dfa5926ab97984bd3 /src/shader_recompiler/backend/glsl/emit_glsl_composite.cpp | |
parent | d171083d53e106c8c5131522fdc81d51360c562d (diff) |
glsl: Fix non-immediate buffer access
and many other misc implementations
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_glsl_composite.cpp')
-rw-r--r-- | src/shader_recompiler/backend/glsl/emit_glsl_composite.cpp | 48 |
1 files changed, 18 insertions, 30 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_composite.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_composite.cpp index 048b12f38f..aa966a304f 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl_composite.cpp +++ b/src/shader_recompiler/backend/glsl/emit_glsl_composite.cpp @@ -17,19 +17,14 @@ void EmitCompositeConstructU32x2(EmitContext& ctx, IR::Inst& inst, std::string_v ctx.AddU32x2("{}=uvec2({},{});", inst, e1, e2); } -void EmitCompositeConstructU32x3([[maybe_unused]] EmitContext& ctx, - [[maybe_unused]] std::string_view e1, - [[maybe_unused]] std::string_view e2, - [[maybe_unused]] std::string_view e3) { - throw NotImplementedException("GLSL Instruction"); +void EmitCompositeConstructU32x3(EmitContext& ctx, IR::Inst& inst, std::string_view e1, + std::string_view e2, std::string_view e3) { + ctx.AddU32x3("{}=uvec3({},{},{});", inst, e1, e2, e3); } -void EmitCompositeConstructU32x4([[maybe_unused]] EmitContext& ctx, - [[maybe_unused]] std::string_view e1, - [[maybe_unused]] std::string_view e2, - [[maybe_unused]] std::string_view e3, - [[maybe_unused]] std::string_view e4) { - throw NotImplementedException("GLSL Instruction"); +void EmitCompositeConstructU32x4(EmitContext& ctx, IR::Inst& inst, std::string_view e1, + std::string_view e2, std::string_view e3, std::string_view e4) { + ctx.AddU32x4("{}=uvec4({},{},{},{});", inst, e1, e2, e3, e4); } void EmitCompositeExtractU32x2(EmitContext& ctx, IR::Inst& inst, std::string_view composite, @@ -37,16 +32,14 @@ void EmitCompositeExtractU32x2(EmitContext& ctx, IR::Inst& inst, std::string_vie ctx.AddU32("{}={}.{};", inst, composite, SWIZZLE[index]); } -void EmitCompositeExtractU32x3([[maybe_unused]] EmitContext& ctx, - [[maybe_unused]] std::string_view composite, - [[maybe_unused]] u32 index) { - throw NotImplementedException("GLSL Instruction"); +void EmitCompositeExtractU32x3(EmitContext& ctx, IR::Inst& inst, std::string_view composite, + u32 index) { + ctx.AddU32("{}={}.{};", inst, composite, SWIZZLE[index]); } -void EmitCompositeExtractU32x4([[maybe_unused]] EmitContext& ctx, - [[maybe_unused]] std::string_view composite, - [[maybe_unused]] u32 index) { - throw NotImplementedException("GLSL Instruction"); +void EmitCompositeExtractU32x4(EmitContext& ctx, IR::Inst& inst, std::string_view composite, + u32 index) { + ctx.AddU32("{}={}.{};", inst, composite, SWIZZLE[index]); } void EmitCompositeInsertU32x2([[maybe_unused]] EmitContext& ctx, @@ -135,19 +128,14 @@ void EmitCompositeConstructF32x2(EmitContext& ctx, IR::Inst& inst, std::string_v ctx.AddF32x2("{}=vec2({},{});", inst, e1, e2); } -void EmitCompositeConstructF32x3([[maybe_unused]] EmitContext& ctx, - [[maybe_unused]] std::string_view e1, - [[maybe_unused]] std::string_view e2, - [[maybe_unused]] std::string_view e3) { - throw NotImplementedException("GLSL Instruction"); +void EmitCompositeConstructF32x3(EmitContext& ctx, IR::Inst& inst, std::string_view e1, + std::string_view e2, std::string_view e3) { + ctx.AddF32x3("{}=vec3({},{},{});", inst, e1, e2, e3); } -void EmitCompositeConstructF32x4([[maybe_unused]] EmitContext& ctx, - [[maybe_unused]] std::string_view e1, - [[maybe_unused]] std::string_view e2, - [[maybe_unused]] std::string_view e3, - [[maybe_unused]] std::string_view e4) { - throw NotImplementedException("GLSL Instruction"); +void EmitCompositeConstructF32x4(EmitContext& ctx, IR::Inst& inst, std::string_view e1, + std::string_view e2, std::string_view e3, std::string_view e4) { + ctx.AddF32x4("{}=vec4({},{},{},{});", inst, e1, e2, e3, e4); } void EmitCompositeExtractF32x2(EmitContext& ctx, IR::Inst& inst, std::string_view composite, |