Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3319)

Unified Diff: gpu/command_buffer/common/gpu_memory_buffer_support.cc

Issue 2786103003: Add half-float IOSurface GpuMemoryBuffer support (Closed)
Patch Set: Review feedback Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/common/gpu_memory_buffer_support.cc
diff --git a/gpu/command_buffer/common/gpu_memory_buffer_support.cc b/gpu/command_buffer/common/gpu_memory_buffer_support.cc
index 68237a08fd255e6ffc020f530493d662ffad0290..0159b48fde180f269d75ded05f418395afbb63ba 100644
--- a/gpu/command_buffer/common/gpu_memory_buffer_support.cc
+++ b/gpu/command_buffer/common/gpu_memory_buffer_support.cc
@@ -84,6 +84,7 @@ bool IsImageFormatCompatibleWithGpuMemoryBufferFormat(
case gfx::BufferFormat::RGBX_8888:
return internalformat == GL_RGB;
case gfx::BufferFormat::RGBA_4444:
+ case gfx::BufferFormat::RGBA_F16:
return internalformat == GL_RGBA;
}
@@ -91,8 +92,9 @@ bool IsImageFormatCompatibleWithGpuMemoryBufferFormat(
return false;
}
-bool IsGpuMemoryBufferFormatSupported(gfx::BufferFormat format,
- const gpu::Capabilities& capabilities) {
+bool IsImageFromGpuMemoryBufferFormatSupported(
+ gfx::BufferFormat format,
+ const gpu::Capabilities& capabilities) {
switch (format) {
case gfx::BufferFormat::ATC:
case gfx::BufferFormat::ATCIA:
@@ -117,6 +119,8 @@ bool IsGpuMemoryBufferFormatSupported(gfx::BufferFormat format,
case gfx::BufferFormat::RGBX_8888:
case gfx::BufferFormat::YVU_420:
return true;
+ case gfx::BufferFormat::RGBA_F16:
+ return capabilities.texture_half_float_linear;
case gfx::BufferFormat::YUV_420_BIPLANAR:
#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
// TODO(dcastagna): Determine ycbcr_420v_image on CrOS at runtime
@@ -150,6 +154,7 @@ bool IsImageSizeValidForGpuMemoryBufferFormat(const gfx::Size& size,
case gfx::BufferFormat::RGBX_8888:
case gfx::BufferFormat::BGRA_8888:
case gfx::BufferFormat::BGRX_8888:
+ case gfx::BufferFormat::RGBA_F16:
return true;
case gfx::BufferFormat::YVU_420:
case gfx::BufferFormat::YUV_420_BIPLANAR:
« no previous file with comments | « gpu/command_buffer/common/gpu_memory_buffer_support.h ('k') | gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698