From 028f0033bd8d1e2eece7eb6e9b5bf716c739b450 Mon Sep 17 00:00:00 2001
From: ReinUsesLisp <reinuseslisp@airmail.cc>
Date: Sun, 23 May 2021 03:43:17 -0300
Subject: shader: Remove shader util

---
 src/shader_recompiler/file_environment.cpp | 50 ------------------------------
 1 file changed, 50 deletions(-)
 delete mode 100644 src/shader_recompiler/file_environment.cpp

(limited to 'src/shader_recompiler/file_environment.cpp')

diff --git a/src/shader_recompiler/file_environment.cpp b/src/shader_recompiler/file_environment.cpp
deleted file mode 100644
index f2104f444e..0000000000
--- a/src/shader_recompiler/file_environment.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-#include <cstdio>
-
-#include "exception.h"
-#include "file_environment.h"
-
-namespace Shader {
-
-FileEnvironment::FileEnvironment(const char* path) {
-    std::FILE* const file{std::fopen(path, "rb")};
-    if (!file) {
-        throw RuntimeError("Failed to open file='{}'", path);
-    }
-    std::fseek(file, 0, SEEK_END);
-    const long size{std::ftell(file)};
-    std::rewind(file);
-    if (size % 8 != 0) {
-        std::fclose(file);
-        throw RuntimeError("File size={} is not aligned to 8", size);
-    }
-    // TODO: Use a unique_ptr to avoid zero-initializing this
-    const size_t num_inst{static_cast<size_t>(size) / 8};
-    data.resize(num_inst);
-    if (std::fread(data.data(), 8, num_inst, file) != num_inst) {
-        std::fclose(file);
-        throw RuntimeError("Failed to read instructions={} from file='{}'", num_inst, path);
-    }
-    std::fclose(file);
-}
-
-FileEnvironment::~FileEnvironment() = default;
-
-u64 FileEnvironment::ReadInstruction(u32 offset) {
-    if (offset % 8 != 0) {
-        throw InvalidArgument("offset={} is not aligned to 8", offset);
-    }
-    if (offset / 8 >= static_cast<u32>(data.size())) {
-        throw InvalidArgument("offset={} is out of bounds", offset);
-    }
-    return data[offset / 8];
-}
-
-u32 FileEnvironment::TextureBoundBuffer() const {
-    throw NotImplementedException("Texture bound buffer serialization");
-}
-
-std::array<u32, 3> FileEnvironment::WorkgroupSize() const {
-    return {1, 1, 1};
-}
-
-} // namespace Shader
-- 
cgit v1.2.3-70-g09d2