Failed to link shader with program due to the H/W compatibility matter?

Hello,

I am experimenting clustered shading on my machine, and found some incompatibility issue with my system.
I would like to know if there is any workaround for this?
I’ve updated driver to the latest but still the same.

[Part of source code]

unsigned int ComputeShader::compileShader(unsigned int type, const string& source) {
		GLCall(unsigned int id = glCreateShader(type));
		const char* src = source.c_str();
		GLCall(glShaderSource(id, 1, &src, nullptr));
		GLCall(glCompileShader(id));

		int result;
		GLCall(glGetShaderiv(id, GL_COMPILE_STATUS, &result));

		if (result == GL_FALSE) {
			int length;
			GLCall(glGetShaderiv(id, GL_INFO_LOG_LENGTH, &length));
			auto msg = std::make_unique<char[]>(length);
			GLCall(glGetShaderInfoLog(id, length, &length, msg.get()));
			cerr << "Failed Compilation of compute shader: " << m_FilePath << endl;
			cerr << msg.get() << endl;
			GLCall(glDeleteShader(id));
			return 0;
		}

		return id;
	}

	unsigned int ComputeShader::createShader(const string& source) {
		GLCall(unsigned int program = glCreateProgram());
		unsigned int shaderID = compileShader(GL_COMPUTE_SHADER, source);

		GLCall(glAttachShader(program, shaderID));
		GLCall(glLinkProgram(program));

		GLint status = 0;
		GLCall(glGetProgramiv(program, GL_LINK_STATUS, &status));

		if (status == GL_FALSE) {
			int length;
			GLCall(glGetProgramiv(program, GL_INFO_LOG_LENGTH, &length));
			auto msg = std::make_unique<char[]>(length);
			GLCall(glGetProgramInfoLog(program, length, &length, msg.get()));
			cerr << "Failed Compilation of link program: " << m_FilePath << endl;
			cerr << msg.get() << endl;
			GLCall(glDeleteProgram(program));
			return 0;
		}

		GLCall(glValidateProgram(program));

		GLCall(glDeleteShader(shaderID));

		return program;
	}

[Shader]

#version 430 core
layout (local_size_x = 1, local_size_y = 1) in;

layout (std430, binding = 3) buffer ActiveClusterMaskBuffer {
    bool activeClusterMask[];
};

layout (std430, binding = 4) buffer ActiveClusterBuffer {
    uint activeClusters[];
};

struct DispatchIndirectParams {
    uint x, y, z;
};

layout (std430, binding = 5) buffer UniqueActiveClusterCountBuffer {
    DispatchIndirectParams cullLightsDispatchParams;
};

void main() {
    uint clusterIdx = gl_WorkGroupID.x +
        gl_WorkGroupID.y * gl_NumWorkGroups.x +
        gl_WorkGroupID.z * gl_NumWorkGroups.y * gl_NumWorkGroups.x;

    if (activeClusterMask[clusterIdx]) {
        uint idx = atomicAdd(cullLightsDispatchParams.x, 1);
        activeClusters[idx] = clusterIdx;
    }
}

[Error]

Failed Compilation of link program: shaders/compute/compress_active_clusters.comp
Compute shader(s) failed to link.
Compute link error: HW_UNSUPPORTED.
ERROR: Internal compile error, error code: E_SC_NOTSUPPORTED
Shader not supported by HW

[H/W]
Laptop: Macbook Pro (2018)
GPU: Radeon Pro 555X (Intel UHD Graphics 630)

Unless you’ve installed a non-MacOS operating system on your Macbook, your code can’t work. MacOS has never supported any version of OpenGL higher than 4.1 (and GL is deprecated on MacOS, so this seems unlikely to change).

1 Like

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.