Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

124 Neutral

About Lumz

  • Rank
  1. RESOLVED: DirectX control pannel was set to break on state creation. Dunno why it didn't break before, but it solved the problem.   EDIT: It seems that the only problem is the D3D11_CREATE_DEVICE_DEBUG flag. As i don't get any issues if i set flags to 0 when calling D3D11CreateDeviceAndSwapChain.   Hello,   I'm not completly sure that this topic is at its right place, because i'm not sure of the problem itself. Nevertheless, here it is.   I've been compiling and debugging (F5) without any trouble both in debug and release mode WIHTOUT changing the debug path in vs2012. The current folder hierarchy looks like follow:   Root Binaries Debug Project1.exe Project2.dll ... Release Projects Project1.vsxproj Project2.vsxproj ... Temp Debug Project1 Project1.exe ... Project2 Project2.dll ... ... Release ...   I'm using a post-build step that simply copy *.exe and *.dll from the temp folder to the binaries folder. I'm trying to specify vs2012 that the binary i want to debug is the one in the binaries folder. So i did specify the correct path in the project settings but as i reach D3D11CreateDeviceAndSwapChain and ONLY in debug mode ( with D3D11_CREATE_DEVICE_DEBUG ), i get an unhandle exception from D3D11. D3D11 INFO: Create ID3D11Context: Name="unnamed", Addr=0x005F5818, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097225: CREATE_CONTEXT] D3D11: **BREAK** enabled for the previous message, which was: [ INFO STATE_CREATION #2097225: CREATE_CONTEXT ] Exception de première chance à 0x7637C41F (KernelBase.dll) dans Sandbox.exe : 0x0000087A (paramètres : 0x00000003, 0x0059C424, 0x0059D184). Exception non gérée à 0x7637C41F (KernelBase.dll) dans Sandbox.exe : 0x0000087A (paramètres : 0x00000003, 0x0059C424, 0x0059D184). As said previously i have no troubles if i don't change the binary's path. Anyone has a suggestion ? Regards.
  2. Thank you, very helpful. It's my first time with Direct X and i've done this deferred rendering engine. The problem is that it's actually quite slow compared to forward MPML. So i thought maybe i could use a better format for my gbuffer. I'm currently using DXGI_FORMAT_R32G32B32A32_FLOAT and only storing float3 for each pixel. What do you recommend ?
  3. Hi,    I've been trying to change my render target format from DXGI_FORMAT_R32G32B32A32_FLOAT (working) to DXGI_FORMAT_R32G32B32_FLOAT (not working) but i'm getting INVALID_ARG on CreateTexture2D().   I can't find anything about it on MSDN. Maybe it's unrelated but i may rather post the whole description.   m_tex2d_desc.Width = 1280; m_tex2d_desc.Height = 720; m_tex2d_desc.MipLevels = 0; m_tex2d_desc.ArraySize = 1; m_tex2d_desc.Format = DXGI_FORMAT_R32G32B32_FLOAT; m_tex2d_desc.SampleDesc.Count = 1; m_tex2d_desc.Usage = D3D11_USAGE_DEFAULT; m_tex2d_desc.BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE; m_tex2d_desc.CPUAccessFlags = 0; m_tex2d_desc.MiscFlags = 0;   Regards.
  4. I get this :    And yes, i've been turning around so much the shader's code that i simply forgot what i started with. After checking every single variable in several cbuffers i've noticed that only those with custom struct was unable to map correctly.   Btw : Thank you for your concern. I've been stuck on this for days.
  5. I think i've reduced the problem to that : It is simply not possible to use an array of custom struct types in a cbuffer. It doesn't seems to have anything to do with the register order.   Btw : i'd like to try the fxc.exe but i've never used it before. Could you just post the standard compile command ?   Thank you.
  6. No,   I did try with registers and yet it didn't worked. I even swapped first and second cbuffer to ensure that apparition order is irrelevant. And PSSetConstantBuffers call sequence is irrelevant too.
  7. RESOLVED : For the newbie's purpose, the problem was simply that i thought padding could occur anywhere (in this case at the end of the struct). But the packing has to be done every 16 bytes involving padding in the middle of the struct.   Hi,   I'm new to d3d11 so i apologies for this newbie question.   I'm trying to map data to several cbuffer but it seems that only the first (register(cb0)) cbuffer is actually getting correct data. I have no control what so ever on what is written in the next ones.   The problem appears only in the pixel shader. I've tried to add an extra cbuffer in the vertex shader and there's i no problem. I think i have correctly aligned data to 16 bytes packing. I use the same MatrixBuffer for both vertex shader and pixel shader. Map() call sequence order is irrelevant and doesn't change anything.   EDIT : I've managed to reduce code to the following snippet. I'm using same buffer for cbuffer TestBuffer. And it works in the vertex shader but not in the pixel shader.   EDIT 2 : If i set TestBuffer : register(cb0) and MatrixBuffer : register(cb1) in the pixel shader i now get this strange compile error :     VertexShader : // Typedefs //------------------------------------------------ struct VertexInputType { float4 position : POSITION; float3 normal : NORMAL; }; struct PixelInputType { float4 v_position : SV_POSITION; float3 w_normal : NORMAL; float3 w_position : TEXCOORD0; }; // Globals //------------------------------------------------ cbuffer MatrixBuffer { float4x4 world; float4x4 view; float4x4 projection; }; cbuffer TestBuffer { float4 test; } // Shader //------------------------------------------------ PixelInputType SPMLVShader(VertexInputType input) { PixelInputType output; output.v_position = input.position; output.w_normal = input.normal; // Change the position vector to be 4 units for proper matrix calculations. input.position.w = 1.0f; // Calculate the position of the vertex in world coordinates. output.w_position = mul(input.position, world); // Calculate the position of the vertex against the world, view, and projection matrices. output.v_position.xyz = output.w_position.xyz; output.v_position = mul(output.v_position, view); output.v_position = mul(output.v_position, projection); // Calculate the normal vector against the world matrix only. output.w_normal = mul(input.normal, (float3x3)world); // Normalize the normal vector. output.w_normal = normalize(output.w_normal); // CORRECT OUTPUT if(test.x == 222 && test.y == 223 && test.z == 224 && test.w == 225) { return output; } // DO NOT DISPLAY ANYTHING output.v_position = float4(0, 0, 0, 0); return output; }   PixelShader : // Typedefs //------------------------------------------------ struct PixelInputType { float4 v_position : SV_POSITION; float3 w_normal : NORMAL; float3 w_position : TEXCOORD; }; // Globals //-------------------------------------- cbuffer MatrixBuffer { float4x4 world; float4x4 view; float4x4 projection; }; cbuffer TestBuffer { float4 test; }; float4 SPMLPShader(PixelInputType input) : SV_TARGET { if(test.x == 222 && test.y == 223 && test.z == 224 && test.w == 225) { return float4(0.0f, 1.0f, 0.0f, 1.0f); } else { return float4(1.0f, 0.0f, 0.0f, 1.0f); } }     I've been searching a lot, but i have no clue yet on where it comes from.   Best regards.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!