Advertisement

Problem with rendering a simple triangle

Started by August 04, 2017 02:43 AM
12 comments, last by galop1n 7 years, 6 months ago

Are you clearing Z-Buffer to 1.0f?

.:vinterberg:.

Can you see the error?
 


D3D12_SHADER_BYTECODE vertShaderBytecode = {};
vertShaderBytecode.pShaderBytecode = reinterpret_cast<UINT8*>(mvsByteCode->GetBufferPointer());
vertShaderBytecode.BytecodeLength = mvsByteCode->GetBufferSize();
psoDesc.VS = vertShaderBytecode;

D3D12_SHADER_BYTECODE pixelShaderBytecode = {};
vertShaderBytecode.pShaderBytecode = reinterpret_cast<UINT8*>(mpsByteCode->GetBufferPointer());
vertShaderBytecode.BytecodeLength = mpsByteCode->GetBufferSize();
psoDesc.PS = pixelShaderBytecode;


I installed RenderDoc but I was unable to make use of it, because I am having the Dx12 code inside a DLL invoked through COM by another program and the UI was not so intuitive for me. So I had to add tons of code to print back the content of resources(shown in the picture). Once discarded the buffers as the origin of the problem, I used the helpers inside D3d12.h(what I do normally is avoid D3d12.h at all because I want to learn better how Dx12 works). I noticed that changing my code for CD3DX12_SHADER_BYTECODE is making it work and that made me localize the error that(I'm sorry for this) has nothing to do with Dx12.

Well! That triangle was tough!

fdgfdure.PNG

Advertisement

It is a stupid copy paste mistake, you put the pixel shader bytecode and size to the vertex variable on , and ends up with an empty pixel shader struct. That is all.

 

You would have found that in 2 min with a capture in PIX, as you would have spot the missing pixel shader stage !

This topic is closed to new replies.

Advertisement