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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

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 | « no previous file | gpu/command_buffer/service/sampler_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index bba2e3c71f991f942c6bb2c01c5c7e4ea078f3b9..34601eb6ccbbbed9401a20ccd98b78bf10f2d091 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -1882,8 +1882,6 @@
// will rebind all external textures to match their current service_id.
void RestoreAllExternalTextureBindingsIfNeeded() override;
- const SamplerState& GetSamplerStateForTextureUnit(GLenum target, GLuint unit);
-
// Generate a member function prototype for each command in an automated and
// typesafe way.
#define GLES2_CMD_OP(name) \
@@ -2090,8 +2088,6 @@
bool force_shader_name_hashing_for_test;
GLfloat line_width_range_[2];
-
- SamplerState default_sampler_state_;
DISALLOW_COPY_AND_ASSIGN(GLES2DecoderImpl);
};
@@ -7614,6 +7610,10 @@
bool GLES2DecoderImpl::PrepareTexturesForRender() {
DCHECK(state_.current_program.get());
+ if (!texture_manager()->HaveUnrenderableTextures() &&
+ !texture_manager()->HaveImages()) {
+ return true;
+ }
bool textures_set = false;
const Program::SamplerIndices& sampler_indices =
state_.current_program->sampler_indices();
@@ -7628,11 +7628,7 @@
TextureRef* texture_ref =
texture_unit.GetInfoForSamplerType(uniform_info->type).get();
GLenum textarget = GetBindTargetForSamplerType(uniform_info->type);
- const SamplerState& sampler_state = GetSamplerStateForTextureUnit(
- uniform_info->type, texture_unit_index);
- if (!texture_ref ||
- !texture_manager()->CanRenderWithSampler(
- texture_ref, sampler_state)) {
+ if (!texture_ref || !texture_manager()->CanRender(texture_ref)) {
textures_set = true;
glActiveTexture(GL_TEXTURE0 + texture_unit_index);
glBindTexture(
@@ -7688,11 +7684,7 @@
TextureUnit& texture_unit = state_.texture_units[texture_unit_index];
TextureRef* texture_ref =
texture_unit.GetInfoForSamplerType(uniform_info->type).get();
- const SamplerState& sampler_state = GetSamplerStateForTextureUnit(
- uniform_info->type, texture_unit_index);
- if (!texture_ref ||
- !texture_manager()->CanRenderWithSampler(
- texture_ref, sampler_state)) {
+ if (!texture_ref || !texture_manager()->CanRender(texture_ref)) {
glActiveTexture(GL_TEXTURE0 + texture_unit_index);
// Get the texture_ref info that was previously bound here.
texture_ref =
@@ -15465,21 +15457,6 @@
program->SetFragmentInputLocationBinding(name, location);
}
-const SamplerState& GLES2DecoderImpl::GetSamplerStateForTextureUnit(
- GLenum target, GLuint unit) {
- if (features().enable_samplers) {
- Sampler* sampler = state_.sampler_units[unit].get();
- if (sampler)
- return sampler->sampler_state();
- }
- TextureUnit& texture_unit = state_.texture_units[unit];
- TextureRef* texture_ref = texture_unit.GetInfoForSamplerType(target).get();
- if (texture_ref)
- return texture_ref->texture()->sampler_state();
-
- return default_sampler_state_;
-}
-
error::Error GLES2DecoderImpl::HandleBindFragmentInputLocationCHROMIUMBucket(
uint32_t immediate_data_size,
const void* cmd_data) {
« no previous file with comments | « no previous file | gpu/command_buffer/service/sampler_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698