NikiTo

Members
  • Content count

    22
  • Joined

  • Last visited

Community Reputation

163 Neutral

About NikiTo

  • Rank
    Member

Personal Information

  • Interests
    Art
    Design
    Programming
  1. 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!
  2. I would use debug for complex applications. I didn't expected when I started with such simple task to fall in such situation. I mean, it is a simple triangle! What I would need next for one single triangle?! Profiling performance tool? I will rewrite it all from scratch and if the problem persists, I have no choice but try debugging tools too.
  3. I found this for DX11: https://msdn.microsoft.com/en-us/library/windows/desktop/bb232912 I am not sure how to use this with Dx12. It doesn't complain about the HLSL and I use: m_commandList->IASetVertexBuffers(0, 0, nullptr); and it compiles and runs, but still can't see my triangle. Rest of the code shown in the link I don't know how to use it for Dx12.
  4. I don't know what else to try... is this correct? D3D12_VIEWPORT viewPort = {}; viewPort.TopLeftX = 0; viewPort.TopLeftY = 0; viewPort.Width = TextureWidth; viewPort.Height = TextureHeight; viewPort.MinDepth = 0; viewPort.MaxDepth = 1; D3D12_RECT m_scissorRect = {}; m_scissorRect.left = 0; m_scissorRect.top = 0; m_scissorRect.right = TextureWidth; m_scissorRect.bottom = TextureHeight; tried with Z for the vertices 0.5 and nothing
  5. Viewport and scissors doesn't help. No I haven't tried PIX/debug. I'm testing each HRESULT and everything for NULL. And If something is wrong it doesn't compile here, it doesn't serialize there, doesn't initialize descriptors, it doesn't close the command list if something is wrong. So I decided to not make it more complex with more APIs for debugging. Now i'm so sleepy... Tomorrow I will try to read the vertex buffer and see if it contains expected vertex data.
  6. Here is the code that is relevant for my problem. Everything else is omitted and is giving no problems. The hlsl that compiles and later it successfully adds to the PSO: struct VSInput { float4 position : mPOSITION; float2 uv : mTEXCOORD; }; struct PSInput { float4 position : SV_POSITION; //float2 uv : TEXCOORD; }; Texture2D g_texture : register(t0); SamplerState g_sampler : register(s0); PSInput VSMain(VSInput input) { PSInput output; output.position = input.position; //output.uv = input.uv; return output; } float4 PSMain(PSInput input) : SV_TARGET { //return g_texture.Sample(g_sampler, input.uv); return float4(1.0, 0.0, 0.0, 1.0); } The part of the C++ I consider relevant to the problem: Vertex triangleVertices[] = { { { 0.0f, 0.25f, 0.0f }, { 0.5f, 0.0f } }, { { 0.25f, -0.25f, 0.0f }, { 1.0f, 1.0f } }, { { -0.25f, -0.25f, 0.0f }, { 0.0f, 1.0f } } }; // FAILED macro is omited D3DCompileFromFile(shadersPath.c_str(), nullptr, nullptr, "VSMain", "vs_5_0", 0, 0, &mvsByteCode, &errors); D3DCompileFromFile(shadersPath.c_str(), nullptr, nullptr, "PSMain", "ps_5_0", 0, 0, &mpsByteCode, &errors); D3D12_INPUT_ELEMENT_DESC mInputLayout[] = { { "mPOSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 }, { "mTEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 12, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 } }; renderQuadVertexBufferView.BufferLocation = mRenderQuadBufferDefault->GetGPUVirtualAddress(); renderQuadVertexBufferView.StrideInBytes = sizeof(Vertex); renderQuadVertexBufferView.SizeInBytes = sizeof(triangleVertices); mCommandList->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST); mCommandList->IASetVertexBuffers(0, 1, &renderQuadVertexBufferView); // this command executes painting the screen well mCommandList->ClearRenderTargetView(RTVHandleCPU, clearColor, 0, nullptr); // this command does not show the triangle mCommandList->DrawInstanced(3, 1, 0, 0); Before to attempt to render the triangle, I set the state of the vertex buffer to be D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER. Its heap is of the type DEFAULT. Do you see any problem in the shown code? If I can discard this as the source of the problem, I could search in other places.
  7. I started with AS3 all by myself and as late as at the age of 24, because until that moment everybody was trying to scare me about programming saying that: "To program you have to be a master in mathematics!! It is only for selected geniuses!"(I tried to code one day and all they said to me resulted to be a lie). Then after a month or so, I switched to assembler and there I learned to program for real, all alone again. Then I started to study Java in a university but they kicked me out for reasons not related to my codding skills. After that I started to study in another university this time C# and they kicked me again, no matter I was one of the best students. In those two short periods of studying in universities, they introduced me to HLL. I was shown by teachers about OOP and Unit Testing. Nobody of our teachers was interested in 3D programming and nobody was able to show me how to do it, so I started to learn WebGl and shaders all by myself and it was very challenging to switch to the shaders-way of thinking. It took me one whole week only to realize how interpolation from vertices to pixels is happening without a teacher. But after 6 months, of studying on my own i was able to make this: https://www.youtube.com/watch?v=mjeeZkqJy64 I had to figure out all by myself how shadow mapping and deferred rendering work. It was cool to be the only one in my second school(including the teachers) to be able to do that (they could learn how to do it too if they had interest into it, maybe) Now I am studying directx12 all by myself again. My life story is very sad in my own opinion, because without the degree, nobody wants to hire me for nothing. I understand that I need to pass through a specialization process in the company, but even when searching for junior positions, nobody calls never. And my CV is empty-forever-alone... I wish I'd have started to study medicine at the age of 24 instead programming. I would be now working in a clean office looking dirty gangrenas, not codding Pipeline State Objects in the basement of my mother's house (but this is my own experience in life. other ppl may have different happier life stories)
  8. @jpetrie Anyways, I plan to render off-screen as part of a video transcoding filter, so I don't have a 60 FPS to take into account. When it's done, it's done, I don't mind timing too much. I guess I could skip timestamps completely.
  9. If you never used them in practice and if they are intended for measuring purposes, I guess I will not pay attention to timestamps then.
  10. What do I need it for, but practically? I read the very few words in MSDN saying what it does, but I need a practical pseudo-example of how would you use it and what you obtain from using it.
  11. I began with ASM for Intel. I made BIOS real time emulator with 256 bit code extensions and without using the RAM...... It helped me for nothing in life! I can't use it to find a job! Total loss of time! I then started with C# and it seems ok for me. I learned to use it in no time, so it took minimal time investment. Now I am forced to use C++ for Microsoft Media Foundation and DirectX and I don't want to repeat the error from ASM and invest too much time learning something too hard to learn as C++ and that i can't find a job with, because it is considered so advanced that employers just don't believe me unless I show them a master degree and 2 years of successful job experience. And i just don't have 7 years to give away.
  12. Good to know! I now will not worry about the worth of my posts. I already codded the "hit Y/N" solution. I need it as simple as possible, because I'm a newbie in C++. My soul hurts when I deal with C++
  13. Thanks for the answer @Alberth after user determines for very sure(by viewing it being decoded nicely(because sometimes the video decodes into a mess of huge random squares)) that the given codec works, the app will do more stuff on the videos that are decoding valid images/frames. All the videos for which user types in "yes" i will store them into a vector of videos to be further being processed by the app. The purpose of the app is not to watch videos. I think I could just print: "Please hit "Y" if you see the video playing or "N" if you can't see it" and catch it from the window messages handling routine. I think i could do it this way. Sometimes some of my posts result to be of no help for others in the forum, but I think i can not delete them myself...
  14. Hi! I have a console app. From the console I ask the user if he/she wants to test if the videos provided in a folder can be decoded. If user types "yes", I open a window without closing the console. The window has drop-down menu that lets user pick up from the various videos found in the given folder. I want when user picks up a video from the menu of the window, in the console the app to print: "Can you see the video playing?" and then i use "std::getline()" to wait for an answer. So far it is ok, but what will happen for the case, user selects another video from the window's menu. When selecting another video now the app makes the old one to stop playing and the new one to start playing immediately.... but what about the waiting "getline()"... how to kill it if user uses the window controls to close the preview window or to switch to another video? I will use a boolean to know if there is a getline waitning, but don't know how to kill it. Maybe I should create a pop-up menu on top of the window playing the video to make the user pick up between: "can see it" and "can not see it". What would be the easiest way to do it? How would you do it? I need the simplest way possible. (i catch all possible errors(all i know about) at every point, but sometimes without any error reported, the video is black and not showing My Little Pony)
  15. Hi. It is a little bit unclear for me. I have in hands demos from Intel and they create reset and put commands to the command lists at any frame. If my commands are going to be always the same for the whole program and in the same order, how can I reuse for real the commands. How to create the command list, put the commands inside and just use it in each frame, not issuing all the commands again and again? I need to know why all the demos are doing it this way(re-issuing the command to the command list)? Is it required to be that way by the designers of the API? Do I have to create a bundle of the size of the whole command list if I want pre-compilation?