Adding warnings for OpenGL 4.3
This commit is contained in:
parent
9e39788e07
commit
be0d4e5dff
26
src/rlgl.h
26
src/rlgl.h
|
|
@ -4083,6 +4083,8 @@ unsigned int rlCompileShader(const char *shaderCode, int type)
|
||||||
//case GL_GEOMETRY_SHADER:
|
//case GL_GEOMETRY_SHADER:
|
||||||
#if defined(GRAPHICS_API_OPENGL_43)
|
#if defined(GRAPHICS_API_OPENGL_43)
|
||||||
case GL_COMPUTE_SHADER: TRACELOG(RL_LOG_WARNING, "SHADER: [ID %i] Failed to compile compute shader code", shader); break;
|
case GL_COMPUTE_SHADER: TRACELOG(RL_LOG_WARNING, "SHADER: [ID %i] Failed to compile compute shader code", shader); break;
|
||||||
|
#else
|
||||||
|
case GL_COMPUTE_SHADER: TRACELOG(RL_LOG_WARNING, "SHADER: Compute shaders not enabled. Define GRAPHICS_API_OPENGL_43", shader); break;
|
||||||
#endif
|
#endif
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
@ -4108,6 +4110,8 @@ unsigned int rlCompileShader(const char *shaderCode, int type)
|
||||||
//case GL_GEOMETRY_SHADER:
|
//case GL_GEOMETRY_SHADER:
|
||||||
#if defined(GRAPHICS_API_OPENGL_43)
|
#if defined(GRAPHICS_API_OPENGL_43)
|
||||||
case GL_COMPUTE_SHADER: TRACELOG(RL_LOG_INFO, "SHADER: [ID %i] Compute shader compiled successfully", shader); break;
|
case GL_COMPUTE_SHADER: TRACELOG(RL_LOG_INFO, "SHADER: [ID %i] Compute shader compiled successfully", shader); break;
|
||||||
|
#else
|
||||||
|
case GL_COMPUTE_SHADER: TRACELOG(RL_LOG_WARNING, "SHADER: Compute shaders not enabled. Define GRAPHICS_API_OPENGL_43", shader); break;
|
||||||
#endif
|
#endif
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
@ -4348,6 +4352,8 @@ unsigned int rlLoadComputeShaderProgram(unsigned int shaderId)
|
||||||
|
|
||||||
TRACELOG(RL_LOG_INFO, "SHADER: [ID %i] Compute shader program loaded successfully", program);
|
TRACELOG(RL_LOG_INFO, "SHADER: [ID %i] Compute shader program loaded successfully", program);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
TRACELOG(RL_LOG_WARNING, "SHADER: Compute shaders not enabled. Define GRAPHICS_API_OPENGL_43");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return program;
|
return program;
|
||||||
|
|
@ -4358,6 +4364,8 @@ void rlComputeShaderDispatch(unsigned int groupX, unsigned int groupY, unsigned
|
||||||
{
|
{
|
||||||
#if defined(GRAPHICS_API_OPENGL_43)
|
#if defined(GRAPHICS_API_OPENGL_43)
|
||||||
glDispatchCompute(groupX, groupY, groupZ);
|
glDispatchCompute(groupX, groupY, groupZ);
|
||||||
|
#else
|
||||||
|
TRACELOG(RL_LOG_WARNING, "SHADER: Compute shaders not enabled. Define GRAPHICS_API_OPENGL_43");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4372,8 +4380,11 @@ unsigned int rlLoadShaderBuffer(unsigned int size, const void *data, int usageHi
|
||||||
glBufferData(GL_SHADER_STORAGE_BUFFER, size, data, usageHint? usageHint : RL_STREAM_COPY);
|
glBufferData(GL_SHADER_STORAGE_BUFFER, size, data, usageHint? usageHint : RL_STREAM_COPY);
|
||||||
if (data == NULL) glClearBufferData(GL_SHADER_STORAGE_BUFFER, GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE, NULL); // Clear buffer data to 0
|
if (data == NULL) glClearBufferData(GL_SHADER_STORAGE_BUFFER, GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE, NULL); // Clear buffer data to 0
|
||||||
glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0);
|
glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0);
|
||||||
|
#else
|
||||||
|
TRACELOG(RL_LOG_WARNING, "SSBO: SSBO not enabled. Define GRAPHICS_API_OPENGL_43");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
return ssbo;
|
return ssbo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4382,7 +4393,10 @@ void rlUnloadShaderBuffer(unsigned int ssboId)
|
||||||
{
|
{
|
||||||
#if defined(GRAPHICS_API_OPENGL_43)
|
#if defined(GRAPHICS_API_OPENGL_43)
|
||||||
glDeleteBuffers(1, &ssboId);
|
glDeleteBuffers(1, &ssboId);
|
||||||
|
#else
|
||||||
|
TRACELOG(RL_LOG_WARNING, "SSBO: SSBO not enabled. Define GRAPHICS_API_OPENGL_43");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update SSBO buffer data
|
// Update SSBO buffer data
|
||||||
|
|
@ -4391,6 +4405,8 @@ void rlUpdateShaderBuffer(unsigned int id, const void *data, unsigned int dataSi
|
||||||
#if defined(GRAPHICS_API_OPENGL_43)
|
#if defined(GRAPHICS_API_OPENGL_43)
|
||||||
glBindBuffer(GL_SHADER_STORAGE_BUFFER, id);
|
glBindBuffer(GL_SHADER_STORAGE_BUFFER, id);
|
||||||
glBufferSubData(GL_SHADER_STORAGE_BUFFER, offset, dataSize, data);
|
glBufferSubData(GL_SHADER_STORAGE_BUFFER, offset, dataSize, data);
|
||||||
|
#else
|
||||||
|
TRACELOG(RL_LOG_WARNING, "SSBO: SSBO not enabled. Define GRAPHICS_API_OPENGL_43");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4402,6 +4418,8 @@ unsigned int rlGetShaderBufferSize(unsigned int id)
|
||||||
#if defined(GRAPHICS_API_OPENGL_43)
|
#if defined(GRAPHICS_API_OPENGL_43)
|
||||||
glBindBuffer(GL_SHADER_STORAGE_BUFFER, id);
|
glBindBuffer(GL_SHADER_STORAGE_BUFFER, id);
|
||||||
glGetBufferParameteri64v(GL_SHADER_STORAGE_BUFFER, GL_BUFFER_SIZE, &size);
|
glGetBufferParameteri64v(GL_SHADER_STORAGE_BUFFER, GL_BUFFER_SIZE, &size);
|
||||||
|
#else
|
||||||
|
TRACELOG(RL_LOG_WARNING, "SSBO: SSBO not enabled. Define GRAPHICS_API_OPENGL_43");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return (size > 0)? (unsigned int)size : 0;
|
return (size > 0)? (unsigned int)size : 0;
|
||||||
|
|
@ -4413,6 +4431,8 @@ void rlReadShaderBuffer(unsigned int id, void *dest, unsigned int count, unsigne
|
||||||
#if defined(GRAPHICS_API_OPENGL_43)
|
#if defined(GRAPHICS_API_OPENGL_43)
|
||||||
glBindBuffer(GL_SHADER_STORAGE_BUFFER, id);
|
glBindBuffer(GL_SHADER_STORAGE_BUFFER, id);
|
||||||
glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, offset, count, dest);
|
glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, offset, count, dest);
|
||||||
|
#else
|
||||||
|
TRACELOG(RL_LOG_WARNING, "SSBO: SSBO not enabled. Define GRAPHICS_API_OPENGL_43");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4421,6 +4441,8 @@ void rlBindShaderBuffer(unsigned int id, unsigned int index)
|
||||||
{
|
{
|
||||||
#if defined(GRAPHICS_API_OPENGL_43)
|
#if defined(GRAPHICS_API_OPENGL_43)
|
||||||
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, index, id);
|
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, index, id);
|
||||||
|
#else
|
||||||
|
TRACELOG(RL_LOG_WARNING, "SSBO: SSBO not enabled. Define GRAPHICS_API_OPENGL_43");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4431,6 +4453,8 @@ void rlCopyShaderBuffer(unsigned int destId, unsigned int srcId, unsigned int de
|
||||||
glBindBuffer(GL_COPY_READ_BUFFER, srcId);
|
glBindBuffer(GL_COPY_READ_BUFFER, srcId);
|
||||||
glBindBuffer(GL_COPY_WRITE_BUFFER, destId);
|
glBindBuffer(GL_COPY_WRITE_BUFFER, destId);
|
||||||
glCopyBufferSubData(GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, srcOffset, destOffset, count);
|
glCopyBufferSubData(GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, srcOffset, destOffset, count);
|
||||||
|
#else
|
||||||
|
TRACELOG(RL_LOG_WARNING, "SSBO: SSBO not enabled. Define GRAPHICS_API_OPENGL_43");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4442,6 +4466,8 @@ void rlBindImageTexture(unsigned int id, unsigned int index, int format, bool re
|
||||||
|
|
||||||
rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType);
|
rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType);
|
||||||
glBindImageTexture(index, id, 0, 0, 0, readonly? GL_READ_ONLY : GL_READ_WRITE, glInternalFormat);
|
glBindImageTexture(index, id, 0, 0, 0, readonly? GL_READ_ONLY : GL_READ_WRITE, glInternalFormat);
|
||||||
|
#else
|
||||||
|
TRACELOG(RL_LOG_WARNING, "TEXTURE: Image texture binding not enabled. Define GRAPHICS_API_OPENGL_43");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user