break dependency of Program on SamplerInterfaceBlock and SamplerBindingMap

Instead of passing SamplerInterfaceBlocks and a SamplerBindingMap to
Program, we now set a 'sampler group' per binding point:

Program::addSamplerGroup(...)

A sampler group here consists of a list of N 'Sampler' and a 'Sampler'
is just a unique name (unifrom name in the shader) and binding point in
the shader.

That's all the driver layer needs.

With this change we get rid of the code that re-created the uniform
names in the driver -- this should never have been done there. And we
also remove the hash-map lookups in vulkan and metal drivers.
This commit is contained in:
Mathias Agopian
2019-03-06 15:39:23 -08:00
committed by Mathias Agopian
parent b0d640832a
commit 2a72e8aee8
17 changed files with 142 additions and 127 deletions

View File

@@ -33,11 +33,11 @@ int StaticString::compare(const StaticString& rhs) const noexcept {
// ------------------------------------------------------------------------------------------------
UTILS_NOINLINE
CString::CString(const char* cstr, size_type length) {
CString::CString(const char* cstr, size_t length) {
if (length && cstr) {
assert(length == strlen(cstr));
Data* p = (Data*)malloc(sizeof(Data) + length + 1);
p->length = length;
p->length = (size_type)length;
mCStr = (value_type*)(p + 1);
// we don't use memcpy here to avoid a call to libc, the generated code is pretty good.
std::uninitialized_copy_n(cstr, length + 1, mCStr);