Skip to content

Commit

Permalink
Changes for Vulkan bindless
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravbug committed Jul 9, 2024
1 parent e3b6601 commit 8a97969
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions 09-BindlessTexturing/bindlesstexturing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ struct BindlessTexturing : public ExampleFramework {
.stageFlags = RGL::BindingVisibility::Vertex,
},
{
.binding = 2,
.binding = 0,
.count = 512,
.isBindless = true,
.type = RGL::BindingType::SampledImage,
.stageFlags = RGL::BindingVisibility::Fragment,
},
Expand Down Expand Up @@ -197,9 +198,9 @@ struct BindlessTexturing : public ExampleFramework {
loadTx("tx39.png",tx3);

uint32_t indices[] = {
tx1->GetDefaultView().texture.dx.srvIDX,
tx2->GetDefaultView().texture.dx.srvIDX,
tx3->GetDefaultView().texture.dx.srvIDX
tx1->GetDefaultView().GetReadonlyBindlessTextureHandle(),
tx2->GetDefaultView().GetReadonlyBindlessTextureHandle(),
tx3->GetDefaultView().GetReadonlyBindlessTextureHandle()
};

instanceDataBuffer = device->CreateBuffer({
Expand Down Expand Up @@ -290,7 +291,7 @@ struct BindlessTexturing : public ExampleFramework {
}

const char* SampleName() final {
return "Mipmap";
return "Bindless Texturing";
}

void onresize(int width, int height) final {
Expand Down
2 changes: 1 addition & 1 deletion 09-BindlessTexturing/btex.frag
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#extension GL_EXT_nonuniform_qualifier : enable

layout(binding = 0) uniform sampler g_sampler;
layout(binding = 2) uniform texture2D textures[];
layout(set = 1, binding = 0) uniform texture2D textures[];

layout(location = 0) in vec2 uv;
layout(location = 1) in flat uint instance;
Expand Down

0 comments on commit 8a97969

Please sign in to comment.