DiligentGraphics / DiligentTools

Utilities built on top of core module
Apache License 2.0
116 stars 71 forks source link

Sampler name not printed out in an error message #170

Closed speedym closed 2 years ago

speedym commented 2 years ago

When unpacking the archive, sampler name is not shown in the error message:

Diligent Engine: ERROR in ValidateSamplerDesc() (SamplerBase.cpp, 46): Description of sampler '' is invalid: Subsampled sampler requires SHADING_RATE_CAP_FLAG_SUBSAMPLED_RENDER_TARGET capability Diligent Engine: ERROR in CreateDeviceObject() (RenderDeviceBase.hpp, 511): Failed to create Sampler object '' Diligent Engine: ERROR: Debug assertion failed in GetVkSampler(), file PipelineResourceSignatureVkImpl.cpp, line 183: Debug expression failed: Ptr

With the following .json contents:

        "ImmutableSamplers": [
            {
                "ShaderStages": [ "PIXEL" ],
                "SamplerOrTextureName": "vrs_texture",
                "Desc": {
                    "MinFilter": "POINT",
                    "MagFilter": "POINT",
                    "MipFilter": "POINT",
                    "MinLOD": 0.0,
                    "MaxLOD": 0.0,
                    "Flags": [ "SUBSAMPLED" ]
                }
            }
        ]
TheMostDiligent commented 2 years ago

Note that SamplerOrTextureName is the name of the sampler or texture in the shader that the sampler object is assigned to. The name of the sampler object should be defined in the Desc, and it is missing in this case.

speedym commented 2 years ago

I have just checked and SamplerDesc struct does not contain the Name field. Also, ImmutableSamplerDesc struct does not contain the Name field as well. So it seems we can't explicitly name samplers?

MikhailGorobets commented 2 years ago

@speedym SamplerDesc inherits from DeviceObjectAttribs https://github.com/DiligentGraphics/DiligentTools/blob/master/Tests/DiligentToolsTest/assets/RenderStates/Sampler/SamplerDesc.json

speedym commented 2 years ago

Ah, correct - thanks for the info!