Replies: 3 comments 8 replies
-
I'm still getting the _com_error, even after removing most of the shadowmap related code, so I'm assuming I've moved something around in a way that D3D or Diligent doesn't like. I always have a really difficult time figuring out the cause of these. If there's any advice on how to go about narrowing down what might be going wrong here, please let me know what I can try. I'd almost guarantee it is in some way related to dynamic buffers or the pipeline resource signature, or both. Every time I run into this _com_error issue, it always happens at Present(), and is always tied to those elements. I can't seem to find any information that points to an actual problem. I've also tried every which way to |
Beta Was this translation helpful? Give feedback.
-
After a long fight with my engine, I've at least figured out that the _com_error is unrelated to the shadowmap changes. And it's actually not related to the dynamic buffers or pipeline resource signature. It is related to the render targets. I haven't figured out exactly what is causing the exception, but I think it may be because I tried to store the back buffer render target view into a variable and set it as the target across several frames. After narrowing the problem down to this, I realize that's probably because of double buffering, and the fact that the actual render target is being alternated between two separate textures. But that's just a guess at this point. Anyway, I'm still curious about the texture shader resource vs render target resource problem. When shaders need to share a pipeline resource, is there a way to exclude a certain resource from certain shader executions? How can I allow these world objects to draw onto the shadowmap without activating this warning about it being in the wrong state? I'm assuming its not just a hollow warning? What happens when I run shaders with a shared pipeline resource that has a resource in the wrong state? Will it be fine as long as they don't touch that resource? |
Beta Was this translation helpful? Give feedback.
-
For some reason, I get the warning on the very first frame of rendering shadows, reporting that the shadowmap texture is not in a shader resource state, even though that stage is actually using it as a render target. The warning will never appear again now. However, if I call I'll be honest. Understanding when I need to call But in any case, I don't think there is a bug, but without fully understanding what's happening, I'm not sure. My guess is that I'm committing some random thing that happens on the very first frame. It's even possible something is not rendering correctly on that frame, because it would be difficult to notice. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to implement shadow mapping with a shared pipeline resource setup. Basically, every "world based" entity in my game engine uses the same pipeline resource signature. To sample from the shadowmap, I included the shadowmap texture as one of the resources in this pipeline (as
Diligent::SHADER_RESOURCE_TYPE_TEXTURE_SRV
).I'm switching my shadowmap back and forth between a render target and shader resource state to get this to work. Something like this..
However, I'm running into a problem at step #3. When I try to execute these pipeline states, Diligent complains about the shadowmap not being in a shader resource state. This is because the shadowmap is registered as a global shader resource in the shared pipeline signature (I believe). The shadowmap vertex shader does not make any use of this resource, but it just being in the pipeline signature is throwing warnings and possibly exceptions. I'm getting another
_com_error
since implementing this setup, after about 3 frames of getting resource state warnings, I get the_com_error
exception and a crash. And wow are these_com_error
s hard to tack down. Last time I had one, it was being triggered by the inclusion of dynamic buffers in the shared pipeline resource signature that were not being used, so I'm assuming the pipeline signature has something to do with the_com_error
.Any advice on how to resolve this issue? Will I be forced to create a second pipeline resource signature for shadowmap rendering? It would be a shame, because both of them will be identical, apart from the shadowmap texture.
Appreciate any ideas!
Beta Was this translation helpful? Give feedback.
All reactions