• Breaking News

    Wrong HLSL buffer width It's more of a discussion question than actual problem with code, because I managed to fix it. I had VS shader with 2 constant buffers: cbuffer MatrixBuffer : register(cb0) { matrix worldMatrix; matrix viewMatrix; matrix projectionMatrix; }; cbuffer ScreenSizeBuffer : register(cb1) { float screenSize; float g_padding1; float g_padding2; float g_padding3; }; Nsight says that MatrixBuffer is 192 width (correct) and ScreenSizeBuffer is 192 width (wrong, should be 16). screenSize variable is always equal to 1. Removing MatrixBuffer fixes a problem, ScreenSizeBuffer is back 16 width and screenSize value is passed correctly. Why is that? Why previous buffer width is passed to next buffer? https://ift.tt/eA8V8J

    It's more of a discussion question than actual problem with code, because I managed to fix it. I had VS shader with 2 constant buffers: cbuffer MatrixBuffer : register(cb0) { matrix worldMatrix; matrix viewMatrix; matrix projectionMatrix; }; cbuffer ScreenSizeBuffer : register(cb1) { float screenSize; float g_padding1; float g_padding2; float g_padding3; }; Nsight says that MatrixBuffer is 192 width (correct) and ScreenSizeBuffer is 192 width (wrong, should be 16). screenSize variable is always equal to 1. Removing MatrixBuffer fixes a problem, ScreenSizeBuffer is back 16 width and screenSize value is passed correctly. Why is that? Why previous buffer width is passed to next buffer?

    from GameDev.net https://ift.tt/2YXb2fU

    ليست هناك تعليقات

    Post Top Ad

    ad728

    Post Bottom Ad

    ad728