surfaceDescription.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
surfaceDescription.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX;
surfaceDescription.dwBackBufferCount = 1;
- long result = directDraw->CreateSurface(&surfaceDescription, &frontBuffer, 0);
+ directDraw->CreateSurface(&surfaceDescription, &frontBuffer, 0);
if(frontBuffer)
{
{
int width = DDSD.dwWidth;
int height = DDSD.dwHeight;
- int bitDepth = DDSD.ddpfPixelFormat.dwRGBBitCount;
int stride = DDSD.lPitch;
void *sourceBuffer = DDSD.lpSurface;
{
width = DDSD.dwWidth;
height = DDSD.dwHeight;
- int bitDepth = DDSD.ddpfPixelFormat.dwRGBBitCount;
stride = DDSD.lPitch;
locked = DDSD.lpSurface;
default:
return false;
}
-
- return false;
}
bool operator!=(const int i) const
default:
return false; // Invalid operation, handled at semantic analysis
}
-
- return false;
}
bool operator<(const ConstantUnion& constant) const
default:
return false; // Invalid operation, handled at semantic analysis
}
-
- return false;
}
bool operator<=(const ConstantUnion& constant) const
default:
return false; // Invalid operation, handled at semantic analysis
}
-
- return false;
}
bool operator>=(const ConstantUnion& constant) const
default:
return false; // Invalid operation, handled at semantic analysis
}
-
- return false;
}
ConstantUnion operator+(const ConstantUnion& constant) const
return status == True;
}
+ return false;
#elif defined(__APPLE__)
return sw::OSX::IsValidWindow(window);
#else
#error "Display::isValidWindow unimplemented for this platform"
+ return false;
#endif
-
- return false;
}
bool Display::hasExistingWindowSurface(EGLNativeWindowType window)
{
TRACE("(EGLenum platform = 0x%X, void *native_display = %p, const EGLint *attrib_list = %p)", platform, native_display, attrib_list);
- switch(platform)
- {
#if defined(__linux__) && !defined(__ANDROID__)
- case EGL_PLATFORM_X11_EXT: break;
- case EGL_PLATFORM_GBM_KHR: break;
- #endif
- default:
- return error(EGL_BAD_PARAMETER, EGL_NO_DISPLAY);
- }
+ switch(platform)
+ {
+ case EGL_PLATFORM_X11_EXT: break;
+ case EGL_PLATFORM_GBM_KHR: break;
+ default:
+ return error(EGL_BAD_PARAMETER, EGL_NO_DISPLAY);
+ }
- #if defined(__linux__) && !defined(__ANDROID__)
if(platform == EGL_PLATFORM_X11_EXT)
{
if(!libX11)
return success(HEADLESS_DISPLAY);
}
- #endif
- return success(PRIMARY_DISPLAY); // We only support the default display
+ return success(PRIMARY_DISPLAY); // We only support the default display
+ #else
+ return error(EGL_BAD_PARAMETER, EGL_NO_DISPLAY);
+ #endif
}
EGLSurface CreatePlatformWindowSurfaceEXT(EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list)
}
else
{
- unsigned int streamOffset = 0;
+ size_t streamOffset = 0;
int convertCount = count;
streamingBuffer->reserveSpace(convertCount * typeSize(type), type);
computeRange(type, indices, count, &translated->minIndex, &translated->maxIndex);
translated->indexBuffer = streamingBuffer->getResource();
- translated->indexOffset = streamOffset;
+ translated->indexOffset = static_cast<unsigned int>(streamOffset);
}
if(translated->minIndex < start || translated->maxIndex > end)
}
}
-StreamingIndexBuffer::StreamingIndexBuffer(unsigned int initialSize) : mIndexBuffer(NULL), mBufferSize(initialSize)
+StreamingIndexBuffer::StreamingIndexBuffer(size_t initialSize) : mIndexBuffer(NULL), mBufferSize(initialSize)
{
if(initialSize > 0)
{
}
}
-void *StreamingIndexBuffer::map(unsigned int requiredSpace, unsigned int *offset)
+void *StreamingIndexBuffer::map(size_t requiredSpace, size_t *offset)
{
void *mapPtr = NULL;
}
}
-void StreamingIndexBuffer::reserveSpace(unsigned int requiredSpace, GLenum type)
+void StreamingIndexBuffer::reserveSpace(size_t requiredSpace, GLenum type)
{
if(requiredSpace > mBufferSize)
{
class StreamingIndexBuffer
{
public:
- StreamingIndexBuffer(unsigned int initialSize);
+ StreamingIndexBuffer(size_t initialSize);
virtual ~StreamingIndexBuffer();
- void *map(unsigned int requiredSpace, unsigned int *offset);
+ void *map(size_t requiredSpace, size_t *offset);
void unmap();
- void reserveSpace(unsigned int requiredSpace, GLenum type);
+ void reserveSpace(size_t requiredSpace, GLenum type);
sw::Resource *getResource() const;
private:
sw::Resource *mIndexBuffer;
- unsigned int mBufferSize;
- unsigned int mWritePosition;
+ size_t mBufferSize;
+ size_t mWritePosition;
};
class IndexDataManager
return error(GL_INVALID_ENUM, false);
}
- if(internalformat != format)
+ if((GLenum)internalformat != format)
{
if(clientVersion < 3)
{
#undef VALIDATE_INTERNALFORMAT
- if(internalformat != format && !validSizedInternalformat)
+ if((GLenum)internalformat != format && !validSizedInternalformat)
{
return error(GL_INVALID_OPERATION, false);
}
{
if(actualSize == 0) // Estimate size
{
- int instructionCount = 0;
+ size_t instructionCount = 0;
for(llvm::Function::const_iterator basicBlock = function->begin(); basicBlock != function->end(); basicBlock++)
{
instructionCount += basicBlock->size();
#else
for(int j = 1; j < codeSize - 4; j++)
{
- unsigned char modRM_SIB = entry[j - 1];
+ // unsigned char modRM_SIB = entry[j - 1];
uint64_t address = *(uint64_t*)&entry[j];
// if((modRM_SIB & 0x05) == 0x05 && (address % 4) == 0)
default:
return bytes(format) * width * height * depth;
}
-
- return 0;
}
bool Surface::isStencil(Format format)
default:
return false;
}
-
- return false;
}
bool Surface::isSRGBwritable(Format format)
}
}
- void VertexProcessor::setTransformFeedbackBuffer(int index, sw::Resource* buffer, int offset, unsigned int reg, unsigned int row, unsigned int col, size_t stride)
+ void VertexProcessor::setTransformFeedbackBuffer(int index, sw::Resource* buffer, int offset, unsigned int reg, unsigned int row, unsigned int col, unsigned int stride)
{
transformFeedbackInfo[index].buffer = buffer;
transformFeedbackInfo[index].offset = offset;
void setUniformBuffer(int index, sw::Resource* uniformBuffer, int offset);
void lockUniformBuffers(byte** u, sw::Resource* uniformBuffers[]);
- void setTransformFeedbackBuffer(int index, sw::Resource* transformFeedbackBuffer, int offset, unsigned int reg, unsigned int row, unsigned int col, size_t stride);
+ void setTransformFeedbackBuffer(int index, sw::Resource* transformFeedbackBuffer, int offset, unsigned int reg, unsigned int row, unsigned int col, unsigned int stride);
void lockTransformFeedbackBuffers(byte** t, unsigned int* v, unsigned int* r, unsigned int* c, unsigned int* s, sw::Resource* transformFeedbackBuffers[]);
// Transformations
TransformFeedbackInfo();
Resource* buffer;
- int offset;
- int reg;
- int row;
- int col;
- size_t stride;
+ unsigned int offset;
+ unsigned int reg;
+ unsigned int row;
+ unsigned int col;
+ unsigned int stride;
};
TransformFeedbackInfo transformFeedbackInfo[MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS];
void PixelPipeline::blendTexture(Vector4s &temp, Vector4s &texture, int stage)
{
- Vector4s *arg1;
- Vector4s *arg2;
- Vector4s *arg3;
+ Vector4s *arg1 = nullptr;
+ Vector4s *arg2 = nullptr;
+ Vector4s *arg3 = nullptr;
Vector4s res;
Vector4s constant;
usedSamplers |= 1 << i;
}
- const Shader::Instruction *Shader::getInstruction(unsigned int i) const
+ const Shader::Instruction *Shader::getInstruction(size_t i) const
{
ASSERT(i < instruction.size());
void append(Instruction *instruction);
void declareSampler(int i);
- const Instruction *getInstruction(unsigned int i) const;
+ const Instruction *getInstruction(size_t i) const;
int size(unsigned long opcode) const;
static int size(unsigned long opcode, unsigned short version);
for(int i = 0; i < MAX_VERTEX_INPUTS; i++)
{
- input[i] = Semantic(-1, -1);
+ input[i] = Semantic();
}
if(vs) // Make a copy
for(int i = 0; i < MAX_VERTEX_INPUTS; i++)
{
- input[i] = Semantic(-1, -1);
+ input[i] = Semantic();
}
optimize();