Merge pull request #52 from h3xl3r/master

Fix for array textures in GLSL < 130, and fix for MSL sequential resource binding
This commit is contained in:
Hans-Kristian Arntzen 2016-09-17 14:20:52 +02:00 коммит произвёл GitHub
Родитель 5fa4bc6874 691072894f
Коммит b812cec992
2 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -1798,10 +1798,10 @@ string CompilerGLSL::legacy_tex_op(const std::string &op, const SPIRType &imgtyp
switch (imgtype.image.dim)
{
case spv::Dim1D:
type = "1D";
type = (imgtype.image.arrayed && !options.es) ? "1DArray" : "1D";
break;
case spv::Dim2D:
type = "2D";
type = (imgtype.image.arrayed && !options.es) ? "2DArray" : "2D";
break;
case spv::Dim3D:
type = "3D";
@ -4479,7 +4479,11 @@ string CompilerGLSL::image_type_glsl(const SPIRType &type)
if (type.image.ms)
res += "MS";
if (type.image.arrayed)
{
if (!options.es && options.version < 130)
require_extension("GL_EXT_texture_array");
res += "Array";
}
if (type.image.depth)
res += "Shadow";

Просмотреть файл

@ -31,8 +31,6 @@ CompilerMSL::CompilerMSL(vector<uint32_t> spirv_)
string CompilerMSL::compile(MSLConfiguration &msl_cfg, vector<MSLVertexAttr> *p_vtx_attrs,
std::vector<MSLResourceBinding> *p_res_bindings)
{
next_metal_resource_index = MSLResourceBinding(); // Start bindings at zero
pad_type_ids_by_pad_len.clear();
msl_config = msl_cfg;
@ -78,6 +76,8 @@ string CompilerMSL::compile(MSLConfiguration &msl_cfg, vector<MSLVertexAttr> *p_
reset();
next_metal_resource_index = MSLResourceBinding(); // Start bindings at zero
// Move constructor for this type is broken on GCC 4.9 ...
buffer = unique_ptr<ostringstream>(new ostringstream());