vulkano icon indicating copy to clipboard operation
vulkano copied to clipboard

Check limits of shaders

Open tomaka opened this issue 8 years ago • 4 comments

When a shader module is loaded, its limits should be tested against the physical device's limits.

For example: the compute shader local size.

tomaka avatar Jul 04 '17 06:07 tomaka

Ah, finally, I managed to make my shader run. \o/ Had to split my huge type buffer into four uniform buffers: https://github.com/Limeth/vulkanscratch/commit/014e3b67fc73c1c9578e5efaa042db1b0a2f784f#diff-fa64695cdbdb0df80db519205333f1d2R812 :smile:

Also, I noticed that Vulkano would display an error message that the type of the uniform buffer was too large after I updated Vulkano to the master branch, so this might be fixed?

Limeth avatar Aug 13 '17 18:08 Limeth

Also, I noticed that Vulkano would display an error message that the type of the uniform buffer was too large after I updated Vulkano to the master branch, so this might be fixed?

No, that's probably because a check is performed when adding the buffer to a descriptor set.

tomaka avatar Aug 13 '17 20:08 tomaka

Actually we don't need to check the limits when a shader module is loaded but only when the pipeline layout is created (that's what the specs say). Therefore it is much easier to implement, as we don't have to introspect the shader module further than we already do.

tomaka avatar Aug 21 '17 17:08 tomaka

Let's keep this open in fact. There are other limits that aren't checked yet:

    uint32_t              maxTessellationGenerationLevel;
    uint32_t              maxTessellationPatchSize;
    uint32_t              maxTessellationControlPerVertexInputComponents;
    uint32_t              maxTessellationControlPerVertexOutputComponents;
    uint32_t              maxTessellationControlPerPatchOutputComponents;
    uint32_t              maxTessellationControlTotalOutputComponents;
    uint32_t              maxTessellationEvaluationInputComponents;
    uint32_t              maxTessellationEvaluationOutputComponents;
    uint32_t              maxGeometryShaderInvocations;
    uint32_t              maxGeometryInputComponents;
    uint32_t              maxGeometryOutputComponents;
    uint32_t              maxGeometryOutputVertices;
    uint32_t              maxGeometryTotalOutputComponents;
    uint32_t              maxFragmentInputComponents;
    uint32_t              maxFragmentOutputAttachments;
    uint32_t              maxFragmentDualSrcAttachments;
    uint32_t              maxFragmentCombinedOutputResources;
    uint32_t              maxComputeSharedMemorySize;
    uint32_t              maxComputeWorkGroupCount[3];
    uint32_t              maxComputeWorkGroupInvocations;
    uint32_t              maxComputeWorkGroupSize[3];

tomaka avatar Aug 22 '17 12:08 tomaka