Tag Info

New answers tagged


There's three members of a D3D11_MAPPED_SUBRESOURCE: a pointer to the beginning of the data; the number of bytes from the beginning of one row of data to the next row of data; the number of bytes from the beginning of one depth slice of data to the next depth slice of data. As none of these members communicate anything about the actual extents of a row ...


you have to update your subresource (if i'm not mistaken): md3dDeviceContext->UpdateSubresource(mMatrixBuffer, 0, NULL, &worldViewProjM, 0, 0);


Use several constant buffers and group variables together based on how often they change. If your variables are fairly static ( or just huge ) you may be better off converting values into a texture and extracting them in the shader.


Non-array struct members for constant buffers in HLSL are packed on four byte offsets, as many as it can into 16-byte vectors. If a member would straddle a vector boundary, it starts a new vector. You cannot achieve this with just an alignment and pack directive, you need to have explicit padding in your CPU-side structure to emulate the CB layout rules. ...


I believe your DEAOColor crosses the 16 byte alignment boundary. Your first bool is 4 bytes so DEAOColor get's cut in two. Try switching them (and any other variable that doesn't fit within the 16 byte steps).


If I am understanding the question correctly, you just want the delta mouse when you are in relative mode. According to the docs, https://directxtk.codeplex.com/wikipage?title=Mouse&referringTitle=Home#Absolute%20vs.%20Relative%20Mouse%20position When you query the state of the mouse, the x and y coordinates return the delta. Note, because you ...


Out of curiosity (and peace of the mind...) I wondered how DirectX decides which attribute from a struct corresponds to the right variable inside an HLSL cbuffer-register(x) (apart from the order/type they are declared with). Purely through memory layout. You give D3D a pointer to a chunk of memory which you claim to be organized in a certain ...


My assumption based on my experiences with shader reflection in DX11 is that it's mapped by name. If you check out the DX11 shader reflection API you'll see that there is a D3D11_SHADER_VARIABLE_DESC struct that you can rip from the shader. Notice the LPCSTR for the name of the variable. OpenGL also handles variable mapping by name. Of course the best way ...


VSSetConstantBuffers stands for VertexShaderSetConstantBuffers. Hence you also got PSSetConstantBuffers for the pixel shader.


There are additional alignment and layout rules for constant buffers. The float3 probably needs padding on the CPU side to get the right stride. Roughly paraphrased, things need to be on 16-byte boundaries.


The question is what pixel format are you converting your JPG and PNG images to for the DDS, and with what tool? Many of the older tools, including the legacy DirectX SDK texture tool, will default to using a 24bpp format D3DFMT_R8G8B8. The problem with this format is that there is no DXGI format that is 24bpp. The DDSTextureLoader in DirectX Tool Kit is ...


If Paint.net created dds files work for you and converted jpgs do not and you converted in a different software, convert jpgs to dds in Paint.net. You can also use DirectX texture tool provided with the DirectX SDK which I can say for sure works. Also keep in mind if you use DXT compression, your textures must be power of two size. Also try out different ...

Top 50 recent answers are included