Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tr_shader: colormap stage with 2D image bit is generic2D #1208

Open
wants to merge 1 commit into
base: for-0.55.0/sync
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/engine/renderer/tr_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -3472,6 +3472,7 @@ inline bool checkGLErrors()
void Render_NONE( shaderStage_t *pStage );
void Render_NOP( shaderStage_t *pStage );
void Render_generic( shaderStage_t *pStage );
void Render_generic2D( shaderStage_t *pStage );
void Render_generic3D( shaderStage_t *pStage );
void Render_lightMapping( shaderStage_t *pStage );
void Render_reflection_CB( shaderStage_t *pStage );
Expand Down
2 changes: 1 addition & 1 deletion src/engine/renderer/tr_shade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ void Render_NOP( shaderStage_t * )
{
}

static void Render_generic2D( shaderStage_t *pStage )
void Render_generic2D( shaderStage_t *pStage )
{
GLimp_LogComment( "--- Render_generic2D ---\n" );

Expand Down
9 changes: 6 additions & 3 deletions src/engine/renderer/tr_shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5382,12 +5382,15 @@ static void SetStagesRenderers()

stageRendererOptions_t stageRendererOptions = { &Render_NONE, false, false };

bool opaqueOrLess = shader.sort <= Util::ordinal(shaderSort_t::SS_OPAQUE);

switch ( stage->type )
{
case stageType_t::ST_COLORMAP:
stageRendererOptions = { &Render_generic, opaqueOrLess, false };
{
bool opaqueOrLess = shader.sort <= Util::ordinal(shaderSort_t::SS_OPAQUE);
bool is2D = stage->bundle[ TB_COLORMAP ].image[ 0 ]->bits & RSF_2D;
stageRenderer_t genericRenderer = is2D ? Render_generic2D : Render_generic;
stageRendererOptions = { genericRenderer, opaqueOrLess, false };
}
break;
case stageType_t::ST_STYLELIGHTMAP:
case stageType_t::ST_STYLECOLORMAP:
Expand Down