General: Remove usages of ARRAY_SIZE where applicable. (#5392)

Same behavior, but without our own boilerplate function.
This commit is contained in:
LC 2020-06-19 10:10:45 -04:00 committed by GitHub
parent f7aaa37bf2
commit 8ce81b19be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 35 additions and 29 deletions

View file

@ -206,7 +206,7 @@ void OpenGLState::Apply() const {
}
// Textures
for (unsigned i = 0; i < ARRAY_SIZE(texture_units); ++i) {
for (u32 i = 0; i < texture_units.size(); ++i) {
if (texture_units[i].texture_2d != cur_state.texture_units[i].texture_2d) {
glActiveTexture(TextureUnits::PicaTexture(i).Enum());
glBindTexture(GL_TEXTURE_2D, texture_units[i].texture_2d);

View file

@ -90,10 +90,11 @@ public:
GLenum logic_op; // GL_LOGIC_OP_MODE
// 3 texture units - one for each that is used in PICA fragment shader emulation
struct {
struct TextureUnit {
GLuint texture_2d; // GL_TEXTURE_BINDING_2D
GLuint sampler; // GL_SAMPLER_BINDING
} texture_units[3];
};
std::array<TextureUnit, 3> texture_units;
struct {
GLuint texture_cube; // GL_TEXTURE_BINDING_CUBE_MAP