• Content count

  • Joined

  • Last visited

Community Reputation

4 Neutral

About mark_braga

  • Rank

Personal Information

  • Interests
  1. I ended up writing my own. Use clang format to format the ugly generated code too Makes my life a lot easier
  2. I am working on a tool to auto-generate some C/C++ code by parsing a file. Is there a tool that provides an interface to write C/C++ code like this Struct* pStruct = generator->beginStruct("Material"); { pStruct->addVariable("Buffer*", "pBuffer"); pStruct->addVariable("Texture*", "pTexture"); } generator->endStruct(pStruct); /* Output file struct Material { Buffer* pBuffer; Texture* pTexture; }; */ Now I know its quite trivial to write a tool like this but I am curious to know whether a tool already exists. Seems just like a tool generating json/xml but for C++. Note: I won't be doing any fancy stuff like templates or inheritance. Just pure C structs. Thank you
  3. Yeah but then you cant put a pretty message saying "Please dont use new"
  4. I want to prohibit the use of new, delete in one of my projects. There are still instances where I need the placement new operator to construct things like containers which need a constructor call. So I cannot just use the old #define new Error trick. I looked at static_assert but that will throw an error irrespective of whether the function is used or not. In addition, I can't use the #pragma deprecated because it only generates a warning and we have warnings in our project which are out of my control. So is there any other way to throw a compiler error when a function is used? I am talking about the global new and delete operators. Thank you
  5. DX12 Split Barrier Question

    Thanks for the info. It clears up a lot of things. But I still don't understand what could be the advantage of the split barrier if we have a shadow-map pass and the shadow-map is used as shader resource in the next pass. DrawShadowMapPass(); ResourceBarrier(BEGIN_ONLY, pTexShadow); ResourceBarrier(END_ONLY, pTexShadow); DrawShadingPass(); Wouldn't the code look like that in the above case?
  6. I am working on optimizing barriers in our engine but for some reason can't wrap my head around split barriers. Lets say for example, I have a shadow pass followed by a deferred pass followed by the shading pass. From what I have read, we can put a begin only split barrier for the shadow map texture after the shadow pass and an end only barrier before the shading pass. Here is how the code will look like in that case. DrawShadowMapPass(); ResourceBarrier(BEGIN_ONLY, pTextureShadowMap, SHADER_READ); DrawDeferredPass(); ResourceBarrier(END_ONLY, pTextureShadowMap, SHADER_READ); // Uses shadow map for shadow calculations DrawShadingPass(); Now if I just put one barrier before the shading pass, here is how the code looks. DrawShadowMapPass(); DrawDeferredPass(); ResourceBarrier(NORMAL, pTextureShadowMap, SHADER_READ); // Uses shadow map for shadow calculations DrawShadingPass(); Whats the difference between the two? Also if I have to use the render target immediately after a pass. For example: Using the albedo, normal textures as shader resource in the shading pass which is right after the deferred pass. Would we benefit from a split barrier in this case? Maybe I am completely missing the point so any info on this would really help. The MSDN doc doesn't really help. Also, I read another topic but it didn't really help either.
  7. Sorry for mixing DX11 and DX12. Also I guess galop1N answered your question
  8. The registers are shared between descriptors of the same type in the same space. You either need to change the space of one of the uavs (only applicable to DX12). If you are on DX11, then you need separate registers.
  9. If I have an array of storage buffers or constant buffers with descriptor type UNIFORM/STORAGE_BUFFER_DYNAMIC how would I specify the dynamic offsets in bind descriptor sets? Offsets: A[0] = 256 A[1] = 1024 A[2] = 4096 A[3] = 8192 Will the dynamic offsets array look like { 256, 1024, ... }? And what will be the dynamicOffsetCount? Will it be 1 or the array size?
  10. Sorry, but what are these rules? Does it mean that I just use root descriptors for constantly changing cbvs and use sets for all other resources?
  11. I have read the max root signature size is 64 DWORDS. It is basically 64 on NVIDIA and 13 on AMD. But I got this info from a person working at AMD. I can't do this for every vendor out there :P. There has to be a better way to query the max root size through the API without the need to contact a person working in the company. So is there a way to find out the actual max root signature size for the active GPU? Thank you
  12. I can do that? That sounds like a good way. I always thought specifying root signature in the shader means you can only use that particular root signature with that shader. If that's not the case then I can just specify a dummy root signature with the static sampler in it. Thanks a lot
  13. I am implementing static samplers / immutable samplers in the framework. All the examples I have seen that use static samplers declare them in the root signature string. But I dont ever describe the root signature in shader code to keep things consistent with Vulkan. So I am wondering if there is another way to declare a sampler as static sampler in shader code? Or do I have to parse the shader myself and use some naming convention like all samplers with prefix "STATIC_" are to be considered static samplers. And then put the description above the sampler in comments. That would be a pain so if there is a way to just declare a static sampler without using the root signature string it would be really helpful. Thank you
  14. DX12 [D3D12] Descriptor Heap Strategies

    My approach to this was every command list gets a portion of the heap so there is no need for any kind of fence synchronization. Works well with Vulkan too where every command list has its own descriptor pool. The user has the option to specify the size of the sub-allocation and some more customizations. This approach guarantees lock free descriptor allocation except for the one time where the command list needs to sub-allocate its "local" descriptor heap from the global one.
  15. Does anyone know what is Vulkan's version of the UAVBarrier in DX12? In my situation, I have two compute shaders. The first one clears the uav and second one writes to the uav. void ComputePass(Cmd* pCmd) { cmdDispatch(pCmd, pClearBufferPipeline); // Barrier to make sure clear buffer shader and fill buffer shader dont execute in parallel cmdUavBarrier(pCmd, pUavBuffer); cmdDispatch(pCmd, pFillBufferPipeline); } My best guess was the VkMemoryBarrier but I am not very familiar with vulkan barriers. So any info on this would really help. Thank you.