Last active
May 8, 2016 00:51
-
-
Save yorung/67da2b9d96180f5bdd17dcebabcc9cbe to your computer and use it in GitHub Desktop.
DirectX 12 wrapper classes to simplify.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CSampler : public D3D12_STATIC_SAMPLER_DESC | |
| { | |
| public: | |
| CSampler(int shaderRegister, D3D12_FILTER samplerFilter, D3D12_TEXTURE_ADDRESS_MODE wrap) | |
| { | |
| Filter = samplerFilter; | |
| AddressU = wrap; | |
| AddressV = wrap; | |
| AddressW = D3D12_TEXTURE_ADDRESS_MODE_CLAMP; | |
| MipLODBias = 0; | |
| MaxAnisotropy = 1; | |
| ComparisonFunc = D3D12_COMPARISON_FUNC_NEVER; | |
| BorderColor = D3D12_STATIC_BORDER_COLOR_TRANSPARENT_BLACK; | |
| MinLOD = 0; | |
| MaxLOD = D3D12_FLOAT32_MAX; | |
| ShaderRegister = shaderRegister; | |
| RegisterSpace = 0; | |
| ShaderVisibility = D3D12_SHADER_VISIBILITY_PIXEL; | |
| } | |
| }; | |
| class CDescriptorCBV : public D3D12_DESCRIPTOR_RANGE { | |
| public: | |
| CDescriptorCBV(int shaderRegister) { | |
| RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_CBV; | |
| NumDescriptors = 1; | |
| BaseShaderRegister = shaderRegister; | |
| RegisterSpace = 0; | |
| OffsetInDescriptorsFromTableStart = D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND; | |
| } | |
| }; | |
| class CDescriptorSRV : public D3D12_DESCRIPTOR_RANGE { | |
| public: | |
| CDescriptorSRV(int shaderRegister) { | |
| RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_SRV; | |
| NumDescriptors = 1; | |
| BaseShaderRegister = shaderRegister; | |
| RegisterSpace = 0; | |
| OffsetInDescriptorsFromTableStart = D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND; | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment