-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented bindless textures, closes #15
- Loading branch information
Showing
24 changed files
with
156 additions
and
434 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Copyright (c) 2019-2021 Andrew Depke | ||
|
||
Texture2D textures[] : register(t0, space0); |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,28 @@ | ||
// Copyright (c) 2019-2021 Andrew Depke | ||
|
||
#include "UserInterface_RS.hlsli" | ||
#include "Base.hlsli" | ||
|
||
struct PS_INPUT | ||
SamplerState defaultSampler : register(s0); | ||
|
||
struct BindlessTexture | ||
{ | ||
uint index; | ||
}; | ||
|
||
ConstantBuffer<BindlessTexture> bindlessTexture : register(b0); | ||
|
||
struct Input | ||
{ | ||
float4 position : SV_POSITION; | ||
float4 color : COLOR0; | ||
float2 uv : TEXCOORD0; | ||
}; | ||
|
||
SamplerState sampler0 : register(s0); | ||
Texture2D texture0 : register(t1); | ||
|
||
[RootSignature(RS)] | ||
float4 main(PS_INPUT input) : SV_Target | ||
float4 main(Input input) : SV_Target | ||
{ | ||
float4 output = input.color * texture0.Sample(sampler0, input.uv); | ||
Texture2D textureTarget = textures[bindlessTexture.index]; | ||
float4 output = input.color * textureTarget.Sample(defaultSampler, input.uv); | ||
return output; | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.