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

Fix custom shader output #2105

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion core/renderer/TrianglesCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void TrianglesCommand::init(float globalOrder,
blendDescriptor.sourceRGBBlendFactor = blendDescriptor.sourceAlphaBlendFactor = blendType.src;
blendDescriptor.destinationRGBBlendFactor = blendDescriptor.destinationAlphaBlendFactor = blendType.dst;

if (_batchId == -1)
if (_batchId == std::numeric_limits<uint64_t>::max())
setSkipBatching(true);

if (!isSkipBatching())
Expand Down
2 changes: 1 addition & 1 deletion core/renderer/TrianglesCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class AX_DLL TrianglesCommand : public RenderCommand

// Cached value to determine to generate material id or not.
BlendFunc _blendType = BlendFunc::DISABLE;
uint64_t _batchId = 0;
uint64_t _batchId = std::numeric_limits<uint64_t>::max();
backend::TextureBackend* _texture = nullptr;
};

Expand Down
2 changes: 1 addition & 1 deletion core/renderer/backend/Program.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class AX_DLL Program : public Object
* Get program id.
* @return The program id.
*/
int64_t getProgramId() const { return _programId; }
uint64_t getProgramId() const { return _programId; }

/**
* Get uniform buffer size in bytes that can hold all the uniforms.
Expand Down
4 changes: 2 additions & 2 deletions core/renderer/backend/ProgramManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ class AX_DLL ProgramManager
};

BuiltinRegInfo _builtinRegistry[(int)backend::ProgramType::BUILTIN_COUNT];
std::unordered_map<int64_t, BuiltinRegInfo> _customRegistry;
std::unordered_map<uint64_t, BuiltinRegInfo> _customRegistry;

std::unordered_map<int64_t, Program*> _cachedPrograms; ///< The cached program object.
std::unordered_map<uint64_t, Program*> _cachedPrograms; ///< The cached program object.

XXH64_state_s* _programIdGen;

Expand Down
2 changes: 1 addition & 1 deletion core/renderer/backend/ProgramState.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ class AX_DLL ProgramState : public Object
VertexLayout* _vertexLayout = nullptr;
bool _ownVertexLayout = false;

uint64_t _batchId = -1;
uint64_t _batchId = std::numeric_limits<uint64_t>::max();

#if AX_ENABLE_CACHE_TEXTURE_DATA
EventListenerCustom* _backToForegroundListener = nullptr;
Expand Down