mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-19 18:36:53 +02:00
shader: remove artificial sampled image and sampler pair limit
This commit is contained in:
@@ -4929,6 +4929,38 @@ void TestImagesSamplersAndAliases() {
|
||||
"buffer/image descriptor alias was not linked");
|
||||
}
|
||||
|
||||
void TestIndependentImageSamplerPairs() {
|
||||
Fixture fixture(ShaderType::Pixel);
|
||||
const auto address = fixture.ImageAddress();
|
||||
MemoryInfo memory;
|
||||
memory.kind = ResourceKind::Image;
|
||||
memory.image_dimension = Decoder::ImageDimension::Dim2D;
|
||||
for (uint32_t use = 0; use < 144; ++use) {
|
||||
const auto pair = use % 72;
|
||||
const auto pc = use * 4;
|
||||
const auto image = fixture.Image(
|
||||
{Value(pair / 8), Value(0u), Value(0u), Value(0u), Value(0u),
|
||||
Value(0u), Value(0u), Value(0u)}, pc);
|
||||
const auto sampler = fixture.Sampler(
|
||||
{Value(pair % 8), Value(0u), Value(0u), Value(0u)}, pc);
|
||||
fixture.Emit(ValueOpcode::ImageSampleRaw,
|
||||
{image, sampler, address, Value(true)},
|
||||
fixture.AddMemory(memory, pc));
|
||||
}
|
||||
fixture.PlanAndTrack();
|
||||
|
||||
Check(fixture.program.info.images.size() == 9 &&
|
||||
fixture.program.info.samplers.size() == 8 &&
|
||||
fixture.program.info.sampled_pairs.size() == 72,
|
||||
"distinct image/sampler combinations were limited or duplicated");
|
||||
for (uint32_t index = 0; index < 72; ++index) {
|
||||
const auto &pair = fixture.program.info.sampled_pairs[index];
|
||||
Check(pair.image == index / 8 && pair.sampler == index % 8 &&
|
||||
pair.first_use_pc == index * 4,
|
||||
"sampled pair lost its independent resources or first use");
|
||||
}
|
||||
}
|
||||
|
||||
void TestSampleAdjustSamplerScratch() {
|
||||
Fixture fixture(ShaderType::Pixel);
|
||||
const auto active = fixture.Emit(
|
||||
@@ -8255,6 +8287,7 @@ int main() {
|
||||
Run("scalar/vector alias", TestScalarAndVectorBufferAlias);
|
||||
Run("runtime unsigned min", TestRuntimeUnsignedMinDescriptor);
|
||||
Run("images and samplers", TestImagesSamplersAndAliases);
|
||||
Run("independent image/sampler pairs", TestIndependentImageSamplerPairs);
|
||||
Run("SampleAdjust sampler scratch", TestSampleAdjustSamplerScratch);
|
||||
Run("FMASK load specialization", TestFmaskLoadSpecialization);
|
||||
Run("gather LOD sampler validation", TestGatherLodSamplerValidation);
|
||||
|
||||
Reference in New Issue
Block a user