• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

brasslips2

Members
  • Content count

    59
  • Joined

  • Last visited

Community Reputation

117 Neutral

About brasslips2

  • Rank
    Member
  1. Well, here's my implementation if anyone is wanting this for their project. Big thanks to MJP for leading me in the right direction. He was right that the constant buffers are accessible but the shaders aren't. Below is some code that I wrote to add debug names to the shaders. You'd do similar stuff for hull, computer shaders, etc. I can't guarantee that my way is the best way to do it. But it works nevertheless. Hope it helps if anyone was in the same boat as I was... ---The added Code to Effect.. d3dx11effect.h(ID3DX11Effect ~1524) [code] STDMETHOD_(HRESULT, GetVertexShader)(THIS_ ID3D11VertexShader **ppVS) PURE; STDMETHOD_(HRESULT, GetPixelShader)(THIS_ ID3D11PixelShader **ppPS) PURE;[/code] Effect.h(CEffect ~1219) [code] STDMETHOD_(HRESULT, GetVertexShader)(ID3D11VertexShader **ppVS); STDMETHOD_(HRESULT, GetPixelShader)(ID3D11PixelShader **ppPS);[/code] EffectReflection.cpp(2151)[code]HRESULT CEffect::GetVertexShader(ID3D11VertexShader **ppVS) { if(m_pShaderBlocks != NULL) { for(UINT i = 0; i < m_ShaderBlockCount; ++i) { if(m_pShaderBlocks[i].GetVertexShader(ppVS) == S_OK) { return S_OK; } } } return S_FALSE; } HRESULT CEffect::GetPixelShader(ID3D11PixelShader **ppPS) { if(m_pShaderBlocks != NULL) { for(UINT i = 0; i < m_ShaderBlockCount; ++i) { if(m_pShaderBlocks[i].GetPixelShader(ppPS) == S_OK) { return S_OK; } } } return S_FALSE;}[/code] ---------- Using the code... [code]// Set the vertex shader name ID3D11VertexShader* pVertexShader; effect->GetVertexShader(&pVertexShader); DXUT_SetDebugName(pVertexShader, YOUR_DEBUG_NAME); SAFE_RELEASE(pVertexShader); // Set the pixel shader name ID3D11PixelShader* pPixelShader; effect->GetPixelShader(&pPixelShader); DXUT_SetDebugName(pPixelShader, YOUR_DEBUG_NAME); SAFE_RELEASE(pPixelShader); // Set the debug name for the constant buffers UINT bufferIndex = 0; ID3DX11EffectConstantBuffer* cBuffer = effect->GetConstantBufferByIndex(bufferIndex); while(cBuffer->IsValid()) { ID3D11Buffer* ccBuffer; cBuffer->GetConstantBuffer(&ccBuffer); DXUT_SetDebugName(ccBuffer, YOUR_DEBUG_NAME); SAFE_RELEASE(ccBuffer); cBuffer = effect->GetConstantBufferByIndex(++bufferIndex); }[/code] ------ VUALA IT WORKS!
  2. [quote name='MJP' timestamp='1316371795' post='4863105'] Those are objects created by the effect. The first is a buffer (probably a constant buffer), the second is a vertex shader, and the third is a pixel shader. There could be even more of these objects in an effect, depending on how many techniques and passes you have. I know you can access constant buffers through GetConstantBufferByIndex and GetConstantBufferByName, but I don't think there's any way to access the underlying shaders. Of course, since you have the Effects11 source code you could always modify it to set the debug names or to provide access to the shaders. [/quote] Thanks, I was wondering why it wasn't very straight forward. I guess I'm off to editing the effects framework then... sigh =(
  3. [color=#1C2837][size=2]DXUT_SetDebugName calls SetPrivateData on the object... thanks, but that doesn't really help. [/size][/color]
  4. Anyone? I'm still having this issue.
  5. When I call release on my effects object like the following: ID3DX11Effect *effect; hr = D3DX11CreateEffectFromMemory(effectBlob->GetBufferPointer(), effectBlob->GetBufferSize(), 0, pDevice, &effect); ... effect->Release() ------------------ I get the following output after I step over the release of the effect shown above D3D11: INFO: Destroy Buffer: Name="unnamed", Addr=0x0049F67C [ STATE_CREATION INFO #2097230: DESTROY_BUFFER ] D3D11: INFO: Destroy VertexShader: Name="unnamed", Addr=0x0049F8DC [ STATE_CREATION INFO #2097251: DESTROY_VERTEXSHADER ] D3D11: INFO: Destroy PixelShader: Name="unnamed", Addr=0x0049C23C [ STATE_CREATION INFO #2097263: DESTROY_PIXELSHADER ] I know I'm supposed to call the following... DXUT_SetDebugName(object, "object name"); I have also created my device with the correct debug flag as such: D3D11_CREATE_DEVICE_DEBUG; However, since I'm using effects what object do i pass into my SetDebugName function to fix the above "unnamed" values and how do I get that object from the effect?
  6. So this was caused by my screen width and height to be garbage data when running through pix. The reason being was that my width and height I was reading from XML with with a file reference as such: TiXmlDocument doc("Assets/XML/WindowsTweakables.xml"); if(!doc.LoadFile()) return; When running through PIX it wasn't getting the proper file directory and returning so my variables from this file weren't being initialized. To fix this I tried the following: project properties -> c/c++ -> preprocessor -> Preprocesor Definitions: and added this MY_SOLUTIONDIR=$(SolutionDir) That creates a define with the full c:/ extension. Now I'm stuck on figuring out how to turn the define into a string since it doesn't include the quotes at the beginning and end. If anyone knows a cool way to turn it into a string that would be helpful =D *UPDATE*: MY_SOLUTIONDIR expands to something like: C:\Users\***\Desktop\***\TestProject\Debug\\ #define ADD_QUOTES_HELPER(s) #s #define ADD_QUOTES(s) ADD_QUOTES_HELPER(s) std::string filename(ADD_QUOTES(MY_SOLUTIONDIR)); ** For some reason the above doesn't work to add the quotes... instead I get: warning C4129: 'D' : unrecognized character escape sequence warning C4129: 'T' : unrecognized character escape sequence Any 1337 macro programmers know how to fix this?
  7. So, this is weird. When i run my program normally from visual studio it runs perfectly fine and the CreateDeviceAndSwapChain return S_OK. However, if I start my executable through PIX I get the following error: PIX Logfile created at: 1:08:48 AM Frame 000001 ....PRE: Frame(1) Trigger 'Frame 1' fired Frame 000001 ........PRE: D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 2, 0x0042F864, 3, 7, 0x0042F814, 0x03B280D8, 0x03B280D4, 0x03B280E0, 0x03B280E8) D3D11: ERROR: ID3D11Device::CreateTexture2D: The Dimensions are invalid. For feature level D3D_FEATURE_LEVEL_10_0, the Width (value = -842150451) must be between 1 and 8192, inclusively. The Height (value = -842150451) must be between 1 and 8192, inclusively. And, the ArraySize (value = 1) must be between 1 and 512, inclusively. [ STATE_CREATION ERROR #101: CREATETEXTURE2D_INVALIDDIMENSIONS ] D3D11: ERROR: ID3D11Device::CreateTexture2D: Returning E_INVALIDARG, meaning invalid parameters were passed. [ STATE_CREATION ERROR #104: CREATETEXTURE2D_INVALIDARG_RETURN ] Frame 000001 ........POST: <E_INVALIDARG> D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 2, 0x0042F864, 3, 7, 0x0042F814, 0x03B280D8, 0x03B280D4, 0x03B280E0, 0x03B280E8) Frame 000001 ........PRE: D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_WARP, NULL, 2, 0x0042F864, 3, 7, 0x0042F814, 0x03B280D8, 0x03B280D4, 0x03B280E0, 0x03B280E8) D3D11: ERROR: ID3D11Device::CreateTexture2D: The Dimensions are invalid. For feature level D3D_FEATURE_LEVEL_10_1, the Width (value = -842150451) must be between 1 and 8192, inclusively. The Height (value = -842150451) must be between 1 and 8192, inclusively. And, the ArraySize (value = 1) must be between 1 and 512, inclusively. [ STATE_CREATION ERROR #101: CREATETEXTURE2D_INVALIDDIMENSIONS ] D3D11: ERROR: ID3D11Device::CreateTexture2D: Returning E_INVALIDARG, meaning invalid parameters were passed. [ STATE_CREATION ERROR #104: CREATETEXTURE2D_INVALIDARG_RETURN ] Frame 000001 ........POST: <E_INVALIDARG> D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_WARP, NULL, 2, 0x0042F864, 3, 7, 0x0042F814, 0x03B280D8, 0x03B280D4, 0x03B280E0, 0x03B280E8) Frame 000001 ........PRE: D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_REFERENCE, NULL, 2, 0x0042F864, 3, 7, 0x0042F814, 0x03B280D8, 0x03B280D4, 0x03B280E0, 0x03B280E8) D3D11: ERROR: ID3D11Device::CreateTexture2D: The Dimensions are invalid. For feature level D3D_FEATURE_LEVEL_11_0, the Width (value = -842150451) must be between 1 and 16384, inclusively. The Height (value = -842150451) must be between 1 and 16384, inclusively. And, the ArraySize (value = 1) must be between 1 and 2048, inclusively. [ STATE_CREATION ERROR #101: CREATETEXTURE2D_INVALIDDIMENSIONS ] D3D11: ERROR: ID3D11Device::CreateTexture2D: Returning E_INVALIDARG, meaning invalid parameters were passed. [ STATE_CREATION ERROR #104: CREATETEXTURE2D_INVALIDARG_RETURN ] Frame 000001 ........POST: <E_INVALIDARG> D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_REFERENCE, NULL, 2, 0x0042F864, 3, 7, 0x0042F814, 0x03B280D8, 0x03B280D4, 0x03B280E0, 0x03B280E8) An unhandled exception occurred. Closing Run File Any ideas?
  8. Thanks! That was what I needed.
  9. I'm using the effects system... As the title says, is there any way to get the name of the technique using something similar to shader reflection? I'm trying to find the name of my shader so I can create a mapping between its name and the D3D11_INPUT_ELEMENT_DESC* technique11 SuperUberBloomShader ( I want this name ) { pass P0 { SetVertexShader( CompileShader( vs_4_0, VS() ) ); SetGeometryShader( NULL ); SetPixelShader( CompileShader( ps_4_0, PS() ) ); } ... } Thanks!
  10. Quote:Original post by DieterVW Actually, you can figure out everything you need in order to build an InputLayout. We already know that the SemanticName and SemanticIndex are a one to one mapping. The Format can be figured out by looking at the the ComponentType and the ComponentMask UINT32 -> DXGI_FORMAT_*_UINT SINT32 -> DXGI_FOMRAT_*_SINT FLOAT32 -> DXGI_FORMAT_*_FLOAT The mask indicates if it is a 1,2,3, or 4 vector, which will help you choose which of the above formats to use. Build a table that will let you easily pick the right format. Alright, so I have everything now except for the format. I'm not really sure how I can use the mask to help figure out what the format should be. Currently, when i run my app and the first input parameter is created the mask has a value of 15'' and the Component type is D3D_REGISTER_COMPONENT_FLOAT32. Going off of just using the D3D_REGISTER_COMPOENENT_FLOAT32 we can narrow the possibilities to about 10 different enum values. Maybe I'm just confused because I don't understand how the mask relates to the registers.
  11. As far as matching the input layout with the information the reflection gives you I'm a bit confused on. For instance, the SIGNATURE_PARAMETER_DESC gives this: SemanticName SemanticIndex Register SystemValueType ComponentType Mask readWriteMask Stream However, the CreateInputLayout function takes an array of input_element_desc. Next to each variable I've written if it matches the above structure or not. Input_element_desc contain the following: SemanticName SemanticIndex Format InputSlot AlignedByteOffset InputSlotClass InstanceDataStepRate So the problem here is trying to match these sets of data without hard-coding it. Is it possible to get all of the information from the reflection to fill the input_element_desc structure? One of the issues I see is that the format on these structures are different data types. It would be nice to be able to create the input layout based off entirely from the reflection information. If this is not possible would I need to data drive the layout like I was trying to do in my first post?
  12. I guess this also raises the question of whether or not to even use the effect framework. Are there any large benefits of using it rather than not?
  13. So if I want to use shader reflection with the effect framework then I'll have to compile the shader twice? Once as a "VS" so I can pass the compiled shader to d3dreflect and another time as "fx_5_0" to create the effect?
  14. I get E_Fail as hr from D3DReflect. My compiled shader is not null and all the others functions previous to reflect work fine using my compiled shader.
  15. Ah, that would probably be because I didn't know about that xD This seems like it could potentially be what I'm looking for. I'm trying to get it to work though and D3DReflect fails every time I try to create the shader reflection. Any ideas? HRESULT hr = D3DX11CompileFromFile( fileName.c_str(), NULL, NULL, NULL, "fx_5_0", dwShaderFlags, 0, NULL, &effectBlob, &errorsBlob, NULL); if( FAILED( hr ) || effectBlob == NULL) { if( errorsBlob ) // compilation error, print it so we can fix it { LPVOID pCompileErrors = errorsBlob->GetBufferPointer(); MessageBox( NULL, (const char*)pCompileErrors, "Error", MB_OK ); int x = 5; } else // file doesn't exist at said path { MessageBox( NULL, "The FX file cannot be located. Please run this executable from the directory that contains the FX file.", "Error", MB_OK ); } return; } if( errorsBlob ) errorsBlob->Release(); // Create D3DX11 effect from compiled binary memory block ID3DX11Effect *effect; hr = D3DX11CreateEffectFromMemory(effectBlob->GetBufferPointer(), effectBlob->GetBufferSize(), 0, GRAPHICS->GetDevice(), &effect); ID3D11ShaderReflection* pReflector = NULL; hr = D3DReflect( effectBlob->GetBufferPointer(), effectBlob->GetBufferSize(), IID_ID3D11ShaderReflection, (void**) &pReflector); if ( FAILED( hr ) ) { MessageBox( NULL, "Failed to create the reflection interface", "Error", MB_OK); return; } D3D11_SHADER_DESC desc; pReflector->GetDesc( &desc );