diff --git a/GPU/GLES/DrawEngineGLES.cpp b/GPU/GLES/DrawEngineGLES.cpp index 25822b470d..2241a18dd3 100644 --- a/GPU/GLES/DrawEngineGLES.cpp +++ b/GPU/GLES/DrawEngineGLES.cpp @@ -657,7 +657,7 @@ void DrawEngineGLES::TessellationDataTransferGLES::SendDataToShader(const float data_tex[0] = renderManager_->CreateTexture(GL_TEXTURE_2D); renderManager_->TextureImage(data_tex[0], 0, size, 1, GL_RGBA32F, GL_RGBA, GL_FLOAT, pos_data, GLRAllocType::NEW, false); renderManager_->FinalizeTexture(data_tex[0], 0, false); - renderManager_->BindTexture(4, data_tex[0]); + renderManager_->BindTexture(TEX_SLOT_SPLINE_POS, data_tex[0]); // Texcoords if (hasTexCoords) { @@ -668,7 +668,7 @@ void DrawEngineGLES::TessellationDataTransferGLES::SendDataToShader(const float data_tex[1] = renderManager_->CreateTexture(GL_TEXTURE_2D); renderManager_->TextureImage(data_tex[1], 0, size, 1, GL_RGBA32F, GL_RGBA, GL_FLOAT, tex_data, GLRAllocType::NEW, false); renderManager_->FinalizeTexture(data_tex[1], 0, false); - renderManager_->BindTexture(5, data_tex[1]); + renderManager_->BindTexture(TEX_SLOT_SPLINE_NRM, data_tex[1]); } if (data_tex[2]) @@ -680,7 +680,7 @@ void DrawEngineGLES::TessellationDataTransferGLES::SendDataToShader(const float renderManager_->TextureImage(data_tex[2], 0, sizeColor, 1, GL_RGBA32F, GL_RGBA, GL_FLOAT, col_data, GLRAllocType::NEW, false); renderManager_->FinalizeTexture(data_tex[2], 0, false); - renderManager_->BindTexture(6, data_tex[2]); + renderManager_->BindTexture(TEX_SLOT_SPLINE_COL, data_tex[2]); } void DrawEngineGLES::TessellationDataTransferGLES::EndFrame() { diff --git a/GPU/GLES/DrawEngineGLES.h b/GPU/GLES/DrawEngineGLES.h index 42e4ce5133..535535d42e 100644 --- a/GPU/GLES/DrawEngineGLES.h +++ b/GPU/GLES/DrawEngineGLES.h @@ -41,6 +41,17 @@ struct TransformedVertex; struct DecVtxFormat; +enum { + TEX_SLOT_PSP_TEXTURE = 0, + TEX_SLOT_SHADERBLEND_SRC = 1, + TEX_SLOT_ALPHATEST = 2, + TEX_SLOT_CLUT = 3, + TEX_SLOT_SPLINE_POS = 4, + TEX_SLOT_SPLINE_NRM = 5, + TEX_SLOT_SPLINE_COL = 6, +}; + + // States transitions: // On creation: DRAWN_NEW // DRAWN_NEW -> DRAWN_HASHING diff --git a/GPU/GLES/FramebufferManagerGLES.cpp b/GPU/GLES/FramebufferManagerGLES.cpp index 7246c5654c..1211459f02 100644 --- a/GPU/GLES/FramebufferManagerGLES.cpp +++ b/GPU/GLES/FramebufferManagerGLES.cpp @@ -403,7 +403,7 @@ void FramebufferManagerGLES::MakePixelTexture(const u8 *srcPixels, GEBufferForma render_->FinalizeTexture(drawPixelsTex_, 0, false); // TODO: Return instead? - render_->BindTexture(0, drawPixelsTex_); + render_->BindTexture(TEX_SLOT_PSP_TEXTURE, drawPixelsTex_); } void FramebufferManagerGLES::SetViewport2D(int x, int y, int w, int h) { diff --git a/GPU/GLES/StateMappingGLES.cpp b/GPU/GLES/StateMappingGLES.cpp index 5a5fc1f071..ec256cd842 100644 --- a/GPU/GLES/StateMappingGLES.cpp +++ b/GPU/GLES/StateMappingGLES.cpp @@ -124,7 +124,7 @@ static const GLushort logicOps[] = { inline void DrawEngineGLES::ResetShaderBlending() { if (fboTexBound_) { GLRenderManager *renderManager = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER); - renderManager->BindTexture(1, nullptr); + renderManager->BindTexture(TEX_SLOT_SHADERBLEND_SRC, nullptr); fboTexBound_ = false; } } @@ -331,7 +331,7 @@ void DrawEngineGLES::ApplyDrawStateLate(bool setStencil, int stencilValue) { if (!gstate.isModeClear()) { // Apply last, once we know the alpha params of the texture. if (gstate.isAlphaTestEnabled() || gstate.isColorTestEnabled()) { - fragmentTestCache_->BindTestTexture(2); + fragmentTestCache_->BindTestTexture(TEX_SLOT_ALPHATEST); } } } diff --git a/GPU/GLES/TextureCacheGLES.cpp b/GPU/GLES/TextureCacheGLES.cpp index ae57b3b472..38d5aa280a 100644 --- a/GPU/GLES/TextureCacheGLES.cpp +++ b/GPU/GLES/TextureCacheGLES.cpp @@ -327,7 +327,7 @@ void TextureCacheGLES::BindTexture(TexCacheEntry *entry) { } void TextureCacheGLES::Unbind() { - render_->BindTexture(0, nullptr); + render_->BindTexture(TEX_SLOT_PSP_TEXTURE, nullptr); InvalidateLastTexture(); } @@ -451,8 +451,8 @@ void TextureCacheGLES::ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFram shaderApply.Use(render_, drawEngine_, shadeInputLayout_); framebufferManagerGL_->BindFramebufferAsColorTexture(0, framebuffer, BINDFBCOLOR_SKIP_COPY); - render_->BindTexture(3, clutTexture); - render_->SetTextureSampler(3, GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE, GL_NEAREST, GL_NEAREST, 0.0f); + render_->BindTexture(TEX_SLOT_CLUT, clutTexture); + render_->SetTextureSampler(TEX_SLOT_CLUT, GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE, GL_NEAREST, GL_NEAREST, 0.0f); shaderApply.Shade(render_); @@ -662,7 +662,7 @@ void TextureCacheGLES::BuildTexture(TexCacheEntry *const entry) { // This will rebind it, but that's okay. // Need to actually bind it now - it might only have gotten bound in the init phase. - render_->BindTexture(0, entry->textureName); + render_->BindTexture(TEX_SLOT_PSP_TEXTURE, entry->textureName); UpdateSamplingParams(*entry, true); }