summaryrefslogtreecommitdiff
path: root/src/shader_recompiler
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_context.cpp52
-rw-r--r--src/shader_recompiler/backend/glsl/emit_context.h9
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_composite.cpp14
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp53
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_image.cpp205
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_instructions.h9
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_not_implemented.cpp178
-rw-r--r--src/shader_recompiler/backend/glsl/reg_alloc.cpp6
-rw-r--r--src/shader_recompiler/backend/glsl/reg_alloc.h2
9 files changed, 337 insertions, 191 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_context.cpp b/src/shader_recompiler/backend/glsl/emit_context.cpp
index 7b6c6d22b..8e5983909 100644
--- a/src/shader_recompiler/backend/glsl/emit_context.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_context.cpp
@@ -14,17 +14,63 @@ EmitContext::EmitContext(IR::Program& program, [[maybe_unused]] Bindings& bindin
14 : info{program.info}, profile{profile_} { 14 : info{program.info}, profile{profile_} {
15 std::string header = "#version 450\n"; 15 std::string header = "#version 450\n";
16 SetupExtensions(header); 16 SetupExtensions(header);
17 if (program.stage == Stage::Compute) { 17 stage = program.stage;
18 switch (program.stage) {
19 case Stage::VertexA:
20 case Stage::VertexB:
21 stage_name = "vertex";
22 attrib_name = "vertex";
23 // TODO: add only what's used by the shader
24 header +=
25 "out gl_PerVertex {vec4 gl_Position;float gl_PointSize;float gl_ClipDistance[];};";
26 break;
27 case Stage::TessellationControl:
28 case Stage::TessellationEval:
29 stage_name = "primitive";
30 attrib_name = "primitive";
31 break;
32 case Stage::Geometry:
33 stage_name = "primitive";
34 attrib_name = "vertex";
35 break;
36 case Stage::Fragment:
37 stage_name = "fragment";
38 attrib_name = "fragment";
39 break;
40 case Stage::Compute:
41 stage_name = "invocation";
18 header += fmt::format("layout(local_size_x={},local_size_y={},local_size_z={}) in;\n", 42 header += fmt::format("layout(local_size_x={},local_size_y={},local_size_z={}) in;\n",
19 program.workgroup_size[0], program.workgroup_size[1], 43 program.workgroup_size[0], program.workgroup_size[1],
20 program.workgroup_size[2]); 44 program.workgroup_size[2]);
45 break;
21 } 46 }
22 code += header; 47 code += header;
23 48 const std::string_view attr_stage{stage == Stage::Fragment ? "fragment" : "vertex"};
49 for (size_t index = 0; index < info.input_generics.size(); ++index) {
50 const auto& generic{info.input_generics[index]};
51 if (generic.used) {
52 Add("layout(location={})in vec4 in_attr{};", index, index);
53 }
54 }
55 for (size_t index = 0; index < info.stores_frag_color.size(); ++index) {
56 if (!info.stores_frag_color[index]) {
57 continue;
58 }
59 Add("layout(location={})out vec4 frag_color{};", index, index);
60 }
61 for (size_t index = 0; index < info.stores_generics.size(); ++index) {
62 if (info.stores_generics[index]) {
63 Add("layout(location={}) out vec4 out_attr{};", index, index);
64 }
65 }
24 DefineConstantBuffers(); 66 DefineConstantBuffers();
25 DefineStorageBuffers(); 67 DefineStorageBuffers();
26 DefineHelperFunctions(); 68 DefineHelperFunctions();
27 code += "void main(){\n"; 69 Add("void main(){{");
70
71 if (stage == Stage::VertexA || stage == Stage::VertexB) {
72 Add("gl_Position = vec4(0.0f, 0.0f, 0.0f, 1.0f);");
73 }
28} 74}
29 75
30void EmitContext::SetupExtensions(std::string& header) { 76void EmitContext::SetupExtensions(std::string& header) {
diff --git a/src/shader_recompiler/backend/glsl/emit_context.h b/src/shader_recompiler/backend/glsl/emit_context.h
index 7f8857fa7..087eaff6a 100644
--- a/src/shader_recompiler/backend/glsl/emit_context.h
+++ b/src/shader_recompiler/backend/glsl/emit_context.h
@@ -89,6 +89,11 @@ public:
89 } 89 }
90 90
91 template <typename... Args> 91 template <typename... Args>
92 void AddF32x4(const char* format_str, IR::Inst& inst, Args&&... args) {
93 Add<Type::F32x4>(format_str, inst, args...);
94 }
95
96 template <typename... Args>
92 void Add(const char* format_str, Args&&... args) { 97 void Add(const char* format_str, Args&&... args) {
93 code += fmt::format(format_str, std::forward<Args>(args)...); 98 code += fmt::format(format_str, std::forward<Args>(args)...);
94 // TODO: Remove this 99 // TODO: Remove this
@@ -100,6 +105,10 @@ public:
100 const Info& info; 105 const Info& info;
101 const Profile& profile; 106 const Profile& profile;
102 107
108 Stage stage{};
109 std::string_view stage_name = "invalid";
110 std::string_view attrib_name = "invalid";
111
103private: 112private:
104 void SetupExtensions(std::string& header); 113 void SetupExtensions(std::string& header);
105 void DefineConstantBuffers(); 114 void DefineConstantBuffers();
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_composite.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_composite.cpp
index 8e7ad68bd..048b12f38 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_composite.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_composite.cpp
@@ -155,16 +155,14 @@ void EmitCompositeExtractF32x2(EmitContext& ctx, IR::Inst& inst, std::string_vie
155 ctx.AddF32("{}={}.{};", inst, composite, SWIZZLE[index]); 155 ctx.AddF32("{}={}.{};", inst, composite, SWIZZLE[index]);
156} 156}
157 157
158void EmitCompositeExtractF32x3([[maybe_unused]] EmitContext& ctx, 158void EmitCompositeExtractF32x3(EmitContext& ctx, IR::Inst& inst, std::string_view composite,
159 [[maybe_unused]] std::string_view composite, 159 u32 index) {
160 [[maybe_unused]] u32 index) { 160 ctx.AddF32("{}={}.{};", inst, composite, SWIZZLE[index]);
161 throw NotImplementedException("GLSL Instruction");
162} 161}
163 162
164void EmitCompositeExtractF32x4([[maybe_unused]] EmitContext& ctx, 163void EmitCompositeExtractF32x4(EmitContext& ctx, IR::Inst& inst, std::string_view composite,
165 [[maybe_unused]] std::string_view composite, 164 u32 index) {
166 [[maybe_unused]] u32 index) { 165 ctx.AddF32("{}={}.{};", inst, composite, SWIZZLE[index]);
167 throw NotImplementedException("GLSL Instruction");
168} 166}
169 167
170void EmitCompositeInsertF32x2([[maybe_unused]] EmitContext& ctx, 168void EmitCompositeInsertF32x2([[maybe_unused]] EmitContext& ctx,
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp
index 7c9cadd7e..441818c0b 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp
@@ -51,4 +51,57 @@ void EmitGetCbufU32x2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] const
51 [[maybe_unused]] const IR::Value& offset) { 51 [[maybe_unused]] const IR::Value& offset) {
52 throw NotImplementedException("GLSL"); 52 throw NotImplementedException("GLSL");
53} 53}
54
55void EmitGetAttribute(EmitContext& ctx, IR::Inst& inst, IR::Attribute attr,
56 [[maybe_unused]] std::string_view vertex) {
57 const u32 element{static_cast<u32>(attr) % 4};
58 const char swizzle{"xyzw"[element]};
59 if (IR::IsGeneric(attr)) {
60 const u32 index{IR::GenericAttributeIndex(attr)};
61 ctx.AddF32("{}=in_attr{}.{};", inst, index, swizzle);
62 return;
63 }
64 switch (attr) {
65 case IR::Attribute::PositionX:
66 case IR::Attribute::PositionY:
67 case IR::Attribute::PositionZ:
68 case IR::Attribute::PositionW:
69 ctx.AddF32("{}=gl_Position.{};", inst, swizzle);
70 break;
71 default:
72 fmt::print("Get attribute {}", attr);
73 throw NotImplementedException("Get attribute {}", attr);
74 }
75}
76
77void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, std::string_view value,
78 [[maybe_unused]] std::string_view vertex) {
79 const u32 element{static_cast<u32>(attr) % 4};
80 const char swizzle{"xyzw"[element]};
81 if (IR::IsGeneric(attr)) {
82 const u32 index{IR::GenericAttributeIndex(attr)};
83 ctx.Add("out_attr{}.{}={};", index, swizzle, value);
84 return;
85 }
86 switch (attr) {
87 case IR::Attribute::PointSize:
88 ctx.Add("gl_Pointsize={};", value);
89 break;
90 case IR::Attribute::PositionX:
91 case IR::Attribute::PositionY:
92 case IR::Attribute::PositionZ:
93 case IR::Attribute::PositionW:
94 ctx.Add("gl_Position.{}={};", swizzle, value);
95 break;
96 default:
97 fmt::print("Set attribute {}", attr);
98 throw NotImplementedException("Set attribute {}", attr);
99 }
100}
101
102void EmitSetFragColor(EmitContext& ctx, u32 index, u32 component, std::string_view value) {
103 const char swizzle{"xyzw"[component]};
104 ctx.Add("frag_color{}.{}={};", index, swizzle, value);
105}
106
54} // namespace Shader::Backend::GLSL 107} // namespace Shader::Backend::GLSL
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp
index e69de29bb..109938e0e 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp
@@ -0,0 +1,205 @@
1// Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include <string_view>
6
7#include "shader_recompiler/backend/glsl/emit_context.h"
8#include "shader_recompiler/backend/glsl/emit_glsl_instructions.h"
9#include "shader_recompiler/frontend/ir/value.h"
10#include "shader_recompiler/profile.h"
11
12namespace Shader::Backend::GLSL {
13
14void EmitImageSampleImplicitLod([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
15 [[maybe_unused]] const IR::Value& index,
16 [[maybe_unused]] std::string_view coords,
17 [[maybe_unused]] std::string_view bias_lc,
18 [[maybe_unused]] const IR::Value& offset) {
19 throw NotImplementedException("GLSL Instruction");
20}
21
22void EmitImageSampleExplicitLod([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
23 [[maybe_unused]] const IR::Value& index,
24 [[maybe_unused]] std::string_view coords,
25 [[maybe_unused]] std::string_view lod_lc,
26 [[maybe_unused]] const IR::Value& offset) {
27 throw NotImplementedException("GLSL Instruction");
28}
29
30void EmitImageSampleDrefImplicitLod([[maybe_unused]] EmitContext& ctx,
31 [[maybe_unused]] IR::Inst& inst,
32 [[maybe_unused]] const IR::Value& index,
33 [[maybe_unused]] std::string_view coords,
34 [[maybe_unused]] std::string_view dref,
35 [[maybe_unused]] std::string_view bias_lc,
36 [[maybe_unused]] const IR::Value& offset) {
37 throw NotImplementedException("GLSL Instruction");
38}
39
40void EmitImageSampleDrefExplicitLod([[maybe_unused]] EmitContext& ctx,
41 [[maybe_unused]] IR::Inst& inst,
42 [[maybe_unused]] const IR::Value& index,
43 [[maybe_unused]] std::string_view coords,
44 [[maybe_unused]] std::string_view dref,
45 [[maybe_unused]] std::string_view lod_lc,
46 [[maybe_unused]] const IR::Value& offset) {
47 throw NotImplementedException("GLSL Instruction");
48}
49
50void EmitImageGather([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
51 [[maybe_unused]] const IR::Value& index,
52 [[maybe_unused]] std::string_view coords,
53 [[maybe_unused]] const IR::Value& offset,
54 [[maybe_unused]] const IR::Value& offset2) {
55 throw NotImplementedException("GLSL Instruction");
56}
57
58void EmitImageGatherDref([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
59 [[maybe_unused]] const IR::Value& index,
60 [[maybe_unused]] std::string_view coords,
61 [[maybe_unused]] const IR::Value& offset,
62 [[maybe_unused]] const IR::Value& offset2,
63 [[maybe_unused]] std::string_view dref) {
64 throw NotImplementedException("GLSL Instruction");
65}
66
67void EmitImageFetch([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
68 [[maybe_unused]] const IR::Value& index,
69 [[maybe_unused]] std::string_view coords,
70 [[maybe_unused]] std::string_view offset, [[maybe_unused]] std::string_view lod,
71 [[maybe_unused]] std::string_view ms) {
72 throw NotImplementedException("GLSL Instruction");
73}
74
75void EmitImageQueryDimensions([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
76 [[maybe_unused]] const IR::Value& index,
77 [[maybe_unused]] std::string_view lod) {
78 throw NotImplementedException("GLSL Instruction");
79}
80
81void EmitImageQueryLod([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
82 [[maybe_unused]] const IR::Value& index,
83 [[maybe_unused]] std::string_view coords) {
84 throw NotImplementedException("GLSL Instruction");
85}
86
87void EmitImageGradient([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
88 [[maybe_unused]] const IR::Value& index,
89 [[maybe_unused]] std::string_view coords,
90 [[maybe_unused]] std::string_view derivates,
91 [[maybe_unused]] std::string_view offset,
92 [[maybe_unused]] std::string_view lod_clamp) {
93 throw NotImplementedException("GLSL Instruction");
94}
95
96void EmitImageRead([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
97 [[maybe_unused]] const IR::Value& index,
98 [[maybe_unused]] std::string_view coords) {
99 throw NotImplementedException("GLSL Instruction");
100}
101
102void EmitImageWrite([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
103 [[maybe_unused]] const IR::Value& index,
104 [[maybe_unused]] std::string_view coords,
105 [[maybe_unused]] std::string_view color) {
106 throw NotImplementedException("GLSL Instruction");
107}
108
109void EmitBindlessImageSampleImplicitLod(EmitContext&) {
110 throw NotImplementedException("GLSL Instruction");
111}
112
113void EmitBindlessImageSampleExplicitLod(EmitContext&) {
114 throw NotImplementedException("GLSL Instruction");
115}
116
117void EmitBindlessImageSampleDrefImplicitLod(EmitContext&) {
118 throw NotImplementedException("GLSL Instruction");
119}
120
121void EmitBindlessImageSampleDrefExplicitLod(EmitContext&) {
122 throw NotImplementedException("GLSL Instruction");
123}
124
125void EmitBindlessImageGather(EmitContext&) {
126 throw NotImplementedException("GLSL Instruction");
127}
128
129void EmitBindlessImageGatherDref(EmitContext&) {
130 throw NotImplementedException("GLSL Instruction");
131}
132
133void EmitBindlessImageFetch(EmitContext&) {
134 throw NotImplementedException("GLSL Instruction");
135}
136
137void EmitBindlessImageQueryDimensions(EmitContext&) {
138 throw NotImplementedException("GLSL Instruction");
139}
140
141void EmitBindlessImageQueryLod(EmitContext&) {
142 throw NotImplementedException("GLSL Instruction");
143}
144
145void EmitBindlessImageGradient(EmitContext&) {
146 throw NotImplementedException("GLSL Instruction");
147}
148
149void EmitBindlessImageRead(EmitContext&) {
150 throw NotImplementedException("GLSL Instruction");
151}
152
153void EmitBindlessImageWrite(EmitContext&) {
154 throw NotImplementedException("GLSL Instruction");
155}
156
157void EmitBoundImageSampleImplicitLod(EmitContext&) {
158 throw NotImplementedException("GLSL Instruction");
159}
160
161void EmitBoundImageSampleExplicitLod(EmitContext&) {
162 throw NotImplementedException("GLSL Instruction");
163}
164
165void EmitBoundImageSampleDrefImplicitLod(EmitContext&) {
166 throw NotImplementedException("GLSL Instruction");
167}
168
169void EmitBoundImageSampleDrefExplicitLod(EmitContext&) {
170 throw NotImplementedException("GLSL Instruction");
171}
172
173void EmitBoundImageGather(EmitContext&) {
174 throw NotImplementedException("GLSL Instruction");
175}
176
177void EmitBoundImageGatherDref(EmitContext&) {
178 throw NotImplementedException("GLSL Instruction");
179}
180
181void EmitBoundImageFetch(EmitContext&) {
182 throw NotImplementedException("GLSL Instruction");
183}
184
185void EmitBoundImageQueryDimensions(EmitContext&) {
186 throw NotImplementedException("GLSL Instruction");
187}
188
189void EmitBoundImageQueryLod(EmitContext&) {
190 throw NotImplementedException("GLSL Instruction");
191}
192
193void EmitBoundImageGradient(EmitContext&) {
194 throw NotImplementedException("GLSL Instruction");
195}
196
197void EmitBoundImageRead(EmitContext&) {
198 throw NotImplementedException("GLSL Instruction");
199}
200
201void EmitBoundImageWrite(EmitContext&) {
202 throw NotImplementedException("GLSL Instruction");
203}
204
205} // namespace Shader::Backend::GLSL
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h b/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h
index 9f32070b0..49ab108bb 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h
@@ -61,7 +61,8 @@ void EmitGetCbufU32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
61void EmitGetCbufF32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, 61void EmitGetCbufF32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
62 const IR::Value& offset); 62 const IR::Value& offset);
63void EmitGetCbufU32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); 63void EmitGetCbufU32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset);
64void EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, std::string_view vertex); 64void EmitGetAttribute(EmitContext& ctx, IR::Inst& inst, IR::Attribute attr,
65 std::string_view vertex);
65void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, std::string_view value, 66void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, std::string_view value,
66 std::string_view vertex); 67 std::string_view vertex);
67void EmitGetAttributeIndexed(EmitContext& ctx, std::string_view offset, std::string_view vertex); 68void EmitGetAttributeIndexed(EmitContext& ctx, std::string_view offset, std::string_view vertex);
@@ -180,8 +181,10 @@ void EmitCompositeConstructF32x4(EmitContext& ctx, std::string_view e1, std::str
180 std::string_view e3, std::string_view e4); 181 std::string_view e3, std::string_view e4);
181void EmitCompositeExtractF32x2(EmitContext& ctx, IR::Inst& inst, std::string_view composite, 182void EmitCompositeExtractF32x2(EmitContext& ctx, IR::Inst& inst, std::string_view composite,
182 u32 index); 183 u32 index);
183void EmitCompositeExtractF32x3(EmitContext& ctx, std::string_view composite, u32 index); 184void EmitCompositeExtractF32x3(EmitContext& ctx, IR::Inst& inst, std::string_view composite,
184void EmitCompositeExtractF32x4(EmitContext& ctx, std::string_view composite, u32 index); 185 u32 index);
186void EmitCompositeExtractF32x4(EmitContext& ctx, IR::Inst& inst, std::string_view composite,
187 u32 index);
185void EmitCompositeInsertF32x2(EmitContext& ctx, std::string_view composite, std::string_view object, 188void EmitCompositeInsertF32x2(EmitContext& ctx, std::string_view composite, std::string_view object,
186 u32 index); 189 u32 index);
187void EmitCompositeInsertF32x3(EmitContext& ctx, std::string_view composite, std::string_view object, 190void EmitCompositeInsertF32x3(EmitContext& ctx, std::string_view composite, std::string_view object,
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_not_implemented.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_not_implemented.cpp
index b37b3c76d..14a2edd74 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_not_implemented.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_not_implemented.cpp
@@ -83,7 +83,7 @@ void EmitUnreachable(EmitContext& ctx) {
83} 83}
84 84
85void EmitDemoteToHelperInvocation(EmitContext& ctx, std::string_view continue_label) { 85void EmitDemoteToHelperInvocation(EmitContext& ctx, std::string_view continue_label) {
86 NotImplemented(); 86 ctx.Add("discard;");
87} 87}
88 88
89void EmitBarrier(EmitContext& ctx) { 89void EmitBarrier(EmitContext& ctx) {
@@ -146,15 +146,6 @@ void EmitGetIndirectBranchVariable(EmitContext& ctx) {
146 NotImplemented(); 146 NotImplemented();
147} 147}
148 148
149void EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, std::string_view vertex) {
150 NotImplemented();
151}
152
153void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, std::string_view value,
154 std::string_view vertex) {
155 NotImplemented();
156}
157
158void EmitGetAttributeIndexed(EmitContext& ctx, std::string_view offset, std::string_view vertex) { 149void EmitGetAttributeIndexed(EmitContext& ctx, std::string_view offset, std::string_view vertex) {
159 NotImplemented(); 150 NotImplemented();
160} 151}
@@ -172,10 +163,6 @@ void EmitSetPatch(EmitContext& ctx, IR::Patch patch, std::string_view value) {
172 NotImplemented(); 163 NotImplemented();
173} 164}
174 165
175void EmitSetFragColor(EmitContext& ctx, u32 index, u32 component, std::string_view value) {
176 NotImplemented();
177}
178
179void EmitSetSampleMask(EmitContext& ctx, std::string_view value) { 166void EmitSetSampleMask(EmitContext& ctx, std::string_view value) {
180 NotImplemented(); 167 NotImplemented();
181} 168}
@@ -456,169 +443,6 @@ void EmitSharedAtomicExchange64(EmitContext& ctx, std::string_view pointer_offse
456 NotImplemented(); 443 NotImplemented();
457} 444}
458 445
459void EmitBindlessImageSampleImplicitLod(EmitContext&) {
460 NotImplemented();
461}
462
463void EmitBindlessImageSampleExplicitLod(EmitContext&) {
464 NotImplemented();
465}
466
467void EmitBindlessImageSampleDrefImplicitLod(EmitContext&) {
468 NotImplemented();
469}
470
471void EmitBindlessImageSampleDrefExplicitLod(EmitContext&) {
472 NotImplemented();
473}
474
475void EmitBindlessImageGather(EmitContext&) {
476 NotImplemented();
477}
478
479void EmitBindlessImageGatherDref(EmitContext&) {
480 NotImplemented();
481}
482
483void EmitBindlessImageFetch(EmitContext&) {
484 NotImplemented();
485}
486
487void EmitBindlessImageQueryDimensions(EmitContext&) {
488 NotImplemented();
489}
490
491void EmitBindlessImageQueryLod(EmitContext&) {
492 NotImplemented();
493}
494
495void EmitBindlessImageGradient(EmitContext&) {
496 NotImplemented();
497}
498
499void EmitBindlessImageRead(EmitContext&) {
500 NotImplemented();
501}
502
503void EmitBindlessImageWrite(EmitContext&) {
504 NotImplemented();
505}
506
507void EmitBoundImageSampleImplicitLod(EmitContext&) {
508 NotImplemented();
509}
510
511void EmitBoundImageSampleExplicitLod(EmitContext&) {
512 NotImplemented();
513}
514
515void EmitBoundImageSampleDrefImplicitLod(EmitContext&) {
516 NotImplemented();
517}
518
519void EmitBoundImageSampleDrefExplicitLod(EmitContext&) {
520 NotImplemented();
521}
522
523void EmitBoundImageGather(EmitContext&) {
524 NotImplemented();
525}
526
527void EmitBoundImageGatherDref(EmitContext&) {
528 NotImplemented();
529}
530
531void EmitBoundImageFetch(EmitContext&) {
532 NotImplemented();
533}
534
535void EmitBoundImageQueryDimensions(EmitContext&) {
536 NotImplemented();
537}
538
539void EmitBoundImageQueryLod(EmitContext&) {
540 NotImplemented();
541}
542
543void EmitBoundImageGradient(EmitContext&) {
544 NotImplemented();
545}
546
547void EmitBoundImageRead(EmitContext&) {
548 NotImplemented();
549}
550
551void EmitBoundImageWrite(EmitContext&) {
552 NotImplemented();
553}
554
555void EmitImageSampleImplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
556 std::string_view coords, std::string_view bias_lc,
557 const IR::Value& offset) {
558 NotImplemented();
559}
560
561void EmitImageSampleExplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
562 std::string_view coords, std::string_view lod_lc,
563 const IR::Value& offset) {
564 NotImplemented();
565}
566
567void EmitImageSampleDrefImplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
568 std::string_view coords, std::string_view dref,
569 std::string_view bias_lc, const IR::Value& offset) {
570 NotImplemented();
571}
572
573void EmitImageSampleDrefExplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
574 std::string_view coords, std::string_view dref,
575 std::string_view lod_lc, const IR::Value& offset) {
576 NotImplemented();
577}
578
579void EmitImageGather(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
580 std::string_view coords, const IR::Value& offset, const IR::Value& offset2) {
581 NotImplemented();
582}
583
584void EmitImageGatherDref(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
585 std::string_view coords, const IR::Value& offset, const IR::Value& offset2,
586 std::string_view dref) {
587 NotImplemented();
588}
589
590void EmitImageFetch(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
591 std::string_view coords, std::string_view offset, std::string_view lod,
592 std::string_view ms) {
593 NotImplemented();
594}
595
596void EmitImageQueryDimensions(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
597 std::string_view lod) {
598 NotImplemented();
599}
600
601void EmitImageQueryLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
602 std::string_view coords) {
603 NotImplemented();
604}
605
606void EmitImageGradient(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
607 std::string_view coords, std::string_view derivates, std::string_view offset,
608 std::string_view lod_clamp) {
609 NotImplemented();
610}
611
612void EmitImageRead(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
613 std::string_view coords) {
614 NotImplemented();
615}
616
617void EmitImageWrite(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
618 std::string_view coords, std::string_view color) {
619 NotImplemented();
620}
621
622void EmitBindlessImageAtomicIAdd32(EmitContext&) { 446void EmitBindlessImageAtomicIAdd32(EmitContext&) {
623 NotImplemented(); 447 NotImplemented();
624} 448}
diff --git a/src/shader_recompiler/backend/glsl/reg_alloc.cpp b/src/shader_recompiler/backend/glsl/reg_alloc.cpp
index c60a87d91..a080d5341 100644
--- a/src/shader_recompiler/backend/glsl/reg_alloc.cpp
+++ b/src/shader_recompiler/backend/glsl/reg_alloc.cpp
@@ -55,6 +55,8 @@ std::string MakeImm(const IR::Value& value) {
55 return fmt::format("{}ul", value.U64()); 55 return fmt::format("{}ul", value.U64());
56 case IR::Type::F64: 56 case IR::Type::F64:
57 return FormatFloat(fmt::format("{}", value.F64()), IR::Type::F64); 57 return FormatFloat(fmt::format("{}", value.F64()), IR::Type::F64);
58 case IR::Type::Void:
59 return "";
58 default: 60 default:
59 throw NotImplementedException("Immediate type {}", value.Type()); 61 throw NotImplementedException("Immediate type {}", value.Type());
60 } 62 }
@@ -131,6 +133,10 @@ std::string RegAlloc::GetType(Type type, u32 index) {
131 return "uvec2 "; 133 return "uvec2 ";
132 case Type::F32x2: 134 case Type::F32x2:
133 return "vec2 "; 135 return "vec2 ";
136 case Type::U32x4:
137 return "uvec4 ";
138 case Type::F32x4:
139 return "vec4 ";
134 case Type::Void: 140 case Type::Void:
135 return ""; 141 return "";
136 default: 142 default:
diff --git a/src/shader_recompiler/backend/glsl/reg_alloc.h b/src/shader_recompiler/backend/glsl/reg_alloc.h
index 419e1e761..df067d3ad 100644
--- a/src/shader_recompiler/backend/glsl/reg_alloc.h
+++ b/src/shader_recompiler/backend/glsl/reg_alloc.h
@@ -27,6 +27,8 @@ enum class Type : u32 {
27 F64, 27 F64,
28 U32x2, 28 U32x2,
29 F32x2, 29 F32x2,
30 U32x4,
31 F32x4,
30 Void, 32 Void,
31}; 33};
32 34