Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

123 Neutral

About VytsL

  • Rank

Personal Information

  • Interests
  1. That's what I suspected too given close DX10/11 version's relationship in late OS versions. However, any suggestions how could we try detecting it?
  2. Actually, a related question popped up and I'd like to understand what is going on: I created a sample app that creates ID3D11Texture2D. Far away, there is a code that tries to see if we're running in DX10 or DX11 mode. We thought that QueryInterface for ID3D10Texture2d should fail, but it still succeeds? Why?
  3. Is it important to reset my own context to empty every time I reenter my code? I am currently creating context once, and reusing it. All works like a breeze guys! Huge thanks! Ah, while we're at it... I have a situation where there's texture array in Oculus chain. Can I use subresource of that array as a Render Target View? I have not found a way, so I render to other texture and then CopySubresourceRegion into that array, but curious if I can avoid that?
  4. Thank you, this sounds like what I need, but I thought it just affects device capabilities, meaning what's allowed what's not (ie what SM is supported etc)? Will that undo set viewports, render targets etc? (Will try of course )
  5. I was able to make it work, thanks for your help so far guys I am trying not to impact caller rendering, so I am reversing various Set calls with Get old state and Set at function exit. For example: // Restore g_pImmediateContext->RSSetViewports(1, &oldViewport); // Restore old RT and DS buffer views g_pImmediateContext->OMSetRenderTargets(1, oldRTViews, oldDSView); g_pImmediateContext->IASetInputLayout(oldInputLayout); Is there a better way to preserve overall device state? Thanks!
  6. So, I have SRV, RTV. I've not creted stencil yet, not sure I need it. I've two questions: * how do I trigger the rendering? I've no geometry to draw, I just need to render texture->texture _once_. Just clear everything and do the Present? * maybe I am missing something, but I can't see how SRV is connected RTV via ID3D11DeviceContext::OMSetRenderTargets, it takes ID3D11RenderTargetView and stencil, which I am currently setting to nullptr. My whole rendering is a bit unusual, I am not rendering a 3d scene with objects in it - I am mapping stuff between Open VR, and Oculus Runtime. This whole dance is necessary now, because Oculus Runtime does not support Bottom Left originating cubemap textures, but that's what I am getting from Open VR caller. Edit: I found something, looking
  7. Thank you, I tried tex[0], tex[1] and tex.u and tex.v, and also used C++ curlies {}, but not x/y Texture flipped succesfully, now I just need to set the chain up as you describe. Quick question: ms sample uses VS to pass input to PS. Can PS be used without VS?
  8. I am making a good progress but I'd like to ask for a hint here. I am modifying MS sample to come up with texture flip PS, and I am stuck on the following: struct PS_INPUT { float4 Pos : SV_POSITION; float2 Tex : TEXCOORD0; }; float4 PS( PS_INPUT input) : SV_Target { return txDiffuse.Sample(samLinear, input.Tex); I thought I will be able to create a copy of input.Tex and flip the height component to 1 - v. But I can't seem to figure syntax out. Also, I understood how to set shader up, set parameters etc and draw the basic cube with texture, but how do I render texture to texture? Some pseudocode would be appreciated.
  9. Yeah, that's graphics But I am so excited, did graphics years ago, so fun to get back into it, even briefly. I still hope that I will find some flag or something that will allow specifying texture orientation in Oculus cubemap... Also, I need to make sure my order of textures is right, I just figured out how to color them correctly in RGBA so that I can identify which is which, but still didn't get to test in HMD. To add more fun, just figured out - Oculus explodes if I cube width != height, that'll be interesting to deal with ... But suppose if I can't find a way, could you drop me sample of fastest way to rotate 2D texture? Thanks in advance, you rock. Edit: I wonder if D3D11_BOX can be used to flip texture? My textures look upside down and flipped atm.
  10. Thank you guys for all the responses. CopySubresourceRegion is what I needed. I was aware that CPU cannot access Texture's texels directly, but my hope was that maybe the API I used to call would do things needed internally. I knew I could copy texels out using map, but trying to avoid that was the whole point of this post, still thanks for clarifying. Now I need to figure out how to control orientation of copied textures, because they seem to be rotated by -180. Will look into enabling debug layer thingie Edit: looks like I can't use debug layer because I don't create device, it comes from somewhere else. But maybe it can be forced using swap context, will look into that.
  11. Yes, I am using CopyResource in other places. However, in this case texture pointed by tex variable was acquired by specifying ArraySize of 6 when created by Oculus' swap chain. I guess I'll keep digging to figure out how to get one of the 6 out of Oculus SDK.
  12. Hi, I am trying to initialize SkyBox/Cubemap in Oculus app. Oculus's sample shows how to initialize texture swap chain texture. The difference in my use case is that I do not initialize from .dds bytes read from disk, I already have ID3D11Texture2D. I see samples online that allow getting Texture bytes, but that will involve CPU copying of memory, I wonder if it can be avoided. Here's roughly what I am doing: int numFaces = 6; for (int i = 0; i < numFaces; ++i) { ID3D11Texture2D *faceSrc = textures->handle; ++textures; context->UpdateSubresource(tex, i, nullptr, (const void*)faceSrc, srcDesc.Width * 4, srcDesc.Width * srcDesc.Height * 4); } However, that crashes with AV in Nvidia driver. Any suggestions? Thanks!
  13. Just wanted to tell that this approach worked, partially. I was able to fix errors coming out of Oculus runtime by swapping context. However, right now I am completely stuck, as I get no errors, no warnings, but HMD stays dark. Still, this is a progress, thanks @SoldierOfLight. SOLVED: turns out I need to wrap a bit more of OVR calls in a swap, works now!
  14. Thanks a lot, this looks very promising to me. Will attempt this approach tomorrow. My main focus in Win10, and I assume what you describe regarding QI on 11'th version of interface should work out of the box on Win10, because DX10 are objects are just interfaces on DX11 implementation underneath, right? Could you please clarify SwapDeviceContextState. Does this API allows to convert D3D10Device to D3D11DeviceContext? (I went through article but that wasn't clear to me yet). I am getting D3D10Device out of texture atm, and what I think I need is DX11 versions of both device and Context. Foo::Bar(ID3D10Texture2D *initial) { initial->GetDevice(&device); PS: Actually, if DX10 objects are implemented in terms of DX11, then wouldn't QI for 11th version on D3D10Device yield correct D3D11Device?
  15. Hi, I am doing some hobby project where I am trying to make a game work with Oculus. I do not have game's source code, but I believe it supplies Open VR API with DX10 texture (game itself is DX9, I believe internally they convert DX9 texture to DX10 for submission to Steam VR/Open VR). I originally tried to do everything in DX10 on my side, but I don't think Oculus supports DX10. So, now I'd like to try converting DX10 texture to DX11 and try using that in Oculus' Texture Swap Chain. I've couple of questions: * could someone suggest a way to convert DX10 texture to DX11? I am going to try using techniques described here https://docs.microsof but I am not a DX guru, in fact I am not a graphics programmer and last time I touched D3D was 15 years ago , and if someone could provide me with simpler approach, that'd be very helpful Or, at lease, could someone clarify if article I referenced is indeeded what I need to do? * given texture pointer, how can I figure out if it is indeed DX10 texture? I was able to get Description, and it seems to be filled reasonably: ID3D10Texture2D *src = (ID3D10Texture2D*)texture->handle; D3D10_TEXTURE2D_DESC srcDesc; src->GetDesc(&srcDesc); but how could i for example, tell if it is DX10 or DX10.1 texture? * looks like I will have to instantiate DX11 device myself. Is there any harm in having multiple D3D11 device instantiated (per swap chain) of do I need to share single device? Thanks for your help.
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!