| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdio.h> | 5 #include <stdio.h> |
| 6 #include <sys/mman.h> | 6 #include <sys/mman.h> |
| 7 | 7 |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 | 9 |
| 10 #include "main.h" | 10 #include "main.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 char *yuv_to_rgb_vertex = static_cast<char *>( | 36 char *yuv_to_rgb_vertex = static_cast<char *>( |
| 37 MmapFile(vertex, &size_vertex)); | 37 MmapFile(vertex, &size_vertex)); |
| 38 char *yuv_to_rgb_fragment = static_cast<char *>( | 38 char *yuv_to_rgb_fragment = static_cast<char *>( |
| 39 MmapFile(fragment, &size_fragment)); | 39 MmapFile(fragment, &size_fragment)); |
| 40 GLuint program = 0; | 40 GLuint program = 0; |
| 41 | 41 |
| 42 if (!yuv_to_rgb_fragment || !yuv_to_rgb_vertex) | 42 if (!yuv_to_rgb_fragment || !yuv_to_rgb_vertex) |
| 43 goto done; | 43 goto done; |
| 44 | 44 |
| 45 { | 45 { |
| 46 program = InitShaderProgram(yuv_to_rgb_vertex, yuv_to_rgb_fragment); | 46 #if defined(I915_WORKAROUND) |
| 47 const char* header = "#define I915_WORKAROUND 1\n"; |
| 48 #else |
| 49 const char* header = NULL; |
| 50 #endif |
| 51 program = InitShaderProgramWithHeader(header, yuv_to_rgb_vertex, |
| 52 yuv_to_rgb_fragment); |
| 47 | 53 |
| 48 int imageWidthUniform = glGetUniformLocation(program, "imageWidth"); | 54 int imageWidthUniform = glGetUniformLocation(program, "imageWidth"); |
| 49 int imageHeightUniform = glGetUniformLocation(program, "imageHeight"); | 55 int imageHeightUniform = glGetUniformLocation(program, "imageHeight"); |
| 50 int textureSampler = glGetUniformLocation(program, "textureSampler"); | 56 int textureSampler = glGetUniformLocation(program, "textureSampler"); |
| 51 int evenLinesSampler = glGetUniformLocation(program, "paritySampler"); | 57 int evenLinesSampler = glGetUniformLocation(program, "paritySampler"); |
| 52 | 58 |
| 53 glUniform1f(imageWidthUniform, width); | 59 glUniform1f(imageWidthUniform, width); |
| 54 glUniform1f(imageHeightUniform, height); | 60 glUniform1f(imageHeightUniform, height); |
| 55 glUniform1i(textureSampler, 0); | 61 glUniform1i(textureSampler, 0); |
| 56 glUniform1i(evenLinesSampler, 1); | 62 glUniform1i(evenLinesSampler, 1); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 137 |
| 132 return true; | 138 return true; |
| 133 } | 139 } |
| 134 | 140 |
| 135 | 141 |
| 136 TestBase* GetYuvToRgbTest(int type, const char* name) { | 142 TestBase* GetYuvToRgbTest(int type, const char* name) { |
| 137 return new YuvToRgbTest(type, name); | 143 return new YuvToRgbTest(type, name); |
| 138 } | 144 } |
| 139 | 145 |
| 140 } // namespace glbench | 146 } // namespace glbench |
| OLD | NEW |