Encoded compute shader size doesn't match specified size

Started by
1 comment, last by VigneshMohan 1 year, 6 months ago

I am trying to CreateComputePipelineState for a raytracing project. I have the shader byte codes compiled with proper arguments. But I get the following error.
D3D12 ERROR: ID3D12Device::CreateComputeShader: Encoded Compute Shader size doesn't match specified size. [ STATE_CREATION ERROR #322: CREATECOMPUTESHADER_INVALIDSHADERBYTECODE]

And the compiled size is indeed bigger than the source file but I have no idea why. Any suggestions? Thanks in advance

Advertisement

I fixed it! For anyone running into the same issue - Don't store your compiled D3D12SHADERBYTECODE and use it later. Like I am doing here. I am not sure what the issue with that, but I guess it has something to do with it going out of scope by the time you use it!

This topic is closed to new replies.

Advertisement