Skip to content

Commit

Permalink
Two more renames to make things read better
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Oct 17, 2022
1 parent 9b8a5d1 commit 30aa07b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion GPU/Common/DrawEngineCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ u32 DrawEngineCommon::NormalizeVertices(u8 *outPtr, u8 *bufPtr, const u8 *inPtr,
}

void DrawEngineCommon::ApplyFramebufferRead(FBOTexState *fboTexState) {
if (gstate_c.Use(GPU_USE_ANY_FRAMEBUFFER_FETCH)) {
if (gstate_c.Use(GPU_USE_FRAMEBUFFER_FETCH)) {
*fboTexState = FBO_TEX_READ_FRAMEBUFFER;
} else {
gpuStats.numCopiesForShaderBlend++;
Expand Down
4 changes: 2 additions & 2 deletions GPU/Common/FragmentShaderGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ bool GenerateFragmentShader(const FShaderID &id, char *buffer, const ShaderLangu

bool needFramebufferRead = replaceBlend == REPLACE_BLEND_READ_FRAMEBUFFER || colorWriteMask || replaceLogicOp;

bool fetchFramebuffer = needFramebufferRead && gstate_c.Use(GPU_USE_ANY_FRAMEBUFFER_FETCH);
bool readFramebufferTex = needFramebufferRead && !gstate_c.Use(GPU_USE_ANY_FRAMEBUFFER_FETCH);
bool fetchFramebuffer = needFramebufferRead && gstate_c.Use(GPU_USE_FRAMEBUFFER_FETCH);
bool readFramebufferTex = needFramebufferRead && !gstate_c.Use(GPU_USE_FRAMEBUFFER_FETCH);

bool needFragCoord = readFramebufferTex || gstate_c.Use(GPU_ROUND_FRAGMENT_DEPTH_TO_16BIT);
bool writeDepth = gstate_c.Use(GPU_ROUND_FRAGMENT_DEPTH_TO_16BIT);
Expand Down
6 changes: 3 additions & 3 deletions GPU/Common/GPUStateUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ ReplaceBlendType ReplaceBlendWithShader(GEBufferFormat bufferFormat) {
case GE_DSTBLEND_DOUBLESRCALPHA:
// We can't technically do this correctly (due to clamping) without reading the dst color.
// Using a copy isn't accurate either, though, when there's overlap.
if (gstate_c.Use(GPU_USE_ANY_FRAMEBUFFER_FETCH))
if (gstate_c.Use(GPU_USE_FRAMEBUFFER_FETCH))
return REPLACE_BLEND_READ_FRAMEBUFFER;
return REPLACE_BLEND_PRE_SRC_2X_ALPHA;

Expand Down Expand Up @@ -454,14 +454,14 @@ ReplaceBlendType ReplaceBlendWithShader(GEBufferFormat bufferFormat) {
case GE_DSTBLEND_DOUBLESRCALPHA:
if (funcA == GE_SRCBLEND_SRCALPHA || funcA == GE_SRCBLEND_INVSRCALPHA) {
// Can't safely double alpha, will clamp. However, a copy may easily be worse due to overlap.
if (gstate_c.Use(GPU_USE_ANY_FRAMEBUFFER_FETCH))
if (gstate_c.Use(GPU_USE_FRAMEBUFFER_FETCH))
return REPLACE_BLEND_READ_FRAMEBUFFER;
return REPLACE_BLEND_PRE_SRC_2X_ALPHA;
} else {
// This means dst alpha/color is used in the src factor.
// Unfortunately, copying here causes overlap problems in Silent Hill games (it seems?)
// We will just hope that doubling alpha for the dst factor will not clamp too badly.
if (gstate_c.Use(GPU_USE_ANY_FRAMEBUFFER_FETCH))
if (gstate_c.Use(GPU_USE_FRAMEBUFFER_FETCH))
return REPLACE_BLEND_READ_FRAMEBUFFER;
return REPLACE_BLEND_2X_ALPHA;
}
Expand Down
2 changes: 1 addition & 1 deletion GPU/GLES/GPU_GLES.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ u32 GPU_GLES::CheckGPUFeatures() const {
features |= GPU_USE_16BIT_FORMATS;

if ((gl_extensions.gpuVendor == GPU_VENDOR_NVIDIA) || (gl_extensions.gpuVendor == GPU_VENDOR_AMD))
features |= GPU_PREFER_REVERSE_COLOR_ORDER;
features |= GPU_USE_REVERSE_COLOR_ORDER;

if (gl_extensions.GLES3 || !gl_extensions.IsGLES)
features |= GPU_USE_TEXTURE_LOD_CONTROL;
Expand Down
2 changes: 1 addition & 1 deletion GPU/GPUCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3322,7 +3322,7 @@ u32 GPUCommon::CheckGPUFeatures() const {
}

if (draw_->GetDeviceCaps().framebufferFetchSupported) {
features |= GPU_USE_ANY_FRAMEBUFFER_FETCH;
features |= GPU_USE_FRAMEBUFFER_FETCH;
}

if (draw_->GetShaderLanguageDesc().bitwiseOps) {
Expand Down
4 changes: 2 additions & 2 deletions GPU/GPUState.h
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ enum {
GPU_USE_ACCURATE_DEPTH = FLAG_BIT(17),
GPU_USE_GS_CULLING = FLAG_BIT(18), // Geometry shader
// Free bit: 19
GPU_USE_ANY_FRAMEBUFFER_FETCH = FLAG_BIT(20),
GPU_USE_FRAMEBUFFER_FETCH = FLAG_BIT(20),
GPU_SCALE_DEPTH_FROM_24BIT_TO_16BIT = FLAG_BIT(21),
GPU_ROUND_FRAGMENT_DEPTH_TO_16BIT = FLAG_BIT(22),
GPU_ROUND_DEPTH_TO_16BIT = FLAG_BIT(23), // Can be disabled either per game or if we use a real 16-bit depth buffer
Expand All @@ -500,7 +500,7 @@ enum {
GPU_USE_TEXTURE_NPOT = FLAG_BIT(28),
GPU_USE_CLIP_DISTANCE = FLAG_BIT(29),
GPU_USE_CULL_DISTANCE = FLAG_BIT(30),
GPU_PREFER_REVERSE_COLOR_ORDER = FLAG_BIT(31),
GPU_USE_REVERSE_COLOR_ORDER = FLAG_BIT(31),
};

struct KnownVertexBounds {
Expand Down

0 comments on commit 30aa07b

Please sign in to comment.