Skip to content

Commit

Permalink
Finally fix the AMD bindless texture issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dpjudas committed Feb 12, 2025
1 parent c436b91 commit 078ad8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
8 changes: 4 additions & 4 deletions SurrealEngine/RenderDevice/Vulkan/FileResource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ std::string FileResource::readAllText(const std::string& filename)
}
#if defined(BINDLESS_TEXTURES)
vec4 textureTex(vec2 uv) { return texture(textures[textureBinds.x], uv); }
vec4 textureMacro(vec2 uv) { return texture(textures[textureBinds.y], uv); }
vec4 textureDetail(vec2 uv) { return texture(textures[textureBinds.z], uv); }
vec4 textureLightmap(vec2 uv) { return texture(textures[textureBinds.w], uv); }
vec4 textureTex(vec2 uv) { return texture(textures[nonuniformEXT(textureBinds.x)], uv); }
vec4 textureMacro(vec2 uv) { return texture(textures[nonuniformEXT(textureBinds.y)], uv); }
vec4 textureDetail(vec2 uv) { return texture(textures[nonuniformEXT(textureBinds.z)], uv); }
vec4 textureLightmap(vec2 uv) { return texture(textures[nonuniformEXT(textureBinds.w)], uv); }
#else
vec4 textureTex(vec2 uv) { return texture(tex, uv); }
vec4 textureMacro(vec2 uv) { return texture(texMacro, uv); }
Expand Down
5 changes: 0 additions & 5 deletions SurrealEngine/RenderDevice/Vulkan/VulkanRenderDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ VulkanRenderDevice::VulkanRenderDevice(Widget* InViewport, std::shared_ptr<Vulka
Device->EnabledFeatures.DescriptorIndexing.runtimeDescriptorArray &&
Device->EnabledFeatures.DescriptorIndexing.shaderSampledImageArrayNonUniformIndexing;

// AMD's driver produces artifacts when using bindless textures.
// This is not ideal, but can't get AMD to fix this as I'm not AAA and thus can't just call them...
if ((Device->PhysicalDevice.Properties.Properties.vendorID & 0xffff) == 0x1002)
SupportsBindless = false;

Commands.reset(new CommandBufferManager(this));
Samplers.reset(new SamplerManager(this));
Textures.reset(new TextureManager(this));
Expand Down

0 comments on commit 078ad8f

Please sign in to comment.