mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 07:36:15 +00:00
clang/gcc: enable a bunch more warnings (#91)
* clang/gcc: enable -pedantic warnings * suppress a GCC-specific warning in stb_image * And some clang-specific warnings * -Wconversion (clang) -Wold-style-cast (clang+gcc) and fix a few warnings that show up with these (and a few more with -Wconversion on gcc, even though that's not enabled by default) * bunch more warnings * fixes * remove merge error
This commit is contained in:
@@ -181,7 +181,7 @@ namespace opengl {
|
||||
glBindTexture(target, texture->GetHandle());
|
||||
|
||||
ASSERT(texture->GetDimension() == nxt::TextureDimension::e2D);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, copy->rowPitch / static_cast<uint32_t>(TextureFormatPixelSize(texture->GetFormat())));
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, copy->rowPitch / TextureFormatPixelSize(texture->GetFormat()));
|
||||
glTexSubImage2D(target, dst.level, dst.x, dst.y, dst.width, dst.height,
|
||||
format.format, format.type,
|
||||
reinterpret_cast<void*>(static_cast<uintptr_t>(src.offset)));
|
||||
@@ -212,7 +212,7 @@ namespace opengl {
|
||||
texture->GetHandle(), src.level);
|
||||
|
||||
glBindBuffer(GL_PIXEL_PACK_BUFFER, buffer->GetHandle());
|
||||
glPixelStorei(GL_PACK_ROW_LENGTH, copy->rowPitch / static_cast<uint32_t>(TextureFormatPixelSize(texture->GetFormat())));
|
||||
glPixelStorei(GL_PACK_ROW_LENGTH, copy->rowPitch / TextureFormatPixelSize(texture->GetFormat()));
|
||||
ASSERT(src.depth == 1 && src.z == 0);
|
||||
void* offset = reinterpret_cast<void*>(static_cast<uintptr_t>(dst.offset));
|
||||
glReadPixels(src.x, src.y, src.width, src.height, format.format, format.type, offset);
|
||||
|
||||
@@ -192,12 +192,12 @@ namespace opengl {
|
||||
}
|
||||
|
||||
const std::vector<GLuint>& PipelineGL::GetTextureUnitsForSampler(GLuint index) const {
|
||||
ASSERT(index >= 0 && index < unitsForSamplers.size());
|
||||
ASSERT(index < unitsForSamplers.size());
|
||||
return unitsForSamplers[index];
|
||||
}
|
||||
|
||||
const std::vector<GLuint>& PipelineGL::GetTextureUnitsForTexture(GLuint index) const {
|
||||
ASSERT(index >= 0 && index < unitsForSamplers.size());
|
||||
ASSERT(index < unitsForSamplers.size());
|
||||
return unitsForTextures[index];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user