History

Deal with function signature changes

Dale Glass committed 4 years ago

Commit cd489f11 parent 0dbf7572 files · +10 −10Browse files

Showing the changes to tests/gpu/src/TextureTest.cpp (1 of 2 files). Show all

Unified · Split

tests/gpu/src/TextureTest.cpp+9−9
@@ -38,11 +38,11 @@ std::string vertexShaderSource = R"SHADER( · 37 unmodified lines
3838 layout(location = 0) out vec2 outTexCoord0;
3939
4040 const vec4 VERTICES[] = vec4[](
41− vec4(-1.0, -1.0, 0.0, 1.0),
42− vec4( 1.0, -1.0, 0.0, 1.0),
41+ vec4(-1.0, -1.0, 0.0, 1.0),
42+ vec4( 1.0, -1.0, 0.0, 1.0),
4343 vec4(-1.0, 1.0, 0.0, 1.0),
4444 vec4( 1.0, 1.0, 0.0, 1.0)
45−);
45+);
4646
4747 void main() {
4848 outTexCoord0 = VERTICES[gl_VertexID].xy;
@@ -110,8 +110,8 @@ void TextureTest::initTestCase() { · 61 unmodified lines
110110
111111 _canvas.makeCurrent();
112112 {
113− auto VS = gpu::Shader::createVertex(vertexShaderSource);
114− auto PS = gpu::Shader::createPixel(fragmentShaderSource);
113+ auto VS = gpu::Shader::createVertex(shader::Source::generate(vertexShaderSource));
114+ auto PS = gpu::Shader::createPixel(shader::Source::generate(fragmentShaderSource));
115115 auto program = gpu::Shader::createProgram(VS, PS);
116116 // If the pipeline did not exist, make it
117117 auto state = std::make_shared<gpu::State>();
@@ -144,9 +144,9 @@ void TextureTest::cleanupTestCase() { · 26 unmodified lines
144144 _gpuContext.reset();
145145 }
146146
147−std::vector<gpu::TexturePointer> TextureTest::loadTestTextures() const {
147+std::vector<std::pair<gpu::TexturePointer, glm::ivec2>> TextureTest::loadTestTextures() const {
148148 // Load the test textures
149− std::vector<gpu::TexturePointer> result;
149+ std::vector<std::pair<gpu::TexturePointer, glm::ivec2>> result;
150150 size_t newTextureCount = std::min<size_t>(_textureFiles.size(), LOAD_TEXTURE_COUNT);
151151 for (size_t i = 0; i < newTextureCount; ++i) {
152152 const auto& textureFile = _textureFiles[i];
@@ -193,14 +193,14 @@ void TextureTest::testTextureLoading() { · 40 unmodified lines
193193 auto renderTexturesLamdba = [&](gpu::Batch& batch) {
194194 batch.setPipeline(_pipeline);
195195 for (const auto& texture : textures) {
196− batch.setResourceTexture(0, texture);
196+ batch.setResourceTexture(0, texture.first);
197197 batch.draw(gpu::TRIANGLE_STRIP, 4, 0);
198198 }
199199 };
200200
201201 size_t expectedAllocation = 0;
202202 for (const auto& texture : textures) {
203− expectedAllocation += texture->evalTotalSize();
203+ expectedAllocation += texture.first->evalTotalSize();
204204 }
205205 QVERIFY(textures.size() > 0);
206206

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t