1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef GPU_COMMAND_BUFFER_COMMON_CONSTANTS_H_
6 #define GPU_COMMAND_BUFFER_COMMON_CONSTANTS_H_
13 typedef int32_t CommandBufferOffset
;
14 const CommandBufferOffset kInvalidCommandBufferOffset
= -1;
16 // This enum must stay in sync with NPDeviceContext3DError.
26 kDeferCommandUntilLater
,
27 kErrorLast
= kDeferCommandUntilLater
,
30 // Return true if the given error code is an actual error.
31 inline bool IsError(Error error
) {
32 return error
!= kNoError
&& error
!= kDeferCommandUntilLater
;
35 // Provides finer grained information about why the context was lost.
36 enum ContextLostReason
{
37 // This context definitely provoked the loss of context.
40 // This context definitely did not provoke the loss of context.
43 // It is unknown whether this context provoked the loss of context.
46 // GL_OUT_OF_MEMORY caused this context to be lost.
49 // A failure to make the context current caused it to be lost.
52 // The GPU channel was lost. This error is set client-side.
55 kContextLostReasonLast
= kGpuChannelLost
59 // Invalid shared memory Id, returned by RegisterSharedMemory in case of
61 const int32_t kInvalidSharedMemoryId
= -1;
63 // Common Command Buffer shared memory transfer buffer ID.
64 const int32_t kCommandBufferSharedMemoryId
= 4;
66 // The size to set for the program cache.
67 const size_t kDefaultMaxProgramCacheMemoryBytes
= 6 * 1024 * 1024;
69 // Namespace used to separate various command buffer types.
70 enum CommandBufferNamespace
{
77 NUM_COMMAND_BUFFER_NAMESPACES
83 #endif // GPU_COMMAND_BUFFER_COMMON_CONSTANTS_H_