Fix some Claude-isms

This commit is contained in:
Henrik Rydgård committed 2026-09-04 10:41:31 -06:00
1 parent ac016201dc
commit 256984d561
3 files changed
+6 -14

No files matched your search

+1 -3
View File
@@ -266,9 +266,7 @@ void DrawEngineGLES::Flush() {
Shader *vshader = shaderManager_->ApplyVertexShader(useHWTransform, dec_->VertexType(), clipInfoFlags_, &vsid);
if (!vshader) {
// Both the requested shader and the software transform fallback failed to compile.
// Not much we can do here, let's skip drawing. Note that the failure is cached, so this
// will keep happening for this shader ID - hence the log, or geometry would just silently
// disappear for the rest of the session.
// Not much we can do here, let's skip drawing. Note that the failure is cached.
WARN_LOG_N_TIMES(novshader, 5, Log::G3D, "Skipping draw, no vertex shader");
goto bail;
}
+5 -9
View File
@@ -886,9 +886,9 @@ struct CacheHeader {
uint32_t version;
uint32_t useFlags;
uint32_t detectFlags;
int numVertexShaders;
int numFragmentShaders;
int numLinkedPrograms;
uint32_t numVertexShaders;
uint32_t numFragmentShaders;
uint32_t numLinkedPrograms;
};
bool ShaderManagerGLES::LoadCacheFlags(File::IOFile &f, DrawEngineGLES *drawEngine) {
@@ -942,10 +942,8 @@ bool ShaderManagerGLES::LoadCache(File::IOFile &f) {
diskCachePending_.start = time_now_d();
diskCachePending_.Clear();
// Sanity check the file contents. Note that the counts are signed, so check for negative too -
// otherwise they'd turn into huge sizes in the resize() calls below.
if (header.numFragmentShaders > 1000 || header.numVertexShaders > 1000 || header.numLinkedPrograms > 1000 ||
header.numFragmentShaders < 0 || header.numVertexShaders < 0 || header.numLinkedPrograms < 0) {
// Sanity check the file contents. Counts are now unsigned so this is enough.
if (header.numFragmentShaders > 1000 || header.numVertexShaders > 1000 || header.numLinkedPrograms > 1000) {
ERROR_LOG(Log::G3D, "Corrupt shader cache file header, aborting.");
return false;
}
@@ -960,8 +958,6 @@ bool ShaderManagerGLES::LoadCache(File::IOFile &f) {
return false;
}
// Note: ReadArray gets .data(), not &v[0] - the counts can legitimately be zero,
// and indexing an empty vector is UB (and asserts in the debug STL).
diskCachePending_.vert.resize(header.numVertexShaders);
if (!f.ReadArray(diskCachePending_.vert.data(), header.numVertexShaders)) {
diskCachePending_.vert.clear();
-2
View File
@@ -136,8 +136,6 @@ bool FramebufferManagerGLES::ReadbackStencilbuffer(Draw::Framebuffer *fbo, int x
draw_->BindSamplerStates(TEX_SLOT_PSP_TEXTURE, 1, &stencilReadbackSampler_);
// We must bind the program after starting the render pass.
// Note: scissor to the region we're about to read back, not to (0, 0, w, h) - every caller
// passes (0, 0) today, but with a nonzero origin the copy below would read scissored-away pixels.
draw_->SetScissorRect(x, y, w, h);
draw_->BindPipeline(stencilReadbackPipeline_);