blob: 10c1beeb959bd16f179948bd67dfad94a4ff8558 [file] [log] [blame]
Courtney Goeltzenleuchtera4b278b2014-10-08 08:50:49 -06001/*
2 * XGL Tests
3 *
4 * Copyright (C) 2014 LunarG, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 *
24 * Authors:
25 * Courtney Goeltzenleuchter <courtney@lunarg.com>
26 */
27
28#ifndef XGLRENDERFRAMEWORK_H
29#define XGLRENDERFRAMEWORK_H
30
31#include "xgltestframework.h"
Chia-I Wufb1459b2014-12-29 15:23:20 +080032
33class XglDevice : public xgl_testing::Device
34{
35public:
Mark Lobodzinski17caf572015-01-29 08:55:56 -060036 XglDevice(uint32_t id, XGL_PHYSICAL_GPU obj);
Chia-I Wufb1459b2014-12-29 15:23:20 +080037
38 XGL_DEVICE device() { return obj(); }
39 void get_device_queue();
40
Mark Lobodzinski17caf572015-01-29 08:55:56 -060041 uint32_t id;
Chia-I Wufb1459b2014-12-29 15:23:20 +080042 XGL_PHYSICAL_GPU_PROPERTIES props;
43 const XGL_PHYSICAL_GPU_QUEUE_PROPERTIES *queue_props;
44
45 XGL_QUEUE m_queue;
46};
47
Courtney Goeltzenleuchtera4b278b2014-10-08 08:50:49 -060048
49class XglRenderFramework : public XglTestFramework
50{
51public:
52 XglRenderFramework();
53 ~XglRenderFramework();
54
Courtney Goeltzenleuchtera4b278b2014-10-08 08:50:49 -060055 XGL_DEVICE device() {return m_device->device();}
Tobin Ehlisca915872014-11-18 11:28:33 -070056 XGL_PHYSICAL_GPU gpu() {return objs[0];}
Jon Ashburncdc40be2015-01-02 18:27:14 -070057 XGL_RENDER_PASS renderPass() {return m_renderPass;}
Courtney Goeltzenleuchtera4b278b2014-10-08 08:50:49 -060058 void InitViewport(float width, float height);
Courtney Goeltzenleuchter02d33c12014-10-08 14:26:40 -060059 void InitViewport();
Courtney Goeltzenleuchtera4b278b2014-10-08 08:50:49 -060060 void InitRenderTarget();
61 void InitFramework();
Courtney Goeltzenleuchter53d8d892014-10-08 12:20:26 -060062 void ShutdownFramework();
63 void InitState();
Tony Barboure2c58df2014-11-25 13:18:32 -070064
Courtney Goeltzenleuchtera4b278b2014-10-08 08:50:49 -060065
66protected:
Tony Barbourf52346d2015-01-16 14:27:35 -070067 XGL_APPLICATION_INFO app_info;
Jon Ashburn1e464892015-01-29 15:48:00 -070068 XGL_INSTANCE inst;
Tony Barbourf52346d2015-01-16 14:27:35 -070069 XGL_PHYSICAL_GPU objs[XGL_MAX_PHYSICAL_GPUS];
Mark Lobodzinski17caf572015-01-29 08:55:56 -060070 uint32_t gpu_count;
Tony Barbourf52346d2015-01-16 14:27:35 -070071 XglDevice *m_device;
72 XGL_CMD_BUFFER m_cmdBuffer;
73 XGL_RENDER_PASS m_renderPass;
Tobin Ehlis976fc162015-03-26 08:23:25 -060074 XGL_FRAMEBUFFER m_frameBuffer;
Tony Barbourf52346d2015-01-16 14:27:35 -070075 XGL_MEMORY_REF m_memRefs[5];
76 XGL_DYNAMIC_RS_STATE_OBJECT m_stateRaster;
77 XGL_DYNAMIC_CB_STATE_OBJECT m_colorBlend;
78 XGL_DYNAMIC_VP_STATE_OBJECT m_stateViewport;
79 XGL_DYNAMIC_DS_STATE_OBJECT m_stateDepthStencil;
80 vector<XglImage*> m_renderTargets;
Mark Lobodzinski17caf572015-01-29 08:55:56 -060081 uint32_t m_renderTargetCount;
82 float m_width, m_height;
Tony Barbourf52346d2015-01-16 14:27:35 -070083 XGL_FORMAT m_render_target_fmt;
84 XGL_COLOR_ATTACHMENT_BIND_INFO m_colorBindings[8];
85 XGL_DEPTH_STENCIL_BIND_INFO m_depthStencilBinding;
Courtney Goeltzenleuchtera4b278b2014-10-08 08:50:49 -060086
87 /*
88 * SetUp and TearDown are called by the Google Test framework
89 * to initialize a test framework based on this class.
90 */
91 virtual void SetUp() {
Courtney Goeltzenleuchtera4b278b2014-10-08 08:50:49 -060092 this->app_info.sType = XGL_STRUCTURE_TYPE_APPLICATION_INFO;
93 this->app_info.pNext = NULL;
Chia-I Wuf1a5a742014-12-27 15:16:07 +080094 this->app_info.pAppName = "base";
Courtney Goeltzenleuchtera4b278b2014-10-08 08:50:49 -060095 this->app_info.appVersion = 1;
Chia-I Wuf1a5a742014-12-27 15:16:07 +080096 this->app_info.pEngineName = "unittest";
Courtney Goeltzenleuchtera4b278b2014-10-08 08:50:49 -060097 this->app_info.engineVersion = 1;
Courtney Goeltzenleuchter5adee1c2015-02-23 17:40:15 -070098 this->app_info.apiVersion = XGL_API_VERSION;
Courtney Goeltzenleuchtera4b278b2014-10-08 08:50:49 -060099
Chia-I Wu8089cc12014-12-29 15:18:43 +0800100 InitFramework();
Courtney Goeltzenleuchtera4b278b2014-10-08 08:50:49 -0600101 }
102
103 virtual void TearDown() {
Chia-I Wu8089cc12014-12-29 15:18:43 +0800104 ShutdownFramework();
Courtney Goeltzenleuchtera4b278b2014-10-08 08:50:49 -0600105 }
106};
107
Tony Barbour30cc9e82014-12-17 11:53:55 -0700108class XglIndexBufferObj;
109class XglConstantBufferObj;
110
Chia-I Wu11078b02015-01-04 16:27:24 +0800111class XglCommandBufferObj : public xgl_testing::CmdBuffer
Tony Barbour6d047bf2014-12-10 14:34:45 -0700112{
113public:
114 XglCommandBufferObj(XglDevice *device);
Tony Barbour471338d2014-12-10 17:28:39 -0700115 XGL_CMD_BUFFER GetBufferHandle();
Jon Ashburnc4164b12014-12-31 17:10:47 -0700116 XGL_RESULT BeginCommandBuffer(XGL_CMD_BUFFER_BEGIN_INFO *pInfo);
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700117 XGL_RESULT BeginCommandBuffer(XGL_RENDER_PASS renderpass_obj);
118 XGL_RESULT BeginCommandBuffer();
Tony Barbour471338d2014-12-10 17:28:39 -0700119 XGL_RESULT EndCommandBuffer();
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000120 void PipelineBarrier(XGL_PIPELINE_BARRIER *barrierPtr);
Tony Barbour30cc9e82014-12-17 11:53:55 -0700121 void AddRenderTarget(XglImage *renderTarget);
122 void AddDepthStencil();
123 void ClearAllBuffers();
124 void ClearAllBuffers(XGL_DEPTH_STENCIL_BIND_INFO *depthStencilBinding, XGL_IMAGE depthStencilImage);
Jon Ashburncdc40be2015-01-02 18:27:14 -0700125 void PrepareAttachments();
Tony Barbour30cc9e82014-12-17 11:53:55 -0700126 void BindPipeline(XGL_PIPELINE pipeline);
127 void BindDescriptorSet(XGL_DESCRIPTOR_SET descriptorSet);
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600128 void BindVertexBuffer(XglConstantBufferObj *vertexBuffer, uint32_t offset, uint32_t binding);
129 void BindIndexBuffer(XglIndexBufferObj *indexBuffer, uint32_t offset);
Tony Barbourf52346d2015-01-16 14:27:35 -0700130 void BindStateObject(XGL_STATE_BIND_POINT stateBindPoint, XGL_DYNAMIC_STATE_OBJECT stateObject);
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600131 void Draw(uint32_t firstVertex, uint32_t vertexCount, uint32_t firstInstance, uint32_t instanceCount);
132 void DrawIndexed(uint32_t firstIndex, uint32_t indexCount, int32_t vertexOffset, uint32_t firstInstance, uint32_t instanceCount);
133 void QueueCommandBuffer(XGL_MEMORY_REF *memRefs, uint32_t numMemRefs);
Tony Barbour6d047bf2014-12-10 14:34:45 -0700134
135protected:
136 XglDevice *m_device;
Tony Barbour30cc9e82014-12-17 11:53:55 -0700137 vector<XglImage*> m_renderTargets;
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600138 uint32_t m_renderTargetCount;
Tony Barbour6d047bf2014-12-10 14:34:45 -0700139
140};
141
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800142class XglConstantBufferObj : public xgl_testing::Buffer
Tony Barbour9d951a02014-11-19 16:33:11 -0700143{
144public:
Courtney Goeltzenleuchter3b0a8152014-12-04 15:18:47 -0700145 XglConstantBufferObj(XglDevice *device);
Tony Barbourac3692c2014-11-20 15:06:56 -0700146 XglConstantBufferObj(XglDevice *device, int constantCount, int constantSize, const void* data);
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000147 void BufferMemoryBarrier(
148 XGL_FLAGS outputMask =
149 XGL_MEMORY_OUTPUT_CPU_WRITE_BIT |
150 XGL_MEMORY_OUTPUT_SHADER_WRITE_BIT |
151 XGL_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT |
152 XGL_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT |
153 XGL_MEMORY_OUTPUT_COPY_BIT,
154 XGL_FLAGS inputMask =
155 XGL_MEMORY_INPUT_CPU_READ_BIT |
156 XGL_MEMORY_INPUT_INDIRECT_COMMAND_BIT |
157 XGL_MEMORY_INPUT_INDEX_FETCH_BIT |
158 XGL_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT |
159 XGL_MEMORY_INPUT_UNIFORM_READ_BIT |
160 XGL_MEMORY_INPUT_SHADER_READ_BIT |
161 XGL_MEMORY_INPUT_COLOR_ATTACHMENT_BIT |
162 XGL_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT |
163 XGL_MEMORY_INPUT_COPY_BIT);
164
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600165 void Bind(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_SIZE offset, uint32_t binding);
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800166
167 XGL_BUFFER_VIEW_ATTACH_INFO m_bufferViewInfo;
Tony Barbour9d951a02014-11-19 16:33:11 -0700168
169protected:
Tony Barbourac3692c2014-11-20 15:06:56 -0700170 XglDevice *m_device;
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800171 xgl_testing::BufferView m_bufferView;
Tony Barbourac3692c2014-11-20 15:06:56 -0700172 int m_numVertices;
173 int m_stride;
Tony Barbour38422802014-12-10 14:36:31 -0700174 XglCommandBufferObj *m_commandBuffer;
Chia-I Wua07fee62014-12-28 15:26:08 +0800175 xgl_testing::Fence m_fence;
Tony Barbour9d951a02014-11-19 16:33:11 -0700176};
Courtney Goeltzenleuchter8a785932014-12-04 15:24:05 -0700177
178class XglIndexBufferObj : public XglConstantBufferObj
179{
180public:
181 XglIndexBufferObj(XglDevice *device);
182 void CreateAndInitBuffer(int numIndexes, XGL_INDEX_TYPE dataFormat, const void* data);
183 void Bind(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_SIZE offset);
Tony Barbouraf1f9192014-12-17 10:57:58 -0700184 XGL_INDEX_TYPE GetIndexType();
Courtney Goeltzenleuchter8a785932014-12-04 15:24:05 -0700185
186protected:
187 XGL_INDEX_TYPE m_indexType;
188};
189
Chia-I Wua6bc0ce2014-12-29 14:38:28 +0800190class XglImage : public xgl_testing::Image
191{
192public:
193 XglImage(XglDevice *dev);
194
Chia-I Wua6bc0ce2014-12-29 14:38:28 +0800195public:
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600196 void init( uint32_t w, uint32_t h,
Chia-I Wua6bc0ce2014-12-29 14:38:28 +0800197 XGL_FORMAT fmt, XGL_FLAGS usage,
198 XGL_IMAGE_TILING tiling=XGL_LINEAR_TILING);
199
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600200 // void clear( CommandBuffer*, uint32_t[4] );
Chia-I Wua6bc0ce2014-12-29 14:38:28 +0800201 // void prepare( CommandBuffer*, XGL_IMAGE_STATE );
202
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000203 void layout( XGL_IMAGE_LAYOUT layout )
Chia-I Wua6bc0ce2014-12-29 14:38:28 +0800204 {
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000205 m_imageInfo.layout = layout;
Chia-I Wua6bc0ce2014-12-29 14:38:28 +0800206 }
207 XGL_GPU_MEMORY memory() const
208 {
209 const std::vector<XGL_GPU_MEMORY> mems = memories();
210 return mems.empty() ? XGL_NULL_HANDLE : mems[0];
211 }
212
Tony Barbour5dc515d2015-04-01 17:47:06 -0600213 XGL_RESULT CopyImage(XglImage &fromImage);
Chia-I Wua6bc0ce2014-12-29 14:38:28 +0800214 XGL_IMAGE image() const
215 {
216 return obj();
217 }
218 XGL_COLOR_ATTACHMENT_VIEW targetView()const
219 {
220 return m_targetView.obj();
221 }
222
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000223 XGL_IMAGE_LAYOUT layout() const
Chia-I Wua6bc0ce2014-12-29 14:38:28 +0800224 {
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000225 return ( XGL_IMAGE_LAYOUT )m_imageInfo.layout;
Chia-I Wua6bc0ce2014-12-29 14:38:28 +0800226 }
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600227 uint32_t width() const
Chia-I Wua6bc0ce2014-12-29 14:38:28 +0800228 {
229 return extent().width;
230 }
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600231 uint32_t height() const
Chia-I Wua6bc0ce2014-12-29 14:38:28 +0800232 {
233 return extent().height;
234 }
235
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600236 XGL_RESULT MapMemory(void** ptr);
Chia-I Wua6bc0ce2014-12-29 14:38:28 +0800237 XGL_RESULT UnmapMemory();
238
239protected:
240 XglDevice *m_device;
241
242 xgl_testing::ColorAttachmentView m_targetView;
243 XGL_IMAGE_VIEW_ATTACH_INFO m_imageInfo;
244};
245
Tony Barbour5dc515d2015-04-01 17:47:06 -0600246class XglTextureObj : public XglImage
Tony Barbour9d951a02014-11-19 16:33:11 -0700247{
248public:
Tony Barbourebc093f2015-04-01 16:38:10 -0600249 XglTextureObj(XglDevice *device, uint32_t *colors = NULL);
Tony Barbour9d951a02014-11-19 16:33:11 -0700250 XGL_IMAGE_VIEW_ATTACH_INFO m_textureViewInfo;
Tony Barbour9d951a02014-11-19 16:33:11 -0700251
Tony Barbourebc093f2015-04-01 16:38:10 -0600252
Tony Barbour9d951a02014-11-19 16:33:11 -0700253protected:
254 XglDevice *m_device;
Chia-I Wu13a3aa82014-12-28 15:55:09 +0800255 xgl_testing::ImageView m_textureView;
256 XGL_GPU_SIZE m_rowPitch;
Tony Barbour9d951a02014-11-19 16:33:11 -0700257};
258
Chia-I Wue9864b52014-12-28 16:32:24 +0800259class XglSamplerObj : public xgl_testing::Sampler
Tony Barbour9d951a02014-11-19 16:33:11 -0700260{
261public:
262 XglSamplerObj(XglDevice *device);
Tony Barbour9d951a02014-11-19 16:33:11 -0700263
264protected:
Tony Barbour9d951a02014-11-19 16:33:11 -0700265 XglDevice *m_device;
266
267};
268
Chia-I Wu11078b02015-01-04 16:27:24 +0800269class XglDescriptorSetObj : public xgl_testing::DescriptorRegion
Tony Barbour9d951a02014-11-19 16:33:11 -0700270{
271public:
Tony Barbourac3692c2014-11-20 15:06:56 -0700272 XglDescriptorSetObj(XglDevice *device);
Chia-I Wu11078b02015-01-04 16:27:24 +0800273 ~XglDescriptorSetObj();
274
275 int AppendDummy();
276 int AppendBuffer(XGL_DESCRIPTOR_TYPE type, XglConstantBufferObj* constantBuffer);
277 int AppendSamplerTexture(XglSamplerObj* sampler, XglTextureObj* texture);
278 void CreateXGLDescriptorSet(XglCommandBufferObj *cmdBuffer);
279
Tony Barbourb5f4d082014-12-17 10:54:03 -0700280 XGL_DESCRIPTOR_SET GetDescriptorSetHandle();
Chia-I Wu11078b02015-01-04 16:27:24 +0800281 XGL_DESCRIPTOR_SET_LAYOUT GetLayout();
Tony Barbour9d951a02014-11-19 16:33:11 -0700282
283protected:
Tony Barbourac3692c2014-11-20 15:06:56 -0700284 XglDevice *m_device;
Chia-I Wu11078b02015-01-04 16:27:24 +0800285 vector<XGL_DESCRIPTOR_TYPE_COUNT> m_type_counts;
Tony Barbourac3692c2014-11-20 15:06:56 -0700286 int m_nextSlot;
Chia-I Wu11078b02015-01-04 16:27:24 +0800287
288 vector<const XGL_BUFFER_VIEW_ATTACH_INFO *> m_bufferInfo;
289 vector<XGL_UPDATE_BUFFERS> m_updateBuffers;
290
291 vector<XGL_SAMPLER_IMAGE_VIEW_INFO> m_samplerTextureInfo;
292 vector<XGL_UPDATE_SAMPLER_TEXTURES> m_updateSamplerTextures;
293
294 xgl_testing::DescriptorSetLayout m_layout;
295 xgl_testing::DescriptorSet *m_set;
Tony Barbour9d951a02014-11-19 16:33:11 -0700296};
Tony Barbourac3692c2014-11-20 15:06:56 -0700297
298
Chia-I Wubabc0fd2014-12-29 14:14:03 +0800299class XglShaderObj : public xgl_testing::Shader
Tony Barbour9d951a02014-11-19 16:33:11 -0700300{
301public:
Tony Barboure2c58df2014-11-25 13:18:32 -0700302 XglShaderObj(XglDevice *device, const char * shaderText, XGL_PIPELINE_SHADER_STAGE stage, XglRenderFramework *framework);
Chia-I Wu11078b02015-01-04 16:27:24 +0800303 XGL_PIPELINE_SHADER_STAGE_CREATE_INFO* GetStageCreateInfo();
Tony Barbour9d951a02014-11-19 16:33:11 -0700304
305protected:
306 XGL_PIPELINE_SHADER_STAGE_CREATE_INFO stage_info;
Tony Barbour9d951a02014-11-19 16:33:11 -0700307 XGL_PIPELINE_SHADER_STAGE m_stage;
308 XglDevice *m_device;
Tony Barbour9d951a02014-11-19 16:33:11 -0700309
310};
311
Chia-I Wu2648d092014-12-29 14:24:14 +0800312class XglPipelineObj : public xgl_testing::Pipeline
Tony Barbour9d951a02014-11-19 16:33:11 -0700313{
314public:
315 XglPipelineObj(XglDevice *device);
Tony Barbour5420af02014-12-03 13:58:15 -0700316 void BindPipelineCommandBuffer(XGL_CMD_BUFFER m_cmdBuffer, XglDescriptorSetObj *descriptorSet);
Tony Barbour9d951a02014-11-19 16:33:11 -0700317 void AddShader(XglShaderObj* shaderObj);
318 void AddVertexInputAttribs(XGL_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION* vi_attrib, int count);
319 void AddVertexInputBindings(XGL_VERTEX_INPUT_BINDING_DESCRIPTION* vi_binding, int count);
320 void AddVertexDataBuffer(XglConstantBufferObj* vertexDataBuffer, int binding);
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600321 void AddColorAttachment(uint32_t binding, const XGL_PIPELINE_CB_ATTACHMENT_STATE *att);
Tony Barbourf52346d2015-01-16 14:27:35 -0700322 void SetDepthStencil(XGL_PIPELINE_DS_STATE_CREATE_INFO *);
Tony Barbour976e1cf2014-12-17 11:57:31 -0700323 void CreateXGLPipeline(XglDescriptorSetObj *descriptorSet);
324 XGL_PIPELINE GetPipelineHandle();
Tony Barbour9d951a02014-11-19 16:33:11 -0700325
326protected:
Tony Barbour9d951a02014-11-19 16:33:11 -0700327 XGL_PIPELINE_VERTEX_INPUT_CREATE_INFO m_vi_state;
328 XGL_PIPELINE_IA_STATE_CREATE_INFO m_ia_state;
329 XGL_PIPELINE_RS_STATE_CREATE_INFO m_rs_state;
Tony Barbourf52346d2015-01-16 14:27:35 -0700330 XGL_PIPELINE_CB_STATE_CREATE_INFO m_cb_state;
331 XGL_PIPELINE_DS_STATE_CREATE_INFO m_ds_state;
332 XGL_PIPELINE_MS_STATE_CREATE_INFO m_ms_state;
Tony Barbour9d951a02014-11-19 16:33:11 -0700333 XglDevice *m_device;
Tony Barbour9d951a02014-11-19 16:33:11 -0700334 vector<XglShaderObj*> m_shaderObjs;
335 vector<XglConstantBufferObj*> m_vertexBufferObjs;
336 vector<int> m_vertexBufferBindings;
Tony Barbourf52346d2015-01-16 14:27:35 -0700337 vector<XGL_PIPELINE_CB_ATTACHMENT_STATE> m_colorAttachments;
Tony Barbour9d951a02014-11-19 16:33:11 -0700338 int m_vertexBufferCount;
339
340};
341class XglMemoryRefManager{
342public:
343 XglMemoryRefManager();
Tony Barbourac3692c2014-11-20 15:06:56 -0700344 void AddMemoryRef(XglConstantBufferObj* constantBuffer);
345 void AddMemoryRef(XglTextureObj *texture);
Mark Lobodzinskic52b7752015-02-18 16:38:17 -0600346 void AddMemoryRef(XGL_GPU_MEMORY *mem, uint32_t refCount);
347 void AddRTMemoryRefs(vector<XglImage *>images, uint32_t rtCount);
Tony Barbour9d951a02014-11-19 16:33:11 -0700348 XGL_MEMORY_REF* GetMemoryRefList();
349 int GetNumRefs();
350
351protected:
352 int m_numRefs;
Chia-I Wu283d7a62014-12-28 15:43:42 +0800353 vector<XGL_GPU_MEMORY> m_bufferObjs;
Tony Barbour9d951a02014-11-19 16:33:11 -0700354
355};
356
357
Courtney Goeltzenleuchtera4b278b2014-10-08 08:50:49 -0600358#endif // XGLRENDERFRAMEWORK_H