Commit 241b77ba by Nicolas Capens Committed by Nicolas Capens

Fix compile errors.

Bug 18621031 Change-Id: I50cf26dd3f78a9a21839118faf8f99ff88de8a36 Reviewed-on: https://swiftshader-review.googlesource.com/1591Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 688b0ad4
...@@ -31,21 +31,21 @@ namespace es ...@@ -31,21 +31,21 @@ namespace es
#if defined(ANGLE_DISABLE_TRACE) #if defined(ANGLE_DISABLE_TRACE)
#define TRACE(message, ...) (void(0)) #define TRACE(message, ...) (void(0))
#else #else
#define TRACE(message, ...) es::trace("trace: %s(%d): "message"\n", __FUNCTION__, __LINE__, ##__VA_ARGS__) #define TRACE(message, ...) es::trace("trace: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
#endif #endif
// A macro to output a function call and its arguments to the debugging log, to denote an item in need of fixing. // A macro to output a function call and its arguments to the debugging log, to denote an item in need of fixing.
#if defined(ANGLE_DISABLE_TRACE) #if defined(ANGLE_DISABLE_TRACE)
#define FIXME(message, ...) (void(0)) #define FIXME(message, ...) (void(0))
#else #else
#define FIXME(message, ...) do {es::trace("fixme: %s(%d): "message"\n", __FUNCTION__, __LINE__, ##__VA_ARGS__); assert(false);} while(false) #define FIXME(message, ...) do {es::trace("fixme: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__); assert(false);} while(false)
#endif #endif
// A macro to output a function call and its arguments to the debugging log, in case of error. // A macro to output a function call and its arguments to the debugging log, in case of error.
#if defined(ANGLE_DISABLE_TRACE) #if defined(ANGLE_DISABLE_TRACE)
#define ERR(message, ...) (void(0)) #define ERR(message, ...) (void(0))
#else #else
#define ERR(message, ...) do {es::trace("err: %s(%d): "message"\n", __FUNCTION__, __LINE__, ##__VA_ARGS__); assert(false);} while(false) #define ERR(message, ...) do {es::trace("err: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__); assert(false);} while(false)
#endif #endif
// A macro asserting a condition and outputting failures to the debug log // A macro asserting a condition and outputting failures to the debug log
......
...@@ -38,12 +38,12 @@ public: ...@@ -38,12 +38,12 @@ public:
return height; return height;
} }
GLenum Image::getFormat() GLenum getFormat()
{ {
return format; return format;
} }
GLenum Image::getType() GLenum getType()
{ {
return type; return type;
} }
...@@ -58,27 +58,27 @@ public: ...@@ -58,27 +58,27 @@ public:
return multiSampleDepth; return multiSampleDepth;
} }
bool Image::isShared() const bool isShared() const
{ {
return shared; return shared;
} }
void Image::markShared() void markShared()
{ {
shared = true; shared = true;
} }
void *Image::lock(unsigned int left, unsigned int top, sw::Lock lock) void *lock(unsigned int left, unsigned int top, sw::Lock lock)
{ {
return lockExternal(left, top, 0, lock, sw::PUBLIC); return lockExternal(left, top, 0, lock, sw::PUBLIC);
} }
unsigned int Image::getPitch() const unsigned int getPitch() const
{ {
return getExternalPitchB(); return getExternalPitchB();
} }
void Image::unlock() void unlock()
{ {
unlockExternal(); unlockExternal();
} }
......
...@@ -196,7 +196,7 @@ const char *EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name) ...@@ -196,7 +196,7 @@ const char *EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name)
case EGL_VENDOR: case EGL_VENDOR:
return success("TransGaming Inc."); return success("TransGaming Inc.");
case EGL_VERSION: case EGL_VERSION:
return success("1.4 SwiftShader "VERSION_STRING); return success("1.4 SwiftShader " VERSION_STRING);
} }
return error(EGL_BAD_PARAMETER, (const char*)NULL); return error(EGL_BAD_PARAMETER, (const char*)NULL);
...@@ -683,7 +683,7 @@ EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLCon ...@@ -683,7 +683,7 @@ EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLCon
} }
} }
} }
egl::Display *display = static_cast<egl::Display*>(dpy); egl::Display *display = static_cast<egl::Display*>(dpy);
if(!validateConfig(display, config)) if(!validateConfig(display, config))
...@@ -984,7 +984,7 @@ EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNat ...@@ -984,7 +984,7 @@ EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNat
__eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress(const char *procname) __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress(const char *procname)
{ {
TRACE("(const char *procname = \"%s\")", procname); TRACE("(const char *procname = \"%s\")", procname);
if(rad::getProcAddress != 0) if(rad::getProcAddress != 0)
{ {
__eglMustCastToProperFunctionPointerType proc = rad::getProcAddress(procname); __eglMustCastToProperFunctionPointerType proc = rad::getProcAddress(procname);
......
...@@ -183,14 +183,14 @@ class Sampler : public Object ...@@ -183,14 +183,14 @@ class Sampler : public Object
public: public:
Sampler(Device *device) : Object(device) Sampler(Device *device) : Object(device)
{ {
default(); defaults();
} }
virtual ~Sampler() virtual ~Sampler()
{ {
} }
void default() void defaults()
{ {
minFilter = RAD_MIN_FILTER_NEAREST_MIPMAP_LINEAR; // FIXME: default? minFilter = RAD_MIN_FILTER_NEAREST_MIPMAP_LINEAR; // FIXME: default?
magFilter = RAD_MAG_FILTER_LINEAR; // FIXME: default? magFilter = RAD_MAG_FILTER_LINEAR; // FIXME: default?
...@@ -236,7 +236,7 @@ struct TextureSampler ...@@ -236,7 +236,7 @@ struct TextureSampler
{ {
TextureSampler(Texture *texture, Sampler *sampler, RADtextureTarget target, RADinternalFormat internalFormat, RADuint minLevel, RADuint numLevels, RADuint minLayer, RADuint numLayers); TextureSampler(Texture *texture, Sampler *sampler, RADtextureTarget target, RADinternalFormat internalFormat, RADuint minLevel, RADuint numLevels, RADuint minLayer, RADuint numLayers);
virtual TextureSampler::~TextureSampler(); virtual ~TextureSampler();
Texture *texture; Texture *texture;
Sampler *sampler; Sampler *sampler;
...@@ -345,16 +345,16 @@ struct ColorState : public Object ...@@ -345,16 +345,16 @@ struct ColorState : public Object
{ {
ColorState(Device *device) : Object(device) ColorState(Device *device) : Object(device)
{ {
default(); defaults();
} }
void default() void defaults()
{ {
enable = RAD_FALSE; enable = RAD_FALSE;
for(size_t i = 0; i < arraySize(blend); i++) for(size_t i = 0; i < arraySize(blend); i++)
{ {
blend[i].default(); blend[i].defaults();
} }
numTargets = 1; numTargets = 1;
...@@ -373,10 +373,10 @@ struct ColorState : public Object ...@@ -373,10 +373,10 @@ struct ColorState : public Object
{ {
Blend() Blend()
{ {
default(); defaults();
} }
void default() void defaults()
{ {
enable = RAD_FALSE; enable = RAD_FALSE;
srcFunc = RAD_BLEND_FUNC_ONE; srcFunc = RAD_BLEND_FUNC_ONE;
...@@ -414,10 +414,10 @@ struct RasterState : public Object ...@@ -414,10 +414,10 @@ struct RasterState : public Object
{ {
RasterState(Device *device) : Object(device) RasterState(Device *device) : Object(device)
{ {
default(); defaults();
} }
void default() void defaults()
{ {
pointSize = 1.0f; pointSize = 1.0f;
lineWidth = 1.0f; lineWidth = 1.0f;
...@@ -459,10 +459,10 @@ struct DepthStencilState : public Object ...@@ -459,10 +459,10 @@ struct DepthStencilState : public Object
{ {
DepthStencilState(Device *device) : Object(device) DepthStencilState(Device *device) : Object(device)
{ {
default(); defaults();
} }
void default() void defaults()
{ {
depthTestEnable = RAD_FALSE; depthTestEnable = RAD_FALSE;
depthWriteEnable = RAD_FALSE; depthWriteEnable = RAD_FALSE;
...@@ -521,19 +521,19 @@ struct VertexState : public Object ...@@ -521,19 +521,19 @@ struct VertexState : public Object
{ {
VertexState(Device *device) : Object(device) VertexState(Device *device) : Object(device)
{ {
default(); defaults();
} }
void default() void defaults()
{ {
for(size_t i = 0; i < arraySize(attrib); i++) for(size_t i = 0; i < arraySize(attrib); i++)
{ {
attrib[i].default(); attrib[i].defaults();
} }
for(size_t i = 0; i < arraySize(binding); i++) for(size_t i = 0; i < arraySize(binding); i++)
{ {
binding[i].default(); binding[i].defaults();
} }
} }
...@@ -541,10 +541,10 @@ struct VertexState : public Object ...@@ -541,10 +541,10 @@ struct VertexState : public Object
{ {
Attribute() Attribute()
{ {
default(); defaults();
} }
void default() void defaults()
{ {
enable = RAD_FALSE; enable = RAD_FALSE;
bindingIndex = 0; bindingIndex = 0;
...@@ -570,10 +570,10 @@ struct VertexState : public Object ...@@ -570,10 +570,10 @@ struct VertexState : public Object
{ {
Binding() Binding()
{ {
default(); defaults();
} }
void default() void defaults()
{ {
group = 0; group = 0;
index = 0; index = 0;
...@@ -593,10 +593,10 @@ struct FormatState : public Object ...@@ -593,10 +593,10 @@ struct FormatState : public Object
{ {
FormatState(Device *device) : Object(device) FormatState(Device *device) : Object(device)
{ {
default(); defaults();
} }
void default() void defaults()
{ {
for(size_t i = 0; i < arraySize(colorFormat); i++) for(size_t i = 0; i < arraySize(colorFormat); i++)
{ {
...@@ -659,7 +659,7 @@ class Pass : public Object ...@@ -659,7 +659,7 @@ class Pass : public Object
public: public:
Pass(Device *device) : Object(device) Pass(Device *device) : Object(device)
{ {
default(); defaults();
} }
virtual ~Pass() virtual ~Pass()
...@@ -683,7 +683,7 @@ public: ...@@ -683,7 +683,7 @@ public:
} }
} }
void default() void defaults()
{ {
numColors = 0; numColors = 0;
...@@ -1602,7 +1602,7 @@ void RADAPIENTRY radReleaseSampler(RADsampler sampler) ...@@ -1602,7 +1602,7 @@ void RADAPIENTRY radReleaseSampler(RADsampler sampler)
void RADAPIENTRY radSamplerDefault(RADsampler sampler) void RADAPIENTRY radSamplerDefault(RADsampler sampler)
{ {
rad::Sampler *radSampler = reinterpret_cast<rad::Sampler*>(sampler); rad::Sampler *radSampler = reinterpret_cast<rad::Sampler*>(sampler);
radSampler->default(); radSampler->defaults();
} }
void RADAPIENTRY radSamplerMinMagFilter(RADsampler sampler, RADminFilter min, RADmagFilter mag) void RADAPIENTRY radSamplerMinMagFilter(RADsampler sampler, RADminFilter min, RADmagFilter mag)
...@@ -1680,7 +1680,7 @@ void RADAPIENTRY radReleaseColorState(RADcolorState color) ...@@ -1680,7 +1680,7 @@ void RADAPIENTRY radReleaseColorState(RADcolorState color)
void RADAPIENTRY radColorDefault(RADcolorState color) void RADAPIENTRY radColorDefault(RADcolorState color)
{ {
rad::ColorState *colorState = reinterpret_cast<rad::ColorState*>(color); rad::ColorState *colorState = reinterpret_cast<rad::ColorState*>(color);
colorState->default(); colorState->defaults();
} }
void RADAPIENTRY radColorBlendEnable(RADcolorState color, RADuint index, RADboolean enable) void RADAPIENTRY radColorBlendEnable(RADcolorState color, RADuint index, RADboolean enable)
...@@ -1771,7 +1771,7 @@ void RADAPIENTRY radReleaseRasterState(RADrasterState raster) ...@@ -1771,7 +1771,7 @@ void RADAPIENTRY radReleaseRasterState(RADrasterState raster)
void RADAPIENTRY radRasterDefault(RADrasterState raster) void RADAPIENTRY radRasterDefault(RADrasterState raster)
{ {
rad::RasterState *rasterState = reinterpret_cast<rad::RasterState*>(raster); rad::RasterState *rasterState = reinterpret_cast<rad::RasterState*>(raster);
rasterState->default(); rasterState->defaults();
} }
void RADAPIENTRY radRasterPointSize(RADrasterState raster, RADfloat pointSize) void RADAPIENTRY radRasterPointSize(RADrasterState raster, RADfloat pointSize)
...@@ -1869,7 +1869,7 @@ void RADAPIENTRY radReleaseDepthStencilState(RADdepthStencilState depthStencil) ...@@ -1869,7 +1869,7 @@ void RADAPIENTRY radReleaseDepthStencilState(RADdepthStencilState depthStencil)
void RADAPIENTRY radDepthStencilDefault(RADdepthStencilState depthStencil) void RADAPIENTRY radDepthStencilDefault(RADdepthStencilState depthStencil)
{ {
rad::DepthStencilState *depthStencilState = reinterpret_cast<rad::DepthStencilState*>(depthStencil); rad::DepthStencilState *depthStencilState = reinterpret_cast<rad::DepthStencilState*>(depthStencil);
depthStencilState->default(); depthStencilState->defaults();
} }
void RADAPIENTRY radDepthStencilDepthTestEnable(RADdepthStencilState depthStencil, RADboolean enable) void RADAPIENTRY radDepthStencilDepthTestEnable(RADdepthStencilState depthStencil, RADboolean enable)
...@@ -2037,7 +2037,7 @@ void RADAPIENTRY radReleaseRtFormatState(RADrtFormatState rtFormat) ...@@ -2037,7 +2037,7 @@ void RADAPIENTRY radReleaseRtFormatState(RADrtFormatState rtFormat)
void RADAPIENTRY radRtFormatDefault(RADrtFormatState rtFormat) void RADAPIENTRY radRtFormatDefault(RADrtFormatState rtFormat)
{ {
rad::FormatState *formatState = reinterpret_cast<rad::FormatState*>(rtFormat); rad::FormatState *formatState = reinterpret_cast<rad::FormatState*>(rtFormat);
formatState->default(); formatState->defaults();
} }
void RADAPIENTRY radRtFormatColorFormat(RADrtFormatState rtFormat, RADuint index, RADinternalFormat format) void RADAPIENTRY radRtFormatColorFormat(RADrtFormatState rtFormat, RADuint index, RADinternalFormat format)
...@@ -2241,7 +2241,7 @@ void RADAPIENTRY radReleasePass(RADpass pass) ...@@ -2241,7 +2241,7 @@ void RADAPIENTRY radReleasePass(RADpass pass)
void RADAPIENTRY radPassDefault(RADpass pass) void RADAPIENTRY radPassDefault(RADpass pass)
{ {
rad::Pass *radPass = reinterpret_cast<rad::Pass*>(pass); rad::Pass *radPass = reinterpret_cast<rad::Pass*>(pass);
radPass->default(); radPass->defaults();
} }
void RADAPIENTRY radCompilePass(RADpass pass) void RADAPIENTRY radCompilePass(RADpass pass)
......
/****************************************************************************** /******************************************************************************
@File OGLES2HelloAPI_Windows.cpp @File rad.cpp
@Title OpenGL ES 2.0 HelloAPI Tutorial @Title Radiance HelloAPI Tutorial
@Version @Version
...@@ -346,6 +346,6 @@ cleanup: ...@@ -346,6 +346,6 @@ cleanup:
} }
/****************************************************************************** /******************************************************************************
End of file (OGLES2HelloAPI_Windows.cpp) End of file (rad.cpp)
******************************************************************************/ ******************************************************************************/
...@@ -352,7 +352,7 @@ void TestRAD() ...@@ -352,7 +352,7 @@ void TestRAD()
radQueueScissor(queue, 0, 0, offscreenWidth, offscreenHeight); radQueueScissor(queue, 0, 0, offscreenWidth, offscreenHeight);
radQueueViewport(queue, 0, 0, offscreenWidth, offscreenHeight); radQueueViewport(queue, 0, 0, offscreenWidth, offscreenHeight);
RADbindGroupElement b[4] = {{vboHandle, 0, ~0}, {vboHandle, sizeof(vertexData), ~0}, {uboHandle, 0, 4*sizeof(float)}, {texHandle, 0, ~0}}; RADbindGroupElement b[4] = {{vboHandle, 0, 0}, {vboHandle, sizeof(vertexData), 0}, {uboHandle, 0, 4*sizeof(float)}, {texHandle, 0, 0}};
RADbuffer bindGroup = AllocAndFillBuffer(device, b, sizeof(b), RAD_BINDGROUP_ACCESS_BIT, false); RADbuffer bindGroup = AllocAndFillBuffer(device, b, sizeof(b), RAD_BINDGROUP_ACCESS_BIT, false);
RADbindGroupHandle bindGroupHandle = radGetBindGroupHandle(bindGroup); RADbindGroupHandle bindGroupHandle = radGetBindGroupHandle(bindGroup);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment