Ensure correct SSBO bindings are present for shadow tests. Metal validation errors occur if SSBO bindings that are expected are not bound. In this case, we can bind empty SSBOs, but these should be of the correct type for the tests. Also adding missing zero-initializations for required members within LightData. Without these, unit tests fail with various issues including prevalence of OOB reads. Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com> Pull Request: https://projects.blender.org/blender/blender/pulls/109645
29 lines
598 B
C++
29 lines
598 B
C++
/* SPDX-FileCopyrightText: 2023 Blender Foundation
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0 */
|
|
|
|
#include "draw_testing.hh"
|
|
|
|
#include "GPU_shader.h"
|
|
|
|
#include "draw_manager_testing.h"
|
|
|
|
namespace blender::draw {
|
|
|
|
/* Base class for draw test cases. It will setup and tear down the GPU part around each test. */
|
|
void DrawOpenGLTest::SetUp()
|
|
{
|
|
GPUOpenGLTest::SetUp();
|
|
DRW_draw_state_init_gtests(GPU_SHADER_CFG_DEFAULT);
|
|
}
|
|
|
|
#ifdef WITH_METAL_BACKEND
|
|
void DrawMetalTest::SetUp()
|
|
{
|
|
GPUMetalTest::SetUp();
|
|
DRW_draw_state_init_gtests(GPU_SHADER_CFG_DEFAULT);
|
|
}
|
|
#endif
|
|
|
|
} // namespace blender::draw
|