mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-26 21:47:06 +02:00
Revert "[spirv] mark sampled image descriptor indices non-uniform (#3900)"
This commit is contained in:
parent
685d9d0bf9
commit
f7745a8e2d
4 changed files with 5 additions and 57 deletions
|
|
@ -14,38 +14,6 @@
|
||||||
|
|
||||||
namespace Shader::Backend::SPIRV {
|
namespace Shader::Backend::SPIRV {
|
||||||
namespace {
|
namespace {
|
||||||
class DescriptorIndex {
|
|
||||||
public:
|
|
||||||
explicit DescriptorIndex(EmitContext& ctx, const IR::Value& index)
|
|
||||||
: id{index.IsImmediate() ? ctx.Const(index.U32()) : ctx.Def(index)},
|
|
||||||
is_non_uniform{ctx.profile.support_sampled_image_array_nonuniform_indexing &&
|
|
||||||
!index.IsImmediate()} {
|
|
||||||
if (!is_non_uniform) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (ctx.profile.supported_spirv < 0x00010400) {
|
|
||||||
ctx.AddExtension("SPV_EXT_descriptor_indexing");
|
|
||||||
}
|
|
||||||
ctx.AddCapability(spv::Capability::ShaderNonUniform);
|
|
||||||
ctx.AddCapability(spv::Capability::SampledImageArrayNonUniformIndexing);
|
|
||||||
Decorate(ctx, id);
|
|
||||||
}
|
|
||||||
|
|
||||||
Id Value() const {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Decorate(EmitContext& ctx, Id object) const {
|
|
||||||
if (is_non_uniform) {
|
|
||||||
ctx.Decorate(object, spv::Decoration::NonUniform);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
Id id;
|
|
||||||
bool is_non_uniform;
|
|
||||||
};
|
|
||||||
|
|
||||||
class ImageOperands {
|
class ImageOperands {
|
||||||
public:
|
public:
|
||||||
[[maybe_unused]] static constexpr bool ImageSampleOffsetAllowed = false;
|
[[maybe_unused]] static constexpr bool ImageSampleOffsetAllowed = false;
|
||||||
|
|
@ -221,12 +189,8 @@ private:
|
||||||
Id Texture(EmitContext& ctx, IR::TextureInstInfo info, [[maybe_unused]] const IR::Value& index) {
|
Id Texture(EmitContext& ctx, IR::TextureInstInfo info, [[maybe_unused]] const IR::Value& index) {
|
||||||
const TextureDefinition& def{ctx.textures.at(info.descriptor_index)};
|
const TextureDefinition& def{ctx.textures.at(info.descriptor_index)};
|
||||||
if (def.count > 1) {
|
if (def.count > 1) {
|
||||||
const DescriptorIndex idx{ctx, index};
|
const Id pointer{ctx.OpAccessChain(def.pointer_type, def.id, ctx.Def(index))};
|
||||||
const Id pointer{ctx.OpAccessChain(def.pointer_type, def.id, idx.Value())};
|
return ctx.OpLoad(def.sampled_type, pointer);
|
||||||
idx.Decorate(ctx, pointer);
|
|
||||||
const Id object{ctx.OpLoad(def.sampled_type, pointer)};
|
|
||||||
idx.Decorate(ctx, object);
|
|
||||||
return object;
|
|
||||||
} else {
|
} else {
|
||||||
return ctx.OpLoad(def.sampled_type, def.id);
|
return ctx.OpLoad(def.sampled_type, def.id);
|
||||||
}
|
}
|
||||||
|
|
@ -244,14 +208,9 @@ Id TextureImage(EmitContext& ctx, IR::TextureInstInfo info, const IR::Value& ind
|
||||||
} else {
|
} else {
|
||||||
const TextureDefinition& def{ctx.textures.at(info.descriptor_index)};
|
const TextureDefinition& def{ctx.textures.at(info.descriptor_index)};
|
||||||
if (def.count > 1) {
|
if (def.count > 1) {
|
||||||
const DescriptorIndex idx{ctx, index};
|
const Id idx{index.IsImmediate() ? ctx.Const(index.U32()) : ctx.Def(index)};
|
||||||
const Id ptr{ctx.OpAccessChain(def.pointer_type, def.id, idx.Value())};
|
const Id ptr{ctx.OpAccessChain(def.pointer_type, def.id, idx)};
|
||||||
idx.Decorate(ctx, ptr);
|
return ctx.OpImage(def.image_type, ctx.OpLoad(def.sampled_type, ptr));
|
||||||
const Id object{ctx.OpLoad(def.sampled_type, ptr)};
|
|
||||||
idx.Decorate(ctx, object);
|
|
||||||
const Id image{ctx.OpImage(def.image_type, object)};
|
|
||||||
idx.Decorate(ctx, image);
|
|
||||||
return image;
|
|
||||||
}
|
}
|
||||||
return ctx.OpImage(def.image_type, ctx.OpLoad(def.sampled_type, def.id));
|
return ctx.OpImage(def.image_type, ctx.OpLoad(def.sampled_type, def.id));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
|
@ -48,7 +45,6 @@ struct Profile {
|
||||||
bool support_scaled_attributes{};
|
bool support_scaled_attributes{};
|
||||||
bool support_multi_viewport{};
|
bool support_multi_viewport{};
|
||||||
bool support_geometry_streams{};
|
bool support_geometry_streams{};
|
||||||
bool support_sampled_image_array_nonuniform_indexing{};
|
|
||||||
|
|
||||||
bool warp_size_potentially_larger_than_guest{};
|
bool warp_size_potentially_larger_than_guest{};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -416,8 +416,6 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_,
|
||||||
.support_scaled_attributes = !device.MustEmulateScaledFormats(),
|
.support_scaled_attributes = !device.MustEmulateScaledFormats(),
|
||||||
.support_multi_viewport = device.SupportsMultiViewport(),
|
.support_multi_viewport = device.SupportsMultiViewport(),
|
||||||
.support_geometry_streams = device.AreTransformFeedbackGeometryStreamsSupported(),
|
.support_geometry_streams = device.AreTransformFeedbackGeometryStreamsSupported(),
|
||||||
.support_sampled_image_array_nonuniform_indexing =
|
|
||||||
device.IsSampledImageArrayNonUniformIndexingSupported(),
|
|
||||||
|
|
||||||
.warp_size_potentially_larger_than_guest = device.IsWarpSizePotentiallyBiggerThanGuest(),
|
.warp_size_potentially_larger_than_guest = device.IsWarpSizePotentiallyBiggerThanGuest(),
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ VK_DEFINE_HANDLE(VmaAllocator)
|
||||||
FEATURE(KHR, VariablePointer, VARIABLE_POINTERS, variable_pointer)
|
FEATURE(KHR, VariablePointer, VARIABLE_POINTERS, variable_pointer)
|
||||||
|
|
||||||
#define FOR_EACH_VK_FEATURE_1_2(FEATURE) \
|
#define FOR_EACH_VK_FEATURE_1_2(FEATURE) \
|
||||||
FEATURE(EXT, DescriptorIndexing, DESCRIPTOR_INDEXING, descriptor_indexing) \
|
|
||||||
FEATURE(EXT, HostQueryReset, HOST_QUERY_RESET, host_query_reset) \
|
FEATURE(EXT, HostQueryReset, HOST_QUERY_RESET, host_query_reset) \
|
||||||
FEATURE(KHR, 8BitStorage, 8BIT_STORAGE, bit8_storage) \
|
FEATURE(KHR, 8BitStorage, 8BIT_STORAGE, bit8_storage) \
|
||||||
FEATURE(KHR, TimelineSemaphore, TIMELINE_SEMAPHORE, timeline_semaphore)
|
FEATURE(KHR, TimelineSemaphore, TIMELINE_SEMAPHORE, timeline_semaphore)
|
||||||
|
|
@ -361,10 +360,6 @@ public:
|
||||||
return GetDriverID() != VK_DRIVER_ID_QUALCOMM_PROPRIETARY;
|
return GetDriverID() != VK_DRIVER_ID_QUALCOMM_PROPRIETARY;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsSampledImageArrayNonUniformIndexingSupported() const {
|
|
||||||
return features.descriptor_indexing.shaderSampledImageArrayNonUniformIndexing;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns true if the device supports float64 natively.
|
/// Returns true if the device supports float64 natively.
|
||||||
bool IsFloat64Supported() const {
|
bool IsFloat64Supported() const {
|
||||||
return features.features.shaderFloat64;
|
return features.features.shaderFloat64;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue