Vulkan: Forgot to extend a few more dirtyflag variables to 64-bit. Avoid a warning.

This commit is contained in:
Henrik Rydgard 2017-01-24 20:00:03 +01:00
parent 62a171c616
commit e17d3e1e7a
4 changed files with 11 additions and 10 deletions

View file

@ -98,6 +98,7 @@ protected:
int prevSizeTex; int prevSizeTex;
int prevSizeCol; int prevSizeCol;
public: public:
virtual ~TessellationDataTransfer() {}
// Send spline/bezier's control points to vertex shader through floating point texture. // Send spline/bezier's control points to vertex shader through floating point texture.
virtual void SendDataToShader(const float *pos, const float *tex, const float *col, int size, bool hasColor, bool hasTexCoords) = 0; virtual void SendDataToShader(const float *pos, const float *tex, const float *col, int size, bool hasColor, bool hasTexCoords) = 0;
}; };

View file

@ -220,7 +220,7 @@ private:
enum { MAX_DEFERRED_DRAW_CALLS = 128 }; enum { MAX_DEFERRED_DRAW_CALLS = 128 };
// State cache // State cache
uint32_t dirtyUniforms_; uint64_t dirtyUniforms_;
uint32_t baseUBOOffset; uint32_t baseUBOOffset;
uint32_t lightUBOOffset; uint32_t lightUBOOffset;
uint32_t boneUBOOffset; uint32_t boneUBOOffset;

View file

@ -187,7 +187,7 @@ uint32_t ShaderManagerVulkan::PushBoneBuffer(VulkanPushBuffer *dest, VkBuffer *b
return dest->PushAligned(&ub_bones, sizeof(ub_bones), uboAlignment_, buf); return dest->PushAligned(&ub_bones, sizeof(ub_bones), uboAlignment_, buf);
} }
void ShaderManagerVulkan::BaseUpdateUniforms(int dirtyUniforms) { void ShaderManagerVulkan::BaseUpdateUniforms(uint64_t dirtyUniforms) {
if (dirtyUniforms & DIRTY_TEXENV) { if (dirtyUniforms & DIRTY_TEXENV) {
Uint8x3ToFloat4(ub_base.texEnvColor, gstate.texenvcolor); Uint8x3ToFloat4(ub_base.texEnvColor, gstate.texenvcolor);
} }
@ -337,7 +337,7 @@ void ShaderManagerVulkan::BaseUpdateUniforms(int dirtyUniforms) {
} }
} }
void ShaderManagerVulkan::LightUpdateUniforms(int dirtyUniforms) { void ShaderManagerVulkan::LightUpdateUniforms(uint64_t dirtyUniforms) {
// Lighting // Lighting
if (dirtyUniforms & DIRTY_AMBIENT) { if (dirtyUniforms & DIRTY_AMBIENT) {
Uint8x3ToFloat4_AlphaUint8(ub_lights.ambientColor, gstate.ambientcolor, gstate.getAmbientA()); Uint8x3ToFloat4_AlphaUint8(ub_lights.ambientColor, gstate.ambientcolor, gstate.getAmbientA());
@ -380,7 +380,7 @@ void ShaderManagerVulkan::LightUpdateUniforms(int dirtyUniforms) {
} }
} }
void ShaderManagerVulkan::BoneUpdateUniforms(int dirtyUniforms) { void ShaderManagerVulkan::BoneUpdateUniforms(uint64_t dirtyUniforms) {
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
if (dirtyUniforms & (DIRTY_BONEMATRIX0 << i)) { if (dirtyUniforms & (DIRTY_BONEMATRIX0 << i)) {
ConvertMatrix4x3To4x4(ub_bones.bones[i], gstate.boneMatrix + 12 * i); ConvertMatrix4x3To4x4(ub_bones.bones[i], gstate.boneMatrix + 12 * i);
@ -425,8 +425,8 @@ void ShaderManagerVulkan::DirtyLastShader() { // disables vertex arrays
lastFShader_ = nullptr; lastFShader_ = nullptr;
} }
uint32_t ShaderManagerVulkan::UpdateUniforms() { uint64_t ShaderManagerVulkan::UpdateUniforms() {
uint32_t dirty = gstate_c.GetDirtyUniforms(); uint64_t dirty = gstate_c.GetDirtyUniforms();
if (dirty != 0) { if (dirty != 0) {
if (dirty & DIRTY_BASE_UNIFORMS) if (dirty & DIRTY_BASE_UNIFORMS)
BaseUpdateUniforms(dirty); BaseUpdateUniforms(dirty);

View file

@ -202,7 +202,7 @@ public:
std::vector<std::string> DebugGetShaderIDs(DebugShaderType type); std::vector<std::string> DebugGetShaderIDs(DebugShaderType type);
std::string DebugGetShaderString(std::string id, DebugShaderType type, DebugShaderStringType stringType); std::string DebugGetShaderString(std::string id, DebugShaderType type, DebugShaderStringType stringType);
uint32_t UpdateUniforms(); uint64_t UpdateUniforms();
// TODO: Avoid copying these buffers if same as last draw, can still point to it assuming we're still in the same pushbuffer. // TODO: Avoid copying these buffers if same as last draw, can still point to it assuming we're still in the same pushbuffer.
// Applies dirty changes and copies the buffer. // Applies dirty changes and copies the buffer.
@ -215,9 +215,9 @@ public:
uint32_t PushBoneBuffer(VulkanPushBuffer *dest, VkBuffer *buf); uint32_t PushBoneBuffer(VulkanPushBuffer *dest, VkBuffer *buf);
private: private:
void BaseUpdateUniforms(int dirtyUniforms); void BaseUpdateUniforms(uint64_t dirtyUniforms);
void LightUpdateUniforms(int dirtyUniforms); void LightUpdateUniforms(uint64_t dirtyUniforms);
void BoneUpdateUniforms(int dirtyUniforms); void BoneUpdateUniforms(uint64_t dirtyUniforms);
void Clear(); void Clear();