diff options
Diffstat (limited to 'src/shader_recompiler/backend/glasm/emit_context.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_context.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_context.cpp b/src/shader_recompiler/backend/glasm/emit_context.cpp index b4db4ff8f..9f839f3bf 100644 --- a/src/shader_recompiler/backend/glasm/emit_context.cpp +++ b/src/shader_recompiler/backend/glasm/emit_context.cpp | |||
| @@ -3,9 +3,28 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "shader_recompiler/backend/glasm/emit_context.h" | 5 | #include "shader_recompiler/backend/glasm/emit_context.h" |
| 6 | #include "shader_recompiler/frontend/ir/program.h" | ||
| 6 | 7 | ||
| 7 | namespace Shader::Backend::GLASM { | 8 | namespace Shader::Backend::GLASM { |
| 8 | 9 | ||
| 9 | EmitContext::EmitContext() = default; | 10 | EmitContext::EmitContext(IR::Program& program) { |
| 11 | // FIXME: Temporary partial implementation | ||
| 12 | u32 cbuf_index{}; | ||
| 13 | for (const auto& desc : program.info.constant_buffer_descriptors) { | ||
| 14 | if (desc.count != 1) { | ||
| 15 | throw NotImplementedException("Constant buffer descriptor array"); | ||
| 16 | } | ||
| 17 | Add("CBUFFER c{}[]={{program.buffer[{}]}};", desc.index, cbuf_index); | ||
| 18 | ++cbuf_index; | ||
| 19 | } | ||
| 20 | for (const auto& desc : program.info.storage_buffers_descriptors) { | ||
| 21 | if (desc.count != 1) { | ||
| 22 | throw NotImplementedException("Storage buffer descriptor array"); | ||
| 23 | } | ||
| 24 | } | ||
| 25 | if (const size_t num = program.info.storage_buffers_descriptors.size(); num > 0) { | ||
| 26 | Add("PARAM c[{}]={{program.local[0..{}]}};", num, num - 1); | ||
| 27 | } | ||
| 28 | } | ||
| 10 | 29 | ||
| 11 | } // namespace Shader::Backend::GLASM | 30 | } // namespace Shader::Backend::GLASM |