[Vulkan] Use locally generated texture binding indices instead of GPU indices

This commit is contained in:
DrChat
2018-02-22 19:47:51 -06:00
parent da4cf1bc80
commit 77da785d70
5 changed files with 68 additions and 31 deletions

View File

@@ -12,6 +12,7 @@
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
#include "third_party/glslang-spirv/SpvBuilder.h"
@@ -157,8 +158,9 @@ class SpirvShaderTranslator : public ShaderTranslator {
spv::Id frag_outputs_ = 0, frag_depth_ = 0;
spv::Id samplers_ = 0;
spv::Id tex_[3] = {0}; // Images {2D, 3D, Cube}
spv::Id vtx_ = 0; // Vertex buffer array (32 runtime arrays)
std::map<uint32_t, uint32_t> vtx_binding_map_;
std::unordered_map<uint32_t, uint32_t> tex_binding_map_;
spv::Id vtx_ = 0; // Vertex buffer array (32 runtime arrays)
std::unordered_map<uint32_t, uint32_t> vtx_binding_map_;
// SPIR-V IDs that are part of the in/out interface.
std::vector<spv::Id> interface_ids_;