Browse Source

Patch triangle fixes into occlusion

master
Brian Ho 6 years ago
parent
commit
4e653cfd62
4 changed files with 4 additions and 11 deletions
  1. 2
    5
      Makefile
  2. 2
    2
      occlusion.cc
  3. 0
    1
      occlusion.frag
  4. 0
    3
      occlusion.vert

+ 2
- 5
Makefile View File

@glslc -c ${NAME}.frag @glslc -c ${NAME}.frag


clean: check clean: check
@rm -f ${NAME}
@rm -f ${NAME}.png
@rm -f ${NAME}.vert.spv
@rm -f ${NAME}.frag.spv
@rm -f ${NAME} ${NAME}.png ${NAME}.vert.spv ${NAME}.frag.spv
ifneq ($(target), local) ifneq ($(target), local)
@ssh $(SSH_DUT) 'rm -f ~/${NAME} ~/${NAME}.png'
@ssh $(SSH_DUT) 'rm -f ~/${NAME} ~/${NAME}.png ~/${NAME}.vert.spv ~/${NAME}.frag.spv'
endif endif


check: check:

+ 2
- 2
occlusion.cc View File

VkMemoryPropertyFlags memory_property_flags) { VkMemoryPropertyFlags memory_property_flags) {
for (uint32_t i = 0; i < device_memory_properties.memoryTypeCount; i++) { for (uint32_t i = 0; i < device_memory_properties.memoryTypeCount; i++) {
// We don't care about performance, so just choose the first mappable memory type. // We don't care about performance, so just choose the first mappable memory type.
if ((valid_image_memory_types % (1 << i)) &&
if ((valid_image_memory_types & (1 << i)) &&
((device_memory_properties.memoryTypes[i].propertyFlags & memory_property_flags) == ((device_memory_properties.memoryTypes[i].propertyFlags & memory_property_flags) ==
memory_property_flags)) { memory_property_flags)) {
return i; return i;


inline VkDeviceMemory AllocateAndBindRenderMemory(VkPhysicalDevice physical_device, inline VkDeviceMemory AllocateAndBindRenderMemory(VkPhysicalDevice physical_device,
VkDevice device, VkImage image) { VkDevice device, VkImage image) {
return AllocateAndBindMemory(physical_device, device, image, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT);
return AllocateAndBindMemory(physical_device, device, image, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
} }


inline VkDeviceMemory AllocateAndBindScanoutMemory(VkPhysicalDevice physical_device, inline VkDeviceMemory AllocateAndBindScanoutMemory(VkPhysicalDevice physical_device,

+ 0
- 1
occlusion.frag View File

#version 450 #version 450
#extension GL_ARB_separate_shader_objects : enable


layout(location = 0) out vec4 outColor; layout(location = 0) out vec4 outColor;



+ 0
- 3
occlusion.vert View File

#version 450 #version 450
#extension GL_ARB_separate_shader_objects : enable

layout(location = 0) out vec3 fragColor;


vec2 positions[3] = vec2[]( vec2 positions[3] = vec2[](
vec2(0.0, -0.5), vec2(0.0, -0.5),

Loading…
Cancel
Save