Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
601 views
in Technique[技术] by (71.8m points)

opengl - Compute shader link failure on Intel HD 4xxx / 5xxx GPUs

The following compute shader is causing troubles on Intels HD 4xxx / 5xxx series GPUs, using an OpenGL 4.3 Core context.

It compiles, but then fails to link with an absolutely useless error message:

SHADER_ID_LINK error has been generated. GLSL link failed for program 4, "": Out of resource error.

As far as I understand this shader should be completely legal on a GPU which claims to be OpenGL 4.3 compliant, and it does in fact work on newer GPUs just fine.

Seen the error happening on 20.19.15.5126 and a number of different, all up-to-date driver versions. OS Windows 8 and Windows 10, 64bit variants.

#version 430 core

// DO NOT CHANGE, must match game internal layout
struct TileData {
    // TF_ flags 0:32
    uint flags;
    // TF_ flags 32:64
    uint flags2;

    // Sprites are all:
    // spriteID=0:16, spriteFlags=16:32
    uint floorSpriteUID ;
    uint wallSpriteUID;
    
    uint itemSpriteUID;
    uint creatureSpriteUID;

    uint jobSpriteFloorUID;
    uint jobSpriteWallUID;

    // fluidLevel=0:8, lightLevel=0:8, vegetationLevel=8:16
    uint packedLevels;
};

struct TileDataUpdate {
    uint id;
    TileData tile;
};

layout(std430, binding = 0) writeonly restrict buffer tileData1
{
    TileData data[];
} tileData;

layout(std430, binding = 1) readonly restrict buffer tileDataUpdate1
{
    TileDataUpdate data[];
} tileDataUpdate;

uniform int uUpdateSize;

layout(local_size_x = 64) in;

void main()
{
    uint id = gl_GlobalInvocationID.x;
    if(id < uUpdateSize)
    {
        TileDataUpdate data = tileDataUpdate.data[id];
        tileData.data[data.id] = data.tile;
    }
}

Does anyone have a clue what could possibly be the cause for the link error? I don't have access to any such GPU myself, so I'm unable to test that by myself.

EDIT: Testing with a 5 years old driver version (20.19.15.4624) it does actually work out of the box. So this is (yet another) regression in Intels drivers. Still clueless what exactly is triggering the bug or how to work around it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...