Device.cpp 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. /*
  2. * Copyright (c) 2022, Stephan Unverwerth <s.unverwerth@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibVirtGPU/Device.h>
  7. #include <LibVirtGPU/Image.h>
  8. #include <LibVirtGPU/Shader.h>
  9. namespace VirtGPU {
  10. GPU::DeviceInfo Device::info() const
  11. {
  12. return {
  13. .vendor_name = "SerenityOS",
  14. .device_name = "VirtGPU",
  15. .num_texture_units = GPU::NUM_TEXTURE_UNITS,
  16. .num_lights = 8,
  17. .max_clip_planes = 6,
  18. .max_texture_size = 4096,
  19. .max_texture_lod_bias = 2.f,
  20. .stencil_bits = sizeof(GPU::StencilType) * 8,
  21. .supports_npot_textures = true,
  22. .supports_texture_clamp_to_edge = true,
  23. .supports_texture_env_add = true,
  24. };
  25. }
  26. void Device::draw_primitives(GPU::PrimitiveType, FloatMatrix4x4 const&, FloatMatrix4x4 const&, Vector<GPU::Vertex>&)
  27. {
  28. dbgln("VirtGPU::Device::draw_primitives(): unimplemented");
  29. }
  30. void Device::resize(Gfx::IntSize)
  31. {
  32. dbgln("VirtGPU::Device::resize(): unimplemented");
  33. }
  34. void Device::clear_color(FloatVector4 const&)
  35. {
  36. dbgln("VirtGPU::Device::clear_color(): unimplemented");
  37. }
  38. void Device::clear_depth(GPU::DepthType)
  39. {
  40. dbgln("VirtGPU::Device::clear_depth(): unimplemented");
  41. }
  42. void Device::clear_stencil(GPU::StencilType)
  43. {
  44. dbgln("VirtGPU::Device::clear_stencil(): unimplemented");
  45. }
  46. void Device::blit_from_color_buffer(Gfx::Bitmap&)
  47. {
  48. dbgln("VirtGPU::Device::blit_from_color_buffer(): unimplemented");
  49. }
  50. void Device::blit_from_color_buffer(NonnullRefPtr<GPU::Image>, u32, Vector2<u32>, Vector2<i32>, Vector3<i32>)
  51. {
  52. dbgln("VirtGPU::Device::blit_from_color_buffer(): unimplemented");
  53. }
  54. void Device::blit_from_color_buffer(void*, Vector2<i32>, GPU::ImageDataLayout const&)
  55. {
  56. dbgln("VirtGPU::Device::blit_from_color_buffer(): unimplemented");
  57. }
  58. void Device::blit_from_depth_buffer(void*, Vector2<i32>, GPU::ImageDataLayout const&)
  59. {
  60. dbgln("VirtGPU::Device::blit_from_depth_buffer(): unimplemented");
  61. }
  62. void Device::blit_from_depth_buffer(NonnullRefPtr<GPU::Image>, u32, Vector2<u32>, Vector2<i32>, Vector3<i32>)
  63. {
  64. dbgln("VirtGPU::Device::blit_from_depth_buffer(): unimplemented");
  65. }
  66. void Device::blit_to_color_buffer_at_raster_position(void const*, GPU::ImageDataLayout const&)
  67. {
  68. dbgln("VirtGPU::Device::blit_to_color_buffer_at_raster_position(): unimplemented");
  69. }
  70. void Device::blit_to_depth_buffer_at_raster_position(void const*, GPU::ImageDataLayout const&)
  71. {
  72. dbgln("VirtGPU::Device::blit_to_depth_buffer_at_raster_position(): unimplemented");
  73. }
  74. void Device::set_options(GPU::RasterizerOptions const&)
  75. {
  76. dbgln("VirtGPU::Device::set_options(): unimplemented");
  77. }
  78. void Device::set_light_model_params(GPU::LightModelParameters const&)
  79. {
  80. dbgln("VirtGPU::Device::set_light_model_params(): unimplemented");
  81. }
  82. GPU::RasterizerOptions Device::options() const
  83. {
  84. dbgln("VirtGPU::Device::options(): unimplemented");
  85. return {};
  86. }
  87. GPU::LightModelParameters Device::light_model() const
  88. {
  89. dbgln("VirtGPU::Device::light_model(): unimplemented");
  90. return {};
  91. }
  92. NonnullRefPtr<GPU::Image> Device::create_image(GPU::PixelFormat const& pixel_format, u32 width, u32 height, u32 depth, u32 max_levels)
  93. {
  94. dbgln("VirtGPU::Device::create_image(): unimplemented");
  95. return adopt_ref(*new Image(this, pixel_format, width, height, depth, max_levels));
  96. }
  97. ErrorOr<NonnullRefPtr<GPU::Shader>> Device::create_shader(GPU::IR::Shader const&)
  98. {
  99. dbgln("VirtGPU::Device::create_shader(): unimplemented");
  100. return adopt_ref(*new Shader(this));
  101. }
  102. void Device::set_sampler_config(unsigned, GPU::SamplerConfig const&)
  103. {
  104. dbgln("VirtGPU::Device::set_sampler_config(): unimplemented");
  105. }
  106. void Device::set_light_state(unsigned, GPU::Light const&)
  107. {
  108. dbgln("VirtGPU::Device::set_light_state(): unimplemented");
  109. }
  110. void Device::set_material_state(GPU::Face, GPU::Material const&)
  111. {
  112. dbgln("VirtGPU::Device::set_material_state(): unimplemented");
  113. }
  114. void Device::set_stencil_configuration(GPU::Face, GPU::StencilConfiguration const&)
  115. {
  116. dbgln("VirtGPU::Device::set_stencil_configuration(): unimplemented");
  117. }
  118. void Device::set_texture_unit_configuration(GPU::TextureUnitIndex, GPU::TextureUnitConfiguration const&)
  119. {
  120. dbgln("VirtGPU::Device::set_texture_unit_configuration(): unimplemented");
  121. }
  122. void Device::set_clip_planes(Vector<FloatVector4> const&)
  123. {
  124. dbgln("VirtGPU::Device::set_clip_planes(): unimplemented");
  125. }
  126. GPU::RasterPosition Device::raster_position() const
  127. {
  128. dbgln("VirtGPU::Device::raster_position(): unimplemented");
  129. return {};
  130. }
  131. void Device::set_raster_position(GPU::RasterPosition const&)
  132. {
  133. dbgln("VirtGPU::Device::set_raster_position(): unimplemented");
  134. }
  135. void Device::set_raster_position(FloatVector4 const&, FloatMatrix4x4 const&, FloatMatrix4x4 const&)
  136. {
  137. dbgln("VirtGPU::Device::set_raster_position(): unimplemented");
  138. }
  139. void Device::bind_fragment_shader(RefPtr<GPU::Shader>)
  140. {
  141. dbgln("VirtGPU::Device::bind_fragment_shader(): unimplemented");
  142. }
  143. }