Hash :
c51c59c7
Author :
Date :
2021-06-15T13:43:50
Test for missing index dirty bit bug
Bug fixed in
https://chromium-review.googlesource.com/c/angle/angle/+/2961690
triggers only in the following situation:
- Context 1: draw indexed -> clears index dirty bit
- Context 1: change state in such a way that closing the render pass is
deferred to dirty bit handling (for example, change FBO)
- Context 1: issue a non-indexed draw call. This closes the render pass
and starts a new one -> bug was that the index dirty bit
was not set
- Context 2: flush the command buffer, which submits the previous render
pass of context 1 (which contained vkCmdBindIndexBuffer).
The primary command buffer is now reset.
- Context 1: issue an indexed draw call. Since the index dirty bit was
not set, this was missing the vkCmdBindIndexBuffer call.
This change implements a regression test based on the above scenario.
Bug: chromium:1183068
Bug: chromium:1190493
Change-Id: I729bd48cd6df2621ca763f6231023a52ac08b0fb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2963836
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
//
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#ifndef TEST_EXPECTATIONS_GPU_TEST_EXPECTATIONS_PARSER_H_
#define TEST_EXPECTATIONS_GPU_TEST_EXPECTATIONS_PARSER_H_
#include <stddef.h>
#include <stdint.h>
#include <string>
#include <vector>
#include "GPUTestConfig.h"
namespace angle
{
struct GPUTestConfig;
class GPUTestExpectationsParser
{
public:
enum GPUTestExpectation
{
kGpuTestPass = 1 << 0,
kGpuTestFail = 1 << 1,
kGpuTestFlaky = 1 << 2,
kGpuTestTimeout = 1 << 3,
kGpuTestSkip = 1 << 4,
};
GPUTestExpectationsParser();
~GPUTestExpectationsParser();
// Parse the text expectations, and if no error is encountered,
// save all the entries. Otherwise, generate error messages.
// Return true if parsing succeeds.
bool loadTestExpectations(const GPUTestConfig &config, const std::string &data);
bool loadTestExpectationsFromFile(const GPUTestConfig &config, const std::string &path);
bool loadAllTestExpectations(const std::string &data);
bool loadAllTestExpectationsFromFile(const std::string &path);
// Query error messages from the last LoadTestExpectations() call.
const std::vector<std::string> &getErrorMessages() const;
// Query error messages from any expectations that weren't used before being queried.
std::vector<std::string> getUnusedExpectationsMessages() const;
// Get the test expectation of a given test on a given bot.
int32_t getTestExpectation(const std::string &testName);
int32_t getTestExpectationWithConfig(const GPUTestConfig &config, const std::string &testName);
void setTestExpectationsAllowMask(uint32_t mask) { mExpectationsAllowMask = mask; }
private:
struct GPUTestExpectationEntry
{
GPUTestExpectationEntry();
std::string testName;
int32_t testExpectation;
size_t lineNumber;
bool used;
GPUTestConfig::ConditionArray conditions;
};
// Parse a line of text. If we have a valid entry, save it; otherwise,
// generate error messages.
bool parseLine(const GPUTestConfig *config, const std::string &lineData, size_t lineNumber);
// Check a the condition assigned to a particular token.
bool checkTokenCondition(const GPUTestConfig &config,
bool &err,
int32_t token,
size_t lineNumber);
// Check if two entries' config overlap with each other. May generate an
// error message.
bool detectConflictsBetweenEntries();
// Query a list of any expectations that were's used before being queried.
std::vector<GPUTestExpectationEntry> getUnusedExpectations() const;
// Save an error message, which can be queried later.
void pushErrorMessage(const std::string &message, size_t lineNumber);
void pushErrorMessage(const std::string &message,
size_t entry1LineNumber,
size_t entry2LineNumber);
// Config is optional.
bool loadTestExpectationsFromFileImpl(const GPUTestConfig *config, const std::string &path);
bool loadTestExpectationsImpl(const GPUTestConfig *config, const std::string &data);
int32_t getTestExpectationImpl(const GPUTestConfig *config, const std::string &testName);
std::vector<GPUTestExpectationEntry> mEntries;
std::vector<std::string> mErrorMessages;
uint32_t mExpectationsAllowMask;
};
const char *GetConditionName(uint32_t condition);
} // namespace angle
#endif // TEST_EXPECTATIONS_GPU_TEST_EXPECTATIONS_PARSER_H_