2 // Copyright (c) 2013 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
7 // formatutils9.h: Queries for GL image formats and their translations to D3D9
10 #ifndef LIBGLESV2_RENDERER_FORMATUTILS9_H_
11 #define LIBGLESV2_RENDERER_FORMATUTILS9_H_
13 #include "libGLESv2/formatutils.h"
23 typedef std::set<D3DFORMAT> D3DFormatSet;
25 MipGenerationFunction GetMipGenerationFunction(D3DFORMAT format);
26 LoadImageFunction GetImageLoadFunction(GLenum internalFormat, const Renderer9 *renderer);
28 GLuint GetFormatPixelBytes(D3DFORMAT format);
29 GLuint GetBlockWidth(D3DFORMAT format);
30 GLuint GetBlockHeight(D3DFORMAT format);
31 GLuint GetBlockSize(D3DFORMAT format, GLuint width, GLuint height);
33 void MakeValidSize(bool isImage, D3DFORMAT format, GLsizei *requestWidth, GLsizei *requestHeight, int *levelOffset);
35 const D3DFormatSet &GetAllUsedD3DFormats();
37 ColorReadFunction GetColorReadFunction(D3DFORMAT format);
38 ColorCopyFunction GetFastCopyFunction(D3DFORMAT sourceFormat, GLenum destFormat, GLenum destType, GLuint clientVersion);
40 VertexCopyFunction GetVertexCopyFunction(const gl::VertexFormat &vertexFormat);
41 size_t GetVertexElementSize(const gl::VertexFormat &vertexFormat);
42 VertexConversionType GetVertexConversionType(const gl::VertexFormat &vertexFormat);
43 D3DDECLTYPE GetNativeVertexFormat(const gl::VertexFormat &vertexFormat);
45 GLenum GetDeclTypeComponentType(D3DDECLTYPE declType);
46 int GetDeclTypeComponentCount(D3DDECLTYPE declType);
47 bool IsDeclTypeNormalized(D3DDECLTYPE declType);
49 void InitializeVertexTranslations(const rx::Renderer9 *renderer);
56 D3DFORMAT GetTextureFormat(GLenum internalFormat, const Renderer9 *renderer);
57 D3DFORMAT GetRenderFormat(GLenum internalFormat, const Renderer9 *renderer);
59 D3DMULTISAMPLE_TYPE GetMultisampleType(GLsizei samples);
61 bool RequiresTextureDataInitialization(GLint internalFormat);
62 InitializeTextureDataFunction GetTextureDataInitializationFunction(GLint internalFormat);
69 GLenum GetInternalFormat(D3DFORMAT format);
70 GLsizei GetSamplesCount(D3DMULTISAMPLE_TYPE type);
71 bool IsFormatChannelEquivalent(D3DFORMAT d3dformat, GLenum format, GLuint clientVersion);
77 #endif // LIBGLESV2_RENDERER_FORMATUTILS9_H_