summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsenorblanco <senorblanco@chromium.org>2015-05-01 11:24:05 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-01 18:24:48 +0000
commit0aecd69f2612fb8dab768900e4b2061b56ffb236 (patch)
tree41468e12a34fef30d218d075032de13587c2528c
parentcc3469cc0349220664091386e6eeea229b9043f7 (diff)
downloadchromium_src-0aecd69f2612fb8dab768900e4b2061b56ffb236.zip
chromium_src-0aecd69f2612fb8dab768900e4b2061b56ffb236.tar.gz
chromium_src-0aecd69f2612fb8dab768900e4b2061b56ffb236.tar.bz2
Fix max_samples in command buffer capabilities.
This value should be set if either of the MSAA modes is available, or we're in ES3 (where it's always availble). Also it should be transferred via IPC. BUG= Review URL: https://codereview.chromium.org/1121493005 Cr-Commit-Position: refs/heads/master@{#327944}
-rw-r--r--gpu/command_buffer/common/capabilities.h3
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc6
-rw-r--r--gpu/ipc/gpu_command_buffer_traits_multi.h32
3 files changed, 40 insertions, 1 deletions
diff --git a/gpu/command_buffer/common/capabilities.h b/gpu/command_buffer/common/capabilities.h
index 5cc9b22..569d573 100644
--- a/gpu/command_buffer/common/capabilities.h
+++ b/gpu/command_buffer/common/capabilities.h
@@ -20,6 +20,9 @@
namespace gpu {
+// NOTE: When adding members to this struct, also add corresponding
+// entries in gpu/ipc/gpu_command_buffer_traits_multi.h.
+
struct GPU_EXPORT Capabilities {
struct ShaderPrecision {
ShaderPrecision() : min_range(0), max_range(0), precision(0) {}
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index bc8721f..9d8bbc1 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -2948,7 +2948,6 @@ Capabilities GLES2DecoderImpl::GetCapabilities() {
&caps.max_fragment_uniform_components);
DoGetIntegerv(GL_MAX_PROGRAM_TEXEL_OFFSET,
&caps.max_program_texel_offset);
- DoGetIntegerv(GL_MAX_SAMPLES, &caps.max_samples);
DoGetIntegerv(GL_MAX_SERVER_WAIT_TIMEOUT, &caps.max_server_wait_timeout);
DoGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS,
&caps.max_transform_feedback_interleaved_components);
@@ -2976,6 +2975,11 @@ Capabilities GLES2DecoderImpl::GetCapabilities() {
caps.major_version = 3;
caps.minor_version = 0;
}
+ if (feature_info_->feature_flags().multisampled_render_to_texture ||
+ feature_info_->feature_flags().chromium_framebuffer_multisample ||
+ unsafe_es3_apis_enabled()) {
+ DoGetIntegerv(GL_MAX_SAMPLES, &caps.max_samples);
+ }
caps.egl_image_external =
feature_info_->feature_flags().oes_egl_image_external;
diff --git a/gpu/ipc/gpu_command_buffer_traits_multi.h b/gpu/ipc/gpu_command_buffer_traits_multi.h
index 810dbf8..ed6ba3a 100644
--- a/gpu/ipc/gpu_command_buffer_traits_multi.h
+++ b/gpu/ipc/gpu_command_buffer_traits_multi.h
@@ -42,9 +42,37 @@ IPC_STRUCT_TRAITS_BEGIN(gpu::Capabilities)
IPC_STRUCT_TRAITS_MEMBER(num_compressed_texture_formats)
IPC_STRUCT_TRAITS_MEMBER(num_shader_binary_formats)
IPC_STRUCT_TRAITS_MEMBER(bind_generates_resource_chromium)
+
+ IPC_STRUCT_TRAITS_MEMBER(max_3d_texture_size)
+ IPC_STRUCT_TRAITS_MEMBER(max_array_texture_layers)
+ IPC_STRUCT_TRAITS_MEMBER(max_color_attachments)
+ IPC_STRUCT_TRAITS_MEMBER(max_combined_fragment_uniform_components)
+ IPC_STRUCT_TRAITS_MEMBER(max_combined_uniform_blocks)
+ IPC_STRUCT_TRAITS_MEMBER(max_combined_vertex_uniform_components)
+ IPC_STRUCT_TRAITS_MEMBER(max_draw_buffers)
+ IPC_STRUCT_TRAITS_MEMBER(max_element_index)
+ IPC_STRUCT_TRAITS_MEMBER(max_elements_indices)
+ IPC_STRUCT_TRAITS_MEMBER(max_elements_vertices)
+ IPC_STRUCT_TRAITS_MEMBER(max_fragment_input_components)
+ IPC_STRUCT_TRAITS_MEMBER(max_fragment_uniform_blocks)
+ IPC_STRUCT_TRAITS_MEMBER(max_fragment_uniform_components)
+ IPC_STRUCT_TRAITS_MEMBER(max_program_texel_offset)
+ IPC_STRUCT_TRAITS_MEMBER(max_samples)
+ IPC_STRUCT_TRAITS_MEMBER(max_server_wait_timeout)
+ IPC_STRUCT_TRAITS_MEMBER(max_transform_feedback_interleaved_components)
IPC_STRUCT_TRAITS_MEMBER(max_transform_feedback_separate_attribs)
+ IPC_STRUCT_TRAITS_MEMBER(max_transform_feedback_separate_components)
+ IPC_STRUCT_TRAITS_MEMBER(max_uniform_block_size)
IPC_STRUCT_TRAITS_MEMBER(max_uniform_buffer_bindings)
+ IPC_STRUCT_TRAITS_MEMBER(max_varying_components)
+ IPC_STRUCT_TRAITS_MEMBER(max_vertex_output_components)
+ IPC_STRUCT_TRAITS_MEMBER(max_vertex_uniform_blocks)
+ IPC_STRUCT_TRAITS_MEMBER(max_vertex_uniform_components)
+ IPC_STRUCT_TRAITS_MEMBER(min_program_texel_offset)
+ IPC_STRUCT_TRAITS_MEMBER(num_extensions)
+ IPC_STRUCT_TRAITS_MEMBER(num_program_binary_formats)
IPC_STRUCT_TRAITS_MEMBER(uniform_buffer_offset_alignment)
+
IPC_STRUCT_TRAITS_MEMBER(post_sub_buffer)
IPC_STRUCT_TRAITS_MEMBER(egl_image_external)
IPC_STRUCT_TRAITS_MEMBER(texture_format_atc)
@@ -60,7 +88,11 @@ IPC_STRUCT_TRAITS_BEGIN(gpu::Capabilities)
IPC_STRUCT_TRAITS_MEMBER(discard_framebuffer)
IPC_STRUCT_TRAITS_MEMBER(sync_query)
IPC_STRUCT_TRAITS_MEMBER(image)
+ IPC_STRUCT_TRAITS_MEMBER(future_sync_points)
IPC_STRUCT_TRAITS_MEMBER(blend_equation_advanced)
IPC_STRUCT_TRAITS_MEMBER(blend_equation_advanced_coherent)
IPC_STRUCT_TRAITS_MEMBER(texture_rg)
+
+ IPC_STRUCT_TRAITS_MEMBER(major_version)
+ IPC_STRUCT_TRAITS_MEMBER(minor_version)
IPC_STRUCT_TRAITS_END()