Jump to content
  • Advertisement

xhcao

Member
  • Content count

    8
  • Joined

  • Last visited

Community Reputation

2 Neutral

About xhcao

  • Rank
    Newbie

Personal Information

  • Role
    DevOps
  • Interests
    Programming

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Is Direct3D 11 an api function like glMemoryBarrier in OpenGL? For example, if binds a texture to compute shader, compute shader writes some values to texture, then dispatchCompute, after that, read texture content to CPU side. I know, In OpenGL, we could call glMemoryBarrier before reading to assure that texture all content has been updated by compute shader. How to handle incoherent memory access in Direct3D 11? Thank you.
  2. Does sync be needed to read texture content after access texture image in compute shader? My simple code is as below, glUseProgram(program.get()); glBindImageTexture(0, texture[0], 0, GL_FALSE, 3, GL_READ_ONLY, GL_R32UI); glBindImageTexture(1, texture[1], 0, GL_FALSE, 4, GL_WRITE_ONLY, GL_R32UI); glDispatchCompute(1, 1, 1); // Does sync be needed here? glUseProgram(0); glBindFramebuffer(GL_READ_FRAMEBUFFER, framebuffer); glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, texture[1], 0); glReadPixels(0, 0, kWidth, kHeight, GL_RED_INTEGER, GL_UNSIGNED_INT, outputValues); Compute shader is very simple, imageLoad content from texture[0], and imageStore content to texture[1]. Does need to sync after dispatchCompute?
  3. Before using void glBindImageTexture( GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format), does need to make sure that texture is completeness.
  4. Sorry, I did not understand you clearly. What is the same space? What is the meaning that the registers are shared between descriptors. I need to implement two HLSL RWTexture2D binding to the same resource on D3D11. Is it possible? In my opinion, if separate registers on D3D11, the two RWTexture2D variable must be bound to different resource.
  5. In Direct3D 11, Could I define two RWTexture2D resource variables which share the same register in pixel shader as below, RWTexture2D<float4> tex1 : register(u0); RWTexture2D<float4> tex2 : register(u0); Compile error: error X4500: overlapping register semantics not yet implemented 'u0' It seems that it is illegal to define as above. The reason to define as above is that I want to these two resource variable bind the same texture. I try to create two different unodered access views, and their resources are the same texture. But Two UAVs conflict if they share a subresource (and therefore share the same resource), reference to https://msdn.microsoft.com/en-us/library/windows/desktop/ff476465(v=vs.85).aspx
  6. Thank you. As we all known, unordered access views(UAVs) are available on all shader stages, and the UAVs that are shared across all pipeline stages. For example, a UAV that is bound at slot 0 at the output-merger stage is available at slot 0 to VS/HS/DS/GS/PS. If a RWTexture2D variable are declared the same in vertex shader and pixel shader. Does the compiler ensure to assigned the same slot for the two variables? The vertex shader and pixel shader all declare a variable as below, RWTexture2D<float4> texture; In OpenGL, if two uniform exist in vertex shader and pixel shader respectively, with the same name, they are bound the the same binding value. Does d3d11 is like it?
  7. Thank you for your reply. I have another question, for D3D11, if I declare a RWTexture2D variable without specifying the register in compute shader, for example RWTexture2D<float4> texture; when I call void CSSetUnorderedAccessViews( [in] UINT StartSlot, [in] UINT NumUAVs, [in, optional] ID3D11UnorderedAccessView *const *ppUnorderedAccessViews, [in, optional] const UINT *pUAVInitialCounts ); How I know the “StartSlot” for HLSL texture variable. Does it has a default slot for non-register variable, like zero?
  8. Hi, I am newer of Direct3D 11, and I want to get help from you. In Direct3D samples, we usually define RWTexture2D variables globally, and use it in functions directly. Is it legal to transfer this variable as a parameter of a user-defined function? RWTexture2D<float4> texture : regiters(u0); void setData(RWTexture2D<float4> tex, float2 data) { tex[uint2(0, 0)] = data; } PS_OUTPUT main(PS_INPUT input) { setData(texture, float2(0.0, 0.0)); PS_OUTPUT output; return output; }
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!