mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-21 06:51:35 +00:00
Fix for compile errors/warnings on linux
* The daily linux auto-compile script was broken, it's fixed now!
This commit is contained in:
+7
-8
@@ -43,7 +43,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#pragma warning(disable : 4101) // unreferenced local variable
|
||||
#pragma warning(disable : 4201) // nonstandard extension used: nameless
|
||||
// struct/union
|
||||
#pragma warning(disable : 4018) // signed/unsigned mismatch
|
||||
|
||||
#pragma warning(disable : 4267) // argument conversion, possible loss of data
|
||||
#endif
|
||||
@@ -6774,7 +6773,7 @@ void WriteAttribute(FILE *fp, const char *name, const char *type,
|
||||
assert(n == sizeof(int));
|
||||
|
||||
n = fwrite(data, 1, len, fp);
|
||||
assert(n == len);
|
||||
assert(n == (size_t)len);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
@@ -6827,7 +6826,7 @@ void WriteChannelInfo(std::vector<unsigned char> &data,
|
||||
size_t sz = 0;
|
||||
|
||||
// Calculate total size.
|
||||
for (int c = 0; c < channels.size(); c++) {
|
||||
for (size_t c = 0; c < channels.size(); c++) {
|
||||
sz += strlen(channels[c].name.c_str()) + 1; // +1 for \0
|
||||
sz += 16; // 4 * int
|
||||
}
|
||||
@@ -6837,7 +6836,7 @@ void WriteChannelInfo(std::vector<unsigned char> &data,
|
||||
|
||||
unsigned char *p = &data.at(0);
|
||||
|
||||
for (int c = 0; c < channels.size(); c++) {
|
||||
for (size_t c = 0; c < channels.size(); c++) {
|
||||
memcpy(p, channels[c].name.c_str(), strlen(channels[c].name.c_str()));
|
||||
p += strlen(channels[c].name.c_str());
|
||||
(*p) = '\0';
|
||||
@@ -7164,7 +7163,7 @@ int LoadEXRFP(float **out_rgba, int *width, int *height, FILE *fp,
|
||||
|
||||
std::vector<float> image(dataWidth * dataHeight * 4); // 4 = RGBA
|
||||
// Set default alpha value to 1.0
|
||||
for (size_t i = 0; i < dataWidth * dataHeight; i++) {
|
||||
for (int i = 0; i < dataWidth * dataHeight; i++) {
|
||||
image[4 * i + 3] = 1.0f;
|
||||
}
|
||||
|
||||
@@ -7449,7 +7448,7 @@ int LoadMultiChannelEXR(EXRImage *exrImage, const char *filename,
|
||||
|
||||
std::vector<float> image(dataWidth * dataHeight * 4); // 4 = RGBA
|
||||
// Set default alpha value to 1.0
|
||||
for (size_t i = 0; i < dataWidth * dataHeight; i++) {
|
||||
for (int i = 0; i < dataWidth * dataHeight; i++) {
|
||||
image[4 * i + 3] = 1.0f;
|
||||
}
|
||||
|
||||
@@ -8183,7 +8182,7 @@ int LoadDeepEXR(DeepImage *deepImage, const char *filename, const char **err) {
|
||||
DecompressZip(reinterpret_cast<unsigned char *>(&sampleData.at(0)),
|
||||
dstLen, dataPtr + 28 + packedOffsetTableSize,
|
||||
packedSampleDataSize);
|
||||
assert(dstLen == unpackedSampleDataSize);
|
||||
assert(dstLen == (unsigned long)unpackedSampleDataSize);
|
||||
}
|
||||
|
||||
// decode sample
|
||||
@@ -8208,7 +8207,7 @@ int LoadDeepEXR(DeepImage *deepImage, const char *filename, const char **err) {
|
||||
}
|
||||
assert(sampleSize >= 2);
|
||||
|
||||
assert(pixelOffsetTable[dataWidth - 1] * sampleSize == sampleData.size());
|
||||
assert(pixelOffsetTable[dataWidth - 1] * sampleSize == (int)sampleData.size());
|
||||
int samplesPerLine = sampleData.size() / sampleSize;
|
||||
|
||||
//
|
||||
|
||||
+2
-2
@@ -5,8 +5,8 @@ MACROS=-DLINUX \
|
||||
-DRENDERDOC_PLATFORM=linux \
|
||||
-DRENDERDOC_EXPORTS \
|
||||
-DGIT_COMMIT_HASH="\"$(COMMIT)\""
|
||||
CFLAGS=-c -Wall -Werror -Wno-unknown-pragmas -fPIC $(MACROS) -I. -I3rdparty/
|
||||
CPPFLAGS=-std=c++11 -g -Wno-unused -Wno-unknown-pragmas -Wno-reorder -fvisibility=hidden -fvisibility-inlines-hidden
|
||||
CFLAGS=-c -Wall -Werror -Wno-unused -Wno-unknown-pragmas -fPIC $(MACROS) -I. -I3rdparty/
|
||||
CPPFLAGS=-std=c++11 -g -Wno-reorder -fvisibility=hidden -fvisibility-inlines-hidden
|
||||
LDFLAGS=-lpthread -lrt -shared -ldl -lX11
|
||||
OBJDIR=.obj
|
||||
OBJECTS=replay/replay_output.o \
|
||||
|
||||
@@ -2685,13 +2685,13 @@ void GLReplay::InitPostVSBuffers(uint32_t frameID, uint32_t eventID)
|
||||
if(drawcall->flags & eDraw_Instanced)
|
||||
{
|
||||
gl.glDrawElementsInstancedBaseVertexBaseInstance(drawtopo, drawcall->numIndices, idxType,
|
||||
(const void *)(drawcall->indexOffset*drawcall->indexByteWidth), drawcall->numInstances,
|
||||
(const void *)uintptr_t(drawcall->indexOffset*drawcall->indexByteWidth), drawcall->numInstances,
|
||||
drawcall->vertexOffset, drawcall->instanceOffset);
|
||||
}
|
||||
else
|
||||
{
|
||||
gl.glDrawElementsBaseVertex(drawtopo, drawcall->numIndices, idxType,
|
||||
(const void *)(drawcall->indexOffset*drawcall->indexByteWidth), drawcall->vertexOffset);
|
||||
(const void *)uintptr_t(drawcall->indexOffset*drawcall->indexByteWidth), drawcall->vertexOffset);
|
||||
}
|
||||
}
|
||||
gl.glEndTransformFeedback();
|
||||
@@ -3095,7 +3095,7 @@ void GLReplay::RenderMesh(uint32_t frameID, uint32_t eventID, const vector<MeshF
|
||||
else if(fmt.idxByteWidth == 4)
|
||||
idxtype = eGL_UNSIGNED_INT;
|
||||
|
||||
gl.glDrawElements(topo, fmt.numVerts, idxtype, (const void *)(fmt.idxoffs));
|
||||
gl.glDrawElements(topo, fmt.numVerts, idxtype, (const void *)uintptr_t(fmt.idxoffs));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3247,7 +3247,7 @@ void GLReplay::RenderMesh(uint32_t frameID, uint32_t eventID, const vector<MeshF
|
||||
GLuint ib = m_pDriver->GetResourceManager()->GetCurrentResource(cfg.position.idxbuf).name;
|
||||
gl.glBindBuffer(eGL_ELEMENT_ARRAY_BUFFER, ib);
|
||||
}
|
||||
gl.glDrawElements(topo, cfg.position.numVerts, idxtype, (const void *)(cfg.position.idxoffs));
|
||||
gl.glDrawElements(topo, cfg.position.numVerts, idxtype, (const void *)uintptr_t(cfg.position.idxoffs));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3290,7 +3290,7 @@ void GLReplay::RenderMesh(uint32_t frameID, uint32_t eventID, const vector<MeshF
|
||||
GLuint ib = m_pDriver->GetResourceManager()->GetCurrentResource(cfg.position.idxbuf).name;
|
||||
gl.glBindBuffer(eGL_ELEMENT_ARRAY_BUFFER, ib);
|
||||
}
|
||||
gl.glDrawElements(topo != eGL_PATCHES ? topo : eGL_POINTS, cfg.position.numVerts, idxtype, (const void *)(cfg.position.idxoffs));
|
||||
gl.glDrawElements(topo != eGL_PATCHES ? topo : eGL_POINTS, cfg.position.numVerts, idxtype, (const void *)uintptr_t(cfg.position.idxoffs));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3344,7 +3344,7 @@ void GLReplay::RenderMesh(uint32_t frameID, uint32_t eventID, const vector<MeshF
|
||||
m_HighlightCache.offs = cfg.position.offset;
|
||||
m_HighlightCache.stage = stage;
|
||||
|
||||
UINT bytesize = cfg.position.idxByteWidth;
|
||||
uint32_t bytesize = cfg.position.idxByteWidth;
|
||||
|
||||
m_HighlightCache.data = GetBufferData(cfg.position.buf, 0, 0);
|
||||
|
||||
|
||||
@@ -1041,7 +1041,7 @@ void GLRenderState::Serialise(LogState state, void *ctx, WrappedOpenGL *gl)
|
||||
"GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY",
|
||||
};
|
||||
|
||||
for(int t=0; t < ARRAY_COUNT(texArrays); t++)
|
||||
for(size_t t=0; t < ARRAY_COUNT(texArrays); t++)
|
||||
{
|
||||
RDCEraseEl(ids);
|
||||
if(state >= WRITING)
|
||||
|
||||
@@ -2727,6 +2727,8 @@ ResourceId GLReplay::CreateProxyTexture(FetchTexture templateTex)
|
||||
|
||||
switch(templateTex.resType)
|
||||
{
|
||||
case eResType_None:
|
||||
break;
|
||||
case eResType_Buffer:
|
||||
case eResType_Texture1D:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user