Commit 41093c0d authored by Antoine Labour's avatar Antoine Labour Committed by Commit Bot

Fix texture_target_exception_list for unit tests

Previously, InProcessGpuThreadHolder initialized
texture_target_exception_list according to the production expectations,
in particular assuming native GMB types when available. However all unit
tests use viz::TestGpuMemoryBufferManager (if any GMBManager at all)
which only produces shared memory GMBs. This means the wrong target will
be used for those. It's mostly harmless on Mac
(GL_TEXTURE_RECTANGLE_ARB) but no so much on other platforms
(GL_TEXTURE_EXTERNAL_OES which doesn't allow glTex*Image*).

Instead, leave texture_target_exception_list empty, individual tests can
initialize it if they need (e.g. if they use a GpuMemoryBufferFactory).

Bug: 897214
Change-Id: I55984ef49797fa97f00e2bda35b60a4e6ba734bc
Reviewed-on: https://chromium-review.googlesource.com/c/1322610
Commit-Queue: Antoine Labour <piman@chromium.org>
Reviewed-by: default avatarkylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606195}
parent c3b89701
...@@ -70,7 +70,6 @@ component("gpu_thread_holder") { ...@@ -70,7 +70,6 @@ component("gpu_thread_holder") {
"//base", "//base",
"//gpu/command_buffer/service", "//gpu/command_buffer/service",
"//gpu/command_buffer/service:gles2", "//gpu/command_buffer/service:gles2",
"//gpu/ipc/host",
"//gpu/ipc/service", "//gpu/ipc/service",
] ]
} }
...@@ -66,6 +66,8 @@ class RasterInProcessCommandBufferTest : public ::testing::Test { ...@@ -66,6 +66,8 @@ class RasterInProcessCommandBufferTest : public ::testing::Test {
gpu_memory_buffer_factory_ = GpuMemoryBufferFactory::CreateNativeType(); gpu_memory_buffer_factory_ = GpuMemoryBufferFactory::CreateNativeType();
gpu_memory_buffer_manager_ = gpu_memory_buffer_manager_ =
std::make_unique<viz::TestGpuMemoryBufferManager>(); std::make_unique<viz::TestGpuMemoryBufferManager>();
gpu_thread_holder_.GetGpuPreferences()->texture_target_exception_list =
CreateBufferUsageAndFormatExceptionList();
context_ = CreateRasterInProcessContext(); context_ = CreateRasterInProcessContext();
ri_ = context_->GetImplementation(); ri_ = context_->GetImplementation();
} }
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "gpu/config/gpu_info_collector.h" #include "gpu/config/gpu_info_collector.h"
#include "gpu/config/gpu_util.h" #include "gpu/config/gpu_util.h"
#include "gpu/ipc/gpu_in_process_thread_service.h" #include "gpu/ipc/gpu_in_process_thread_service.h"
#include "gpu/ipc/host/gpu_memory_buffer_support.h"
namespace gpu { namespace gpu {
...@@ -22,8 +21,6 @@ InProcessGpuThreadHolder::InProcessGpuThreadHolder() ...@@ -22,8 +21,6 @@ InProcessGpuThreadHolder::InProcessGpuThreadHolder()
DCHECK(base::CommandLine::InitializedForCurrentProcess()); DCHECK(base::CommandLine::InitializedForCurrentProcess());
auto* command_line = base::CommandLine::ForCurrentProcess(); auto* command_line = base::CommandLine::ForCurrentProcess();
gpu_preferences_ = gles2::ParseGpuPreferences(command_line); gpu_preferences_ = gles2::ParseGpuPreferences(command_line);
gpu_preferences_.texture_target_exception_list =
CreateBufferUsageAndFormatExceptionList();
gpu::GPUInfo gpu_info; gpu::GPUInfo gpu_info;
gpu::CollectGraphicsInfoForTesting(&gpu_info); gpu::CollectGraphicsInfoForTesting(&gpu_info);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment