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

Unified Diff: gpu/command_buffer/service/texture_manager.h

Issue 1630263002: Revert of Updating texture validation to account for sampler objects in ES3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « gpu/command_buffer/service/texture_definition.cc ('k') | gpu/command_buffer/service/texture_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/texture_manager.h
diff --git a/gpu/command_buffer/service/texture_manager.h b/gpu/command_buffer/service/texture_manager.h
index c026769746b3429f68a50ff131172a9e8a8109c4..e33df33059c682db9fe944bcb90ca76aaa834838 100644
--- a/gpu/command_buffer/service/texture_manager.h
+++ b/gpu/command_buffer/service/texture_manager.h
@@ -19,7 +19,6 @@
#include "gpu/command_buffer/service/feature_info.h"
#include "gpu/command_buffer/service/gl_utils.h"
#include "gpu/command_buffer/service/memory_tracking.h"
-#include "gpu/command_buffer/service/sampler_manager.h"
#include "gpu/gpu_export.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gl/gl_image.h"
@@ -61,28 +60,24 @@
explicit Texture(GLuint service_id);
- const SamplerState& sampler_state() const {
- return sampler_state_;
- }
-
GLenum min_filter() const {
- return sampler_state_.min_filter;
+ return min_filter_;
}
GLenum mag_filter() const {
- return sampler_state_.mag_filter;
+ return mag_filter_;
}
GLenum wrap_r() const {
- return sampler_state_.wrap_r;
+ return wrap_r_;
}
GLenum wrap_s() const {
- return sampler_state_.wrap_s;
+ return wrap_s_;
}
GLenum wrap_t() const {
- return sampler_state_.wrap_t;
+ return wrap_t_;
}
GLenum usage() const {
@@ -90,19 +85,19 @@
}
GLenum compare_func() const {
- return sampler_state_.compare_func;
+ return compare_func_;
}
GLenum compare_mode() const {
- return sampler_state_.compare_mode;
+ return compare_mode_;
}
GLfloat max_lod() const {
- return sampler_state_.max_lod;
+ return max_lod_;
}
GLfloat min_lod() const {
- return sampler_state_.min_lod;
+ return min_lod_;
}
GLint base_level() const {
@@ -257,7 +252,7 @@
enum CanRenderCondition {
CAN_RENDER_ALWAYS,
CAN_RENDER_NEVER,
- CAN_RENDER_NEEDS_VALIDATION,
+ CAN_RENDER_ONLY_IF_NPOT
};
struct LevelInfo {
@@ -352,15 +347,12 @@
void MarkMipmapsGenerated(const FeatureInfo* feature_info);
bool NeedsMips() const {
- return sampler_state_.min_filter != GL_NEAREST &&
- sampler_state_.min_filter != GL_LINEAR;
+ return min_filter_ != GL_NEAREST && min_filter_ != GL_LINEAR;
}
// True if this texture meets all the GLES2 criteria for rendering.
// See section 3.8.2 of the GLES2 spec.
bool CanRender(const FeatureInfo* feature_info) const;
- bool CanRenderWithSampler(const FeatureInfo* feature_info,
- const SamplerState& sampler_state) const;
// Returns true if mipmaps can be generated by GL.
bool CanGenerateMipmaps(const FeatureInfo* feature_info) const;
@@ -485,8 +477,16 @@
GLenum target_;
// Texture parameters.
- SamplerState sampler_state_;
+ GLenum min_filter_;
+ GLenum mag_filter_;
+ GLenum wrap_r_;
+ GLenum wrap_s_;
+ GLenum wrap_t_;
GLenum usage_;
+ GLenum compare_func_;
+ GLenum compare_mode_;
+ GLfloat max_lod_;
+ GLfloat min_lod_;
GLint base_level_;
GLint max_level_;
@@ -701,12 +701,6 @@
// See section 3.8.2 of the GLES2 spec.
bool CanRender(const TextureRef* ref) const {
return ref->texture()->CanRender(feature_info_.get());
- }
-
- bool CanRenderWithSampler(
- const TextureRef* ref, const SamplerState& sampler_state) const {
- return ref->texture()->CanRenderWithSampler(
- feature_info_.get(), sampler_state);
}
// Returns true if mipmaps can be generated by GL.
@@ -804,6 +798,10 @@
}
}
+ bool HaveUnrenderableTextures() const {
+ return num_unrenderable_textures_ > 0;
+ }
+
bool HaveUnsafeTextures() const {
return num_unsafe_textures_ > 0;
}
@@ -1017,6 +1015,7 @@
const bool use_default_textures_;
+ int num_unrenderable_textures_;
int num_unsafe_textures_;
int num_uncleared_mips_;
int num_images_;
« no previous file with comments | « gpu/command_buffer/service/texture_definition.cc ('k') | gpu/command_buffer/service/texture_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698